/*
Theme Name: 墨野 Moye
Theme URI: https://example.com/moye
Author: Codex
Description: 一个克制、现代、专注阅读体验的中文 WordPress 博客主题。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: moye-blog
*/

:root {
  --ink: #10201c;
  --muted: #60706a;
  --paper: #f5f5ef;
  --surface: #fffefa;
  --line: #d9ded8;
  --accent: #b8ef61;
  --accent-dark: #173d2d;
  --radius: 22px;
  --shadow: 0 18px 50px rgba(16, 32, 28, .09);
  --wrap: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--accent-dark); }
img { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 3px; }
.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; }
.skip-link:focus { position: fixed; z-index: 9999; top: 12px; left: 12px; width: auto; height: auto; padding: 10px 16px; margin: 0; clip: auto; background: var(--ink); color: white; border-radius: 8px; }
.site-wrap { width: min(calc(100% - 40px), var(--wrap)); margin-inline: auto; }

.site-header { position: sticky; z-index: 100; top: 0; background: rgba(245,245,239,.9); border-bottom: 1px solid rgba(16,32,28,.1); backdrop-filter: blur(16px); }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.site-branding { display: flex; align-items: center; gap: 12px; min-width: 0; }
.custom-logo-link { display: block; flex: 0 0 auto; }
.custom-logo-link img { width: 42px; height: 42px; object-fit: cover; border-radius: 50%; }
.brand-mark { width: 38px; aspect-ratio: 1; display: grid; place-items: center; flex: 0 0 auto; color: var(--accent); background: var(--ink); border-radius: 50% 50% 50% 12px; font-weight: 900; text-decoration: none; }
.site-title { margin: 0; font-size: 1.08rem; font-weight: 850; line-height: 1.2; letter-spacing: -.02em; }
.site-title a { text-decoration: none; }
.site-description { margin: 3px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.2; }
.main-navigation ul { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.main-navigation a { display: block; padding: 9px 13px; border-radius: 999px; font-size: .92rem; font-weight: 650; text-decoration: none; }
.main-navigation a:hover, .main-navigation .current-menu-item > a { background: var(--ink); color: white; }
.menu-toggle { display: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer; }
.menu-toggle span, .menu-toggle::before, .menu-toggle::after { content: ""; display: block; width: 18px; height: 2px; margin: 4px auto; background: currentColor; transition: .2s; }

.hero { padding: clamp(54px, 9vw, 112px) 0 54px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: clamp(36px, 7vw, 90px); align-items: end; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 20px; color: var(--accent-dark); font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 28px; height: 9px; background: var(--accent); border-radius: 999px; }
.hero h1 { max-width: 840px; margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(3rem, 8vw, 7.4rem); font-weight: 500; letter-spacing: -.065em; line-height: .98; }
.hero h1 em { position: relative; font-style: normal; white-space: nowrap; }
.hero h1 em::after { content: ""; position: absolute; z-index: -1; left: -.02em; right: -.05em; bottom: .08em; height: .22em; background: var(--accent); border-radius: 999px; transform: rotate(-1deg); }
.hero-copy { padding: 24px 0 4px; border-top: 1px solid var(--ink); }
.hero-copy p { margin: 0 0 24px; color: var(--muted); font-size: 1rem; }
.hero-link { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; }
.hero-link::after { content: "\2192"; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); transition: transform .2s; }
.hero-link:hover::after { transform: translateX(5px); }

