/*
Theme Name: Wanmei Grove 丸美林间
Theme URI: https://147227.xyz
Author: 丸美小沐
Description: 丸美小沐的个人博客主题。深绿侧栏、米白底色、宋体标题；栏目与分类两级导航，另有专题与归档页。
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.7
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: wanmei-grove
*/

:root {
  --green: #16372E;
  --green-ink: #0B2A1F;
  --link: #1F3A2F;
  --gold: #E3C47D;
  --gold-line: #C8AE6A;
  --gold-ink: #8C6D2C;
  --paper: #F5F3EF;
  --paper-deep: #EDEAE2;
  --ink: #151515;
  --ink-2: #2B2B2B;
  --muted: #646363;
  --muted-2: #6B6B67;
  --date: #656564;
  --caption: #6E6E6A;
  --rule: #D4D3CF;
  --rule-2: #E5E4DF;
  --side-text: #E6EEEA;
  --side-motto: #D2DFD9;
  --side-muted: #BED2CC;
  --side-rule: #355248;
  --logo: #F7F5EE;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "Songti SC", "STSong", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--paper); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--link); }
a:hover { color: var(--gold-ink); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 3px; }

.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 {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; background: var(--gold); color: var(--green-ink);
  font-weight: 600; text-decoration: none; border-radius: 4px;
}
.skip-link:focus { top: 12px; }

/* ========== 布局 ========== */

.site { display: flex; min-height: 100vh; }

.sidebar {
  flex: 0 0 280px;
  width: 280px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 72px 44px 48px 45px;
  background: var(--green);
  color: var(--side-text);
}

.main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 48px 44px 64px 46px;
}
.main:focus { outline: none; }

.wrap { max-width: 1200px; margin: 0 auto; }

/* ========== 侧栏 ========== */

.sidebar__logo {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 52px;
  line-height: 1.15;
  letter-spacing: 1px;
  color: var(--logo);
  text-decoration: none;
  white-space: nowrap;
}
.sidebar__logo:hover { color: #fff; }

.sidebar__rule {
  margin-top: 28px;
  width: 100%;
  max-width: 191px;
  height: 2px;
  background: var(--gold-line);
}

.sidebar__motto {
  margin: 34px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 21px;
  line-height: 35px;
  letter-spacing: .32em;
  color: var(--side-motto);
}

.sidebar__nav {
  margin-top: 63px;
  display: flex;
  flex-direction: column;
  gap: 17px;
}
.sidebar__nav a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding-left: 27px;
  border-left: 3px solid transparent;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  color: var(--side-text);
  text-decoration: none;
  transition: color .15s;
}
.sidebar__nav a:hover { color: #fff; }
.sidebar__nav a.is-current { color: var(--gold); border-left-color: var(--gold); }

.sidebar__spacer { flex: 1 0 40px; }

.sidebar__foot {
  max-width: 191px;
  padding-top: 26px;
  border-top: 1px solid var(--side-rule);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.sidebar__domain { font-size: 15px; color: var(--side-muted); }

.sidebar__search {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #BFD1C9;
  color: var(--side-muted);
}
.sidebar__search svg { flex: none; }
.sidebar__search input {
  flex: 1;
  min-width: 0;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--logo);
  font: inherit;
  font-size: 16px;
}
.sidebar__search input::placeholder { color: var(--side-muted); opacity: 1; }
.sidebar__search input:focus { outline: none; }
.sidebar__search:focus-within { border-bottom-color: var(--gold); }
.sidebar__search input::-webkit-search-cancel-button { filter: invert(1); }

/* ========== 页头 ========== */

.eyebrow {
  margin: 0;
  font-size: 17px;
  letter-spacing: 2px;
  color: var(--muted-2);
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--link); }

.page-title {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(36px, 4.5vw, 64px);
  line-height: 1.15;
  color: var(--green-ink);
  letter-spacing: 0;
}

.lede {
  margin: 8px 0 0;
  font-size: 22px;
  line-height: 1.5;
  color: var(--muted);
}

.desc {
  margin: 18px 0 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
}

