/* ============================================================
   留花里手作 — 设计系统
   暖白纸感 + 叶绿点缀，衬线标题 / 无衬线正文
   ============================================================ */

:root {
  --bg:            #faf7f1;
  --bg-elev:       #ffffff;
  --bg-soft:       #f3ede2;
  --ink:           #1e241f;
  --ink-2:         #4c564f;
  --ink-3:         #8a938c;
  --line:          #e5dccc;
  --line-strong:   #d3c7b2;
  --accent:        #3d6a4d;
  --accent-soft:   #e8f0e9;
  --warm:          #b96a35;
  --warm-soft:     #fbeee2;

  --serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --sans:  "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --measure: 680px;
  --wide: 1080px;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(40, 34, 24, .05), 0 4px 12px -6px rgba(40, 34, 24, .10);
  --shadow-lg: 0 2px 4px rgba(40, 34, 24, .04), 0 18px 40px -18px rgba(40, 34, 24, .18);
}

html[data-theme="dark"] {
  --bg:            #14181a;
  --bg-elev:       #1b2124;
  --bg-soft:       #202728;
  --ink:           #e8ebe6;
  --ink-2:         #b3bcb5;
  --ink-3:         #7d8880;
  --line:          #2b3335;
  --line-strong:   #3a4446;
  --accent:        #8fc9a2;
  --accent-soft:   #1f2b25;
  --warm:          #d99a68;
  --warm-soft:     #2b2118;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 20px 50px -20px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 极细纸纹，只用一层，不抢内容 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image:
    radial-gradient(circle at 18% 12%, rgba(185, 106, 53, .05), transparent 42%),
    radial-gradient(circle at 84% 78%, rgba(61, 106, 77, .05), transparent 46%);
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: inherit;
  text-decoration: none;
  transition: color .18s ease;
}

a:hover { color: var(--accent); }

::selection { background: var(--accent-soft); color: var(--accent); }

/* ---------- 布局容器 ---------- */
.wrap {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

.narrow {
  max-width: var(--measure);
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .04em;
}

.brand .leaf {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--accent);
}

.brand .en {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  padding-left: 2px;
  border-left: 1px solid var(--line-strong);
  margin-left: 4px;
  padding-left: 10px;
  line-height: 1.2;
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 14.5px;
  color: var(--ink-2);
}

.nav a { position: relative; padding: 4px 0; }

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width .25s ease;
}

.nav a:hover::after,
.nav a[aria-current="page"]::after { width: 100%; }
.nav a[aria-current="page"] { color: var(--ink); }

.theme-toggle {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .2s ease;
  padding: 0;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  transform: rotate(-12deg);
}

.theme-toggle svg { width: 16px; height: 16px; }
html[data-theme="dark"] .icon-sun { display: none; }
html:not([data-theme="dark"]) .icon-moon { display: none; }

/* ---------- 首页英雄区 ---------- */
.hero {
  padding: 84px 0 58px;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: 20px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(185, 106, 53, .10), transparent 68%);
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 22px;
}

.eyebrow .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--warm);
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(38px, 6.2vw, 62px);
  line-height: 1.16;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0 0 20px;
  max-width: 15em;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
  position: relative;
  white-space: nowrap;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: .08em;
  height: .28em;
  background: var(--accent-soft);
  z-index: -1;
  border-radius: 2px;
}

.hero p.lede {
  font-size: 17px;
  color: var(--ink-2);
  max-width: 34em;
  margin: 0 0 34px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 100px;
  font-size: 14.5px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all .2s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink-2);
}

.btn-ghost:hover {
  border-color: var(--ink-2);
  color: var(--ink);
}

.btn svg { width: 15px; height: 15px; }

/* ---------- 区块标题 ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.section-head h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  letter-spacing: .02em;
}

.section-head .more {
  font-size: 13.5px;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.section-head .more:hover { color: var(--accent); }

/* ---------- 文章列表 ---------- */
.post-list { list-style: none; margin: 0; padding: 0; }

.post-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 28px;
  padding: 26px 4px;
  border-bottom: 1px solid var(--line);
  align-items: start;
  transition: background .2s ease;
}

.post-item:hover { background: color-mix(in srgb, var(--bg-elev) 60%, transparent); }