.content-shell { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 44px; padding-bottom: 88px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin: 0 0 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.section-head h2, .archive-header h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: -.045em; line-height: 1.1; }
.section-head span { color: var(--muted); font-size: .82rem; }
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.post-card { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: transform .25s, box-shadow .25s; }
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.post-card:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1.1fr .9fr; }
.post-card:first-child .post-thumbnail { min-height: 330px; }
.post-thumbnail { display: block; min-height: 220px; overflow: hidden; background: var(--ink); text-decoration: none; }
.post-thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.post-card:hover .post-thumbnail img { transform: scale(1.03); }
.post-placeholder { height: 100%; min-height: inherit; display: grid; place-items: center; color: var(--accent); background: radial-gradient(circle at 70% 25%, #325345 0 8%, transparent 8.5%), linear-gradient(135deg, #10201c, #274438); font-family: Georgia, serif; font-size: 4rem; }
.post-card-body { display: flex; flex-direction: column; padding: clamp(22px, 4vw, 34px); }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 14px; color: var(--muted); font-size: .78rem; font-weight: 650; }
.post-meta a { color: var(--accent-dark); text-decoration: none; }
.post-card h2 { margin: 0 0 12px; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(1.35rem, 3vw, 2.15rem); letter-spacing: -.035em; line-height: 1.22; }
.post-card h2 a { text-decoration: none; }
.post-card .excerpt { margin: 0 0 24px; color: var(--muted); }
.read-more { margin-top: auto; font-size: .88rem; font-weight: 800; text-decoration: none; }
.read-more::after { content: "  \2197"; }

.sidebar { align-self: start; position: sticky; top: 104px; }
.widget { margin-bottom: 20px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.widget-title { margin: 0 0 14px; font-size: .88rem; letter-spacing: .08em; text-transform: uppercase; }
.widget ul { margin: 0; padding: 0; list-style: none; }
.widget li { padding: 9px 0; border-top: 1px solid var(--line); }
.widget li:first-child { border-top: 0; }
.widget a { text-decoration: none; }
.widget_search { padding: 0; border: 0; background: none; }
.search-form { display: flex; gap: 8px; }
.search-field { min-width: 0; width: 100%; padding: 12px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
.search-submit, input[type="submit"] { padding: 12px 17px; border: 0; border-radius: 12px; background: var(--ink); color: white; font-weight: 750; cursor: pointer; }

.archive-header { margin: 0 0 30px; padding: 56px 0 28px; border-bottom: 1px solid var(--line); }
.archive-description { max-width: 680px; color: var(--muted); }
.pagination { margin-top: 34px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers { min-width: 40px; height: 40px; display: grid; place-items: center; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.page-numbers.current { background: var(--ink); color: white; border-color: var(--ink); }

.single-shell { max-width: 820px; margin: 0 auto; padding: clamp(54px, 9vw, 100px) 0; }
.entry-header { margin-bottom: 38px; text-align: center; }
.entry-title { margin: 10px 0 20px; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(2.5rem, 7vw, 5.7rem); font-weight: 500; letter-spacing: -.06em; line-height: 1.04; }
.entry-header .post-meta { justify-content: center; }
.single-thumbnail { margin: 0 calc(50% - 50vw) 52px; width: 100vw; max-height: 680px; object-fit: cover; }
.entry-content { font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(1.05rem, 2vw, 1.18rem); line-height: 1.9; }
.entry-content > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.entry-content h2, .entry-content h3 { margin-top: 2.2em; line-height: 1.3; letter-spacing: -.025em; }
.entry-content blockquote { margin-top: 2em; margin-bottom: 2em; padding: 24px 28px; background: var(--accent); border-radius: 0 18px 18px 0; border-left: 5px solid var(--ink); font-size: 1.18em; }
.entry-content pre { overflow: auto; padding: 22px; border-radius: 14px; background: #101815; color: #eaf8df; }
.entry-content img { border-radius: 16px; }
.entry-footer { margin-top: 42px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.post-navigation { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; }
.post-navigation a { display: block; height: 100%; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; text-decoration: none; }
.nav-next { text-align: right; }

.comments-area { margin-top: 60px; }
.comments-title { font-size: 1.4rem; }
.comment-list { padding: 0; list-style: none; }
.comment-body { margin: 20px 0; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.comment-meta { font-size: .82rem; }
.comment-content p:last-child { margin-bottom: 0; }
.comment-respond { margin-top: 38px; }
.comment-form label { display: block; margin-bottom: 6px; font-size: .86rem; font-weight: 750; }
.comment-form input:not([type="submit"]), .comment-form textarea { width: 100%; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }

.not-found { padding: 100px 0; text-align: center; }
.not-found strong { display: block; color: var(--accent-dark); font-family: Georgia, serif; font-size: clamp(6rem, 18vw, 12rem); line-height: .8; }
.not-found h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
.not-found .search-form { max-width: 460px; margin: 30px auto 0; }

.site-footer { padding: 56px 0 30px; background: var(--ink); color: #dce8e2; }
.footer-grid { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end; }
.footer-title { margin: 0 0 8px; color: white; font-family: Georgia, serif; font-size: clamp(2rem, 5vw, 4.2rem); letter-spacing: -.05em; line-height: 1; }
.footer-copy { max-width: 520px; color: #9fb2aa; }
.footer-menu { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 16px; margin: 0; padding: 0; list-style: none; }
.footer-menu a { color: white; text-decoration: none; }
.site-info { margin-top: 45px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.15); color: #91a39c; font-size: .78rem; }

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .main-navigation { position: fixed; inset: 76px 0 auto; max-height: 0; overflow: hidden; background: var(--paper); transition: max-height .3s; }
  .main-navigation.is-open { max-height: calc(100vh - 76px); border-bottom: 1px solid var(--line); }
  .main-navigation ul { width: min(calc(100% - 40px), var(--wrap)); margin: 0 auto; padding: 18px 0 28px; flex-direction: column; align-items: stretch; }
  .main-navigation a { padding: 13px 16px; font-size: 1.05rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { max-width: 520px; }
  .content-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
}

@media (max-width: 640px) {
  .site-wrap { width: min(calc(100% - 28px), var(--wrap)); }
  .site-description { display: none; }
  .hero { padding-top: 46px; }
  .hero h1 { font-size: clamp(2.8rem, 15vw, 4.6rem); }
  .post-grid { grid-template-columns: 1fr; }
  .post-card:first-child { grid-column: auto; display: block; }
  .post-card:first-child .post-thumbnail { min-height: 230px; }
  .sidebar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-menu { justify-content: flex-start; }
  .post-navigation .nav-links { grid-template-columns: 1fr; }
  .nav-next { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