.empty { margin: 32px 0 0; color: var(--muted); }

/* ========== 首页大图 ========== */

.hero { margin: 20px 0 0; }
.hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1117 / 398;
  object-fit: cover;
  object-position: 50% 60%;
  background: #C9D3CC;
}
.hero figcaption {
  margin-top: 12px;
  font-size: 15px;
  letter-spacing: 1.5px;
  color: var(--caption);
}

/* ========== 区块与列表 ========== */

.section { margin-top: 50px; }
.section--group { margin-top: 56px; }

.section__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.section__head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.3;
  color: #141414;
}
.section__head h2 a { color: inherit; text-decoration: none; }
.section__head h2 a:hover { color: var(--link); }

.section__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 17px;
  color: var(--link);
  text-decoration: none;
}
.section__more:hover { color: var(--gold-ink); }
.section__count { font-size: 17px; color: var(--muted); }

.list--ruled { margin-top: 22px; border-top: 1px solid var(--rule); }

.row {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr) 24px;
  align-items: center;
  column-gap: 0;
  padding: 17px 0;
  border-bottom: 1px solid var(--rule-2);
  color: var(--ink);
  text-decoration: none;
}
.row__date {
  font-size: 17px;
  color: var(--date);
  font-variant-numeric: tabular-nums;
}
.row__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding-right: 24px; }
.row__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.35;
  color: var(--ink);
  transition: color .15s;
}
.row__meta { font-size: 16px; color: var(--muted-2); }
.row__arrow { color: #57575B; transition: transform .2s, color .15s; }
.row:hover .row__title { color: var(--link); }
.row:hover .row__arrow { color: var(--link); transform: translateX(4px); }

/* ========== 栏目标签与分类胶囊 ========== */

.tabs {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  column-gap: 40px;
  border-bottom: 1px solid var(--rule);
}
.tab {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 56px;
  padding: 6px 0 10px;
  margin-bottom: -1px;
  border-bottom: 3px solid transparent;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  color: var(--muted);
  text-decoration: none;
}
.tab:hover { color: var(--green-ink); }
.tab.is-current { color: var(--green-ink); font-weight: 700; border-bottom-color: var(--green); }
.tab__count { font-family: var(--sans); font-weight: 400; font-size: 15px; color: var(--muted-2); }

.chips { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #C9C6BE;
  border-radius: 999px;
  color: #3A3D3B;
  font-size: 16px;
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--green); color: var(--green-ink); }
.chip__count { font-size: 14px; color: var(--muted-2); }
.chip.is-current { background: var(--green); border-color: var(--green); color: var(--logo); }
.chip.is-current .chip__count { color: #C9D8D2; }

/* ========== 分页 ========== */

.pager {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  color: var(--muted);
}
.pager__links { display: flex; gap: 24px; }
.pager__links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 17px;
  color: var(--link);
  text-decoration: none;
}
.pager__links a:hover { color: var(--gold-ink); }
.pager__links .row__arrow { color: currentColor; }

/* ========== 归档 ========== */