.post-item .date {
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  padding-top: 6px;
  letter-spacing: .02em;
}

.post-item .date .y {
  display: block;
  font-size: 10.5px;
  letter-spacing: .1em;
  opacity: .7;
}

.post-item h3 {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.45;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: .01em;
}

.post-item:hover h3 { color: var(--accent); }

.post-item .summary {
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.75;
  margin: 0 0 12px;
  max-width: 46em;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-3);
}

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 100px;
  background: var(--bg-soft);
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.7;
  border: 1px solid transparent;
  transition: all .18s ease;
}

a.tag:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}

.meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
  display: inline-block;
}

/* ---------- 精选（首页大卡） ---------- */
.featured {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 26px 0 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .3s ease, transform .3s ease;
}

.featured:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.featured .body {
  padding: 40px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured .kicker {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--warm);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.featured .kicker::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--warm);
}

.featured h2 {
  font-family: var(--serif);
  font-size: 29px;
  line-height: 1.35;
  font-weight: 600;
  margin: 0 0 14px;
  letter-spacing: .01em;
}

.featured p {
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.8;
  margin: 0 0 20px;
}

.featured .media {
  position: relative;
  min-height: 280px;
  background: var(--bg-soft);
  overflow: hidden;
}

.featured .media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}

.featured:hover .media img { transform: scale(1.04); }

/* ---------- 文章页 ---------- */
.post-header {
  padding: 64px 0 30px;
  text-align: center;
}

.post-header .tags {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.post-header h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 4.4vw, 40px);
  line-height: 1.34;
  font-weight: 600;
  letter-spacing: -.005em;
  margin: 0 auto 18px;
  max-width: 20em;
}

.post-header .sub {
  font-size: 13.5px;
  color: var(--ink-3);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.post-cover {
  margin: 18px auto 0;
  max-width: 860px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.post-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article {
  padding: 46px 0 20px;
  font-size: 17px;
  line-height: 1.95;
  color: var(--ink);
}

.article > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }

.article p { margin: 0 auto 1.5em; }

.article h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.5;
  margin: 2.2em auto .75em;
  letter-spacing: .01em;
  scroll-margin-top: 90px;
}

.article h3 {
  font-family: var(--serif);
  font-size: 19.5px;
  font-weight: 600;
  margin: 1.9em auto .6em;
  scroll-margin-top: 90px;
}

.article blockquote {
  margin: 1.9em auto;
  padding: 4px 0 4px 22px;
  border-left: 2px solid var(--accent);
  color: var(--ink-2);
  font-size: 16.5px;
  font-style: normal;
  background: linear-gradient(90deg, var(--accent-soft), transparent 70%);
  border-radius: 0 6px 6px 0;
}

.article blockquote p:last-child { margin-bottom: 0; }

.article ul, .article ol {
  margin: 0 auto 1.5em;
  padding-left: 1.4em;
}

.article li { margin-bottom: .55em; }

.article li::marker { color: var(--accent); }

.article strong { font-weight: 600; color: var(--ink); }

.article em { font-style: italic; }

.article code {
  font-family: var(--mono);
  font-size: .875em;
  background: var(--bg-soft);
  padding: .15em .42em;
  border-radius: 5px;
  border: 1px solid var(--line);
}

.article pre {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
  margin: 1.9em auto;
}

.article pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

.article img {
  border-radius: 12px;
  border: 1px solid var(--line);
  margin: 2em auto;
  max-width: min(100%, 860px);
}

.article hr {
  border: none;
  text-align: center;
  margin: 2.6em auto;
  max-width: var(--measure);
  color: var(--ink-3);
}

.article hr::after {
  content: "· · ·";
  letter-spacing: .6em;
  font-size: 14px;
}

.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.9em auto;
  font-size: 14.5px;
}

.article th {
  text-align: left;
  font-weight: 600;
  padding: 9px 12px;
  border-bottom: 1.5px solid var(--line-strong);
  color: var(--ink);
  white-space: nowrap;
}

.article td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}

.article a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.article a:hover { border-bottom-color: var(--accent); }

/* 文章尾部 */
.post-footer {
  max-width: var(--measure);
  margin: 10px auto 0;
  padding: 28px 0 0;
  border-top: 1px solid var(--line);
}