.months {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 12px;
}
@media (max-width: 1100px) {
  .months { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .months { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.month {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--rule-2);
  color: var(--ink);
  text-decoration: none;
}
a.month:hover .month__name { color: var(--link); }
.month__name { font-family: var(--serif); font-weight: 500; font-size: 22px; line-height: 1.4; }
.month__count { font-size: 15px; color: var(--muted-2); }
.month.is-empty { border-bottom-color: #ECEBE6; }
.month.is-empty .month__name, .month.is-empty .month__count { color: #A8A7A2; }

/* ========== 搜索、按钮 ========== */

.search-inline { margin-top: 24px; display: flex; gap: 10px; max-width: 560px; }
.search-inline input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid #C9C6BE;
  border-radius: 6px;
  background: #FFFDF9;
  color: var(--ink);
  font: inherit;
}
.search-inline input:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }
.search-inline button, .button, .comment-form input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: var(--green);
  color: var(--logo);
  font: inherit;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
}
.search-inline button:hover, .button:hover, .comment-form input[type="submit"]:hover { background: var(--green-ink); color: #fff; }
.button--ghost { background: transparent; color: var(--green-ink); }
.button--ghost:hover { background: var(--green); color: var(--logo); }
.actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }

/* ========== 文章页 ========== */

.post-head { max-width: 880px; }
.post-title {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.32;
  color: var(--green-ink);
}
.post-meta {
  margin: 18px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-size: 16px;
  color: var(--muted-2);
}
.post-meta a { color: var(--link); }
.post-series { margin: 10px 0 0; font-size: 16px; color: var(--muted); }
.post-series a { text-decoration: none; }
.post-series a:hover { text-decoration: underline; }

.entry {
  max-width: 760px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  font-size: 17px;
  line-height: 1.9;
  color: var(--ink-2);
  overflow-wrap: break-word;
}
.entry--page { border-top: 0; padding-top: 0; }
.entry > *:first-child { margin-top: 0 !important; }
.entry p { margin: 0 0 1.15em; }
.entry h2, .entry h3, .entry h4 {
  font-family: var(--serif) !important;
  color: var(--green-ink) !important;
  text-align: left !important;
}
.entry h2 { margin: 2.2em 0 .8em !important; font-size: 26px !important; font-weight: 700 !important; line-height: 1.45 !important; }
.entry h3 { margin: 1.8em 0 .6em !important; font-size: 21px !important; font-weight: 700 !important; line-height: 1.5 !important; }
.entry h4 { margin: 1.6em 0 .5em !important; font-size: 18px !important; font-weight: 700 !important; }
.entry a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.entry a:hover { color: var(--gold-ink); }
.entry img { display: inline-block; max-width: 100% !important; height: auto !important; border-radius: 2px; }
.entry figure { margin: 1.6em 0; }
.entry figcaption, .entry .wp-caption-text { margin-top: 8px; font-size: 14px; color: var(--muted-2); text-align: center; }
.entry ul, .entry ol { padding-left: 1.4em; margin: 0 0 1.15em; }
.entry li { margin: .3em 0; }
.entry blockquote {
  margin: 1.6em 0 !important;
  padding: 16px 20px !important;
  background: var(--paper-deep) !important;
  border: 0 !important;
  border-left: 3px solid var(--gold-line) !important;
  line-height: 1.85 !important;
  color: var(--ink-2);
}
.entry blockquote p:last-child { margin-bottom: 0; }
.entry hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }
.entry table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 15px; line-height: 1.6; display: block; overflow-x: auto; }
.entry th, .entry td { padding: 10px 12px; border: 1px solid var(--rule); text-align: left; vertical-align: top; }
.entry th { background: var(--paper-deep); font-weight: 600; }
.entry pre {
  margin: 1.6em 0;
  padding: 16px 18px;
  overflow-x: auto;
  background: #1F2A25;
  color: #E9EFEC;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.7;
}
.entry code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.entry :not(pre) > code { padding: 2px 6px; background: var(--paper-deep); border-radius: 4px; }

/* 公众号（mdnice）导入稿的内联样式，统一成本主题的字号和配色；只改显示，不改数据库 */
.entry [style*="font-size:15px"] { font-size: 17px !important; }
.entry [style*="color:#505050"] { color: var(--ink-2) !important; }
.entry [style*="padding:8px 10px 8px 12px"] { padding: 0 !important; }
.entry [style*="letter-spacing:0.2px"] { letter-spacing: normal !important; }
.entry [style*="line-height:2;"] { line-height: 1.9 !important; }
.entry [style*="color:#8749C8"] { color: var(--green-ink) !important; }
.entry h2 span[style*="color:#8749C8"] { color: var(--gold-ink) !important; }
.entry [style*="font-size:11px"] { font-size: 14px !important; color: var(--muted-2) !important; }
.entry [style*="margin:50px 0 20px 12px"] { margin-left: 0 !important; }
.entry [style*="border-left:1px dashed #C0B2BE"] { margin-left: 0 !important; }
.entry .jws-reading-time { display: none; }

.page-links { margin-top: 2em; font-size: 16px; color: var(--muted); }