.post-footer .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--ink-3);
}

.post-footer .tags { display: flex; gap: 7px; flex-wrap: wrap; }

.prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  max-width: var(--measure);
  margin: 40px auto 0;
}

.prevnext a {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elev);
  transition: all .2s ease;
  display: block;
}

.prevnext a:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.prevnext .dir {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: block;
  margin-bottom: 7px;
}

.prevnext .ttl {
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.5;
  display: block;
}

.prevnext .empty { opacity: .35; pointer-events: none; }

/* ---------- 归档 / 标签页 ---------- */
.page-head {
  padding: 64px 0 34px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.page-head h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 4.6vw, 42px);
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: -.01em;
}

.page-head p {
  color: var(--ink-2);
  font-size: 15.5px;
  margin: 0;
  max-width: 40em;
}

.year-group { margin-top: 38px; }

.year-group h2 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--ink-3);
  margin: 0 0 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.archive-row {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 18px;
  align-items: baseline;
  padding: 14px 2px;
  border-bottom: 1px dashed var(--line);
  transition: all .18s ease;
}

.archive-row:hover { padding-left: 8px; background: color-mix(in srgb, var(--bg-elev) 55%, transparent); }

.archive-row .d {
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.archive-row .t {
  font-family: var(--serif);
  font-size: 16.5px;
  font-weight: 500;
}

.archive-row:hover .t { color: var(--accent); }

.archive-row .g {
  font-size: 11.5px;
  color: var(--ink-3);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.tag-cloud a {
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 13.5px;
  color: var(--ink-2);
  background: var(--bg-elev);
  transition: all .2s ease;
}

.tag-cloud a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.tag-cloud .count {
  color: var(--ink-3);
  font-size: 11.5px;
  margin-left: 5px;
}

/* ---------- 关于页 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 56px;
  padding: 24px 0 70px;
  align-items: start;
}

.about-aside {
  position: sticky;
  top: 100px;
}

.avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--bg-soft), var(--accent-soft));
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  margin-bottom: 20px;
  font-family: var(--serif);
  font-size: 40px;
  color: var(--accent);
}

.about-aside .name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
}

.about-aside .bio {
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.7;
}

.about-body h2 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  margin: 2em 0 .7em;
}

.about-body h2:first-child { margin-top: 0; }

.about-body p {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.95;
  margin: 0 0 1.3em;
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 80px;
  border-top: 1px solid var(--line);
  padding: 34px 0 44px;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-3);
}

.site-footer .fnav { display: flex; gap: 20px; }
.site-footer a:hover { color: var(--accent); }

/* ---------- 动效 ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rise { animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; }
.d1 { animation-delay: .06s; }
.d2 { animation-delay: .12s; }
.d3 { animation-delay: .19s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .wrap { padding: 0 20px; }
  .featured { grid-template-columns: 1fr; }
  .featured .media { min-height: 200px; order: -1; }
  .featured .body { padding: 28px 24px; }
  .featured h2 { font-size: 24px; }
  .about-grid { grid-template-columns: 1fr; gap: 30px; }
  .about-aside { position: static; display: flex; align-items: center; gap: 18px; }
  .avatar { width: 84px; height: 84px; font-size: 28px; margin-bottom: 0; }
}

@media (max-width: 620px) {
  .site-header .wrap { height: 58px; }
  .brand { font-size: 16px; }
  .brand .en { display: none; }
  .nav { gap: 18px; font-size: 13.5px; }
  .hero { padding: 54px 0 40px; }
  .hero p.lede { font-size: 15.5px; }
  .post-item { grid-template-columns: 1fr; gap: 8px; padding: 22px 2px; }
  .post-item .date { padding-top: 0; display: flex; gap: 8px; align-items: baseline; }
  .post-item .date .y { display: inline; }
  .post-item h3 { font-size: 18.5px; }
  .article { font-size: 16px; line-height: 1.9; padding-top: 30px; }
  .article h2 { font-size: 21px; }
  .post-header { padding: 44px 0 22px; }
  .prevnext { grid-template-columns: 1fr; }
  .archive-row { grid-template-columns: 62px 1fr; }
  .archive-row .g { display: none; }
}