.post-foot { max-width: 880px; margin-top: 56px; }
.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.post-nav__item { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); }
.post-nav__item--next { text-align: right; }
.post-nav__label { font-size: 14px; color: var(--muted-2); }
.post-nav__title { font-family: var(--serif); font-size: 18px; line-height: 1.5; }
.post-nav__item:hover .post-nav__title { color: var(--link); }
.related .section__head h2 { font-size: 28px; }

/* ========== 评论 ========== */

.comments { max-width: 760px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--rule); }
.comments__title { margin: 0 0 16px; font-family: var(--serif); font-weight: 700; font-size: 26px; color: #141414; }
.comment-list { list-style: none; margin: 0 0 32px; padding: 0; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--rule-2); }
.comment-meta { font-size: 14px; color: var(--muted-2); }
.comment-author .avatar { border-radius: 50%; vertical-align: middle; margin-right: 8px; }
.comment-content { margin-top: 8px; line-height: 1.8; }
.comment-reply-title { margin: 0 0 8px; font-family: var(--serif); font-size: 22px; }
.comment-notes, .logged-in-as { font-size: 14px; color: var(--muted-2); }
.comment-form p { margin: 0 0 14px; }
.comment-form label { display: block; margin-bottom: 6px; font-size: 15px; color: var(--muted); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #C9C6BE;
  border-radius: 6px;
  background: #FFFDF9;
  color: var(--ink);
  font: inherit;
}
.comment-form textarea { min-height: 140px; }
.comment-form .comment-form-cookies-consent label { display: inline; }

/* ========== 页脚 ========== */

.site-footer {
  margin-top: 48px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 13px;
  color: var(--caption);
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--link); text-decoration: underline; }

/* ========== 平板与手机 ========== */

@media (max-width: 1100px) {
  .row { grid-template-columns: 150px minmax(0, 1fr) 24px; }
  .row__title { font-size: 23px; }
}

@media (max-width: 900px) {
  .site { flex-direction: column; }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
    flex: none;
    overflow: visible;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 18px 20px 0;
  }
  .sidebar__logo { font-size: 28px; }
  .sidebar__rule, .sidebar__motto, .sidebar__spacer, .sidebar__domain { display: none; }

  .sidebar__foot {
    grid-column: 2;
    grid-row: 1;
    max-width: none;
    padding: 0;
    border: 0;
  }
  .sidebar__search { padding-bottom: 4px; gap: 8px; }
  .sidebar__search input { width: 6.5em; font-size: 15px; }

  .sidebar__nav {
    grid-column: 1 / -1;
    flex-direction: row;
    gap: 0;
    margin: 10px -20px 0;
    padding: 0 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .sidebar__nav::-webkit-scrollbar { display: none; }
  .sidebar__nav a {
    flex: none;
    min-height: 48px;
    padding: 0 12px;
    border-left: 0;
    border-bottom: 3px solid transparent;
    font-size: 18px;
  }
  .sidebar__nav a.is-current { border-bottom-color: var(--gold); }

  .main { padding: 28px 20px 48px; }

  .page-title { font-size: clamp(28px, 8.6vw, 44px); }
  .post-title { font-size: clamp(24px, 6.6vw, 34px); }
  .lede { font-size: 18px; }
  .eyebrow { font-size: 14px; letter-spacing: 1.5px; }
  .hero img { aspect-ratio: 16 / 9; }
  .section__head h2 { font-size: 28px; }

  .row {
    grid-template-columns: minmax(0, 1fr) 20px;
    row-gap: 6px;
    padding: 16px 0;
  }
  .row__date { grid-column: 1 / -1; font-size: 14px; }
  .row__body { padding-right: 12px; }
  .row__title { font-size: 19px; line-height: 1.45; }
  .row__meta { font-size: 14px; }
  .row__arrow { width: 20px; height: 20px; }

  .tabs {
    column-gap: 22px;
    margin-top: 28px;
    margin-right: -20px;
    padding-right: 20px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; font-size: 20px; min-height: 48px; }

  .entry { font-size: 17px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav__item--next { text-align: left; }
}
