/* ==========================================================================
   花信 · 养花手记 — Flora Letter
   静态杂志风博客样式（自包含，无外部依赖）
   ========================================================================== */

:root {
  --paper: #f7f3ea;
  --card: #fffdf6;
  --ink: #22332b;
  --ink-soft: #5d6c61;
  --line: #ded6c4;
  --line-faint: #e8e1d2;
  --accent: #c4633d;
  --accent-deep: #a34b26;
  --green: #2f5d46;
  --green-deep: #1c3a2b;
  --gold: #b98a3c;
  --font-display: Georgia, "Times New Roman", "Songti SC", "STSong", "Noto Serif SC", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --radius: 10px;
  --shadow: 0 18px 40px -18px rgba(34, 51, 43, 0.25);
  --maxw: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* 纸张颗粒质感 */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 999;
  opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='table' tableValues='0 0.04'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- 通用小元素 ---------- */
.kicker {
  font-size: 12px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.kicker--green { color: var(--green); }

.serif { font-family: var(--font-display); }

.hairline { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: .12em;
  border: 1px solid var(--ink);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--accent-deep); border-color: var(--accent-deep); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }

/* ---------- 顶栏 ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 243, 234, .86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-faint);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--maxw); margin: 0 auto;
}
.logo { display: flex; align-items: baseline; gap: 10px; }
.logo-name {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700; letter-spacing: .08em;
}
.logo-name em { color: var(--accent); font-style: normal; }
.logo-en { font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: var(--ink-soft); }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a {
  font-size: 14px; letter-spacing: .06em; color: var(--ink-soft);
  padding: 6px 2px; border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.nav-links a:hover, .nav-links a.on { color: var(--ink); border-color: var(--accent); }
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; font-size: 16px; cursor: pointer; color: var(--ink);
}

/* ---------- 首页 Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: 56px; align-items: center;
  padding: 72px 0 64px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.2vw, 68px);
  line-height: 1.18;
  margin: 18px 0 22px;
}
.hero-title em { font-style: italic; color: var(--accent); }
.hero-sub { color: var(--ink-soft); max-width: 44ch; margin-bottom: 30px; }
.hero-figure { position: relative; }
.hero-figure img {
  width: 100%; aspect-ratio: 4/5; object-fit: cover;
  border-radius: var(--radius);
  filter: saturate(1.06) contrast(1.04);
}
.hero-figure::before {
  content: "";
  position: absolute; inset: 18px -18px -18px 18px;
  border: 1px solid var(--accent); border-radius: var(--radius);
  z-index: -1;
}
.hero-figure figcaption {
  position: absolute; left: 14px; bottom: 14px;
  background: rgba(34, 51, 43, .78); color: #f2ecdd;
  font-size: 12px; letter-spacing: .12em;
  padding: 6px 12px; border-radius: 6px;
}
.hero-meta { display: flex; gap: 28px; margin-top: 34px; }
.hero-meta div { border-left: 1px solid var(--line); padding-left: 14px; }
.hero-meta strong { display: block; font-family: var(--font-display); font-size: 26px; }
.hero-meta span { font-size: 12px; color: var(--ink-soft); letter-spacing: .1em; }

/* ---------- 滚动提示条 ---------- */
.ticker {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--card);
  overflow: hidden;
}
.ticker-track {
  display: inline-flex; gap: 64px; white-space: nowrap;
  padding: 10px 0; min-width: 200%;
  animation: tick 36s linear infinite;
  font-size: 13px; color: var(--ink-soft); letter-spacing: .14em;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span::before { content: "❋ "; color: var(--accent); }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- 区块标题 ---------- */
.section { padding: 56px 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 30px; gap: 20px;
}
.section-title { font-family: var(--font-display); font-size: clamp(26px, 3vw, 36px); }
.section-more { font-size: 13px; letter-spacing: .14em; color: var(--accent); white-space: nowrap; }
.section-more:hover { color: var(--accent-deep); }

/* ---------- 文章卡片 ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.card {
  background: var(--card);
  border: 1px solid var(--line-faint);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.card-img { overflow: hidden; aspect-ratio: 4/3; }
.card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease; filter: saturate(1.04);
}
.card:hover .card-img img { transform: scale(1.05); }
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-cat { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--green); }
.card-title { font-family: var(--font-display); font-size: 20px; line-height: 1.4; }
.card:hover .card-title { color: var(--accent-deep); }
.card-excerpt { font-size: 14px; color: var(--ink-soft); }
.card-foot { margin-top: auto; font-size: 12px; color: var(--ink-soft); letter-spacing: .08em; }

/* ---------- 分类大图条 ---------- */
.cat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.cat-tile {
  position: relative; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 3/4; isolation: isolate;
}
.cat-tile img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease; filter: saturate(1.02) brightness(.94);
}
.cat-tile:hover img { transform: scale(1.06); }
.cat-tile-text {
  position: absolute; inset: auto 0 0 0; z-index: 2;
  padding: 18px 20px; color: #f4efe3;
  background: linear-gradient(to top, rgba(28, 42, 33, .88), rgba(28, 42, 33, 0));
}
.cat-tile-text .num { font-family: var(--font-display); font-size: 13px; letter-spacing: .3em; color: #e6b491; }
.cat-tile-text h3 { font-family: var(--font-display); font-size: 24px; margin: 4px 0 6px; }
.cat-tile-text p { font-size: 13px; color: rgba(244, 239, 227, .82); }

/* ---------- 语录 ---------- */
.quote-band {
  background: var(--green-deep); color: #e9e2d2;
  padding: 64px 0; text-align: center;
}
.quote-band blockquote {
  font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 32px);
  max-width: 780px; margin: 0 auto; line-height: 1.6; font-style: italic;
}
.quote-band cite { display: block; margin-top: 18px; font-style: normal; font-size: 13px; letter-spacing: .26em; color: #9db8a4; }

/* ---------- 列表页 ---------- */
.page-hero { padding: 64px 0 40px; }
.page-title { font-family: var(--font-display); font-size: clamp(34px, 4.4vw, 54px); margin: 12px 0 14px; }
.page-lede { color: var(--ink-soft); max-width: 60ch; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; padding: 26px 0 6px; }
.filter-btn {
  border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 8px 18px;
  font-size: 13px; letter-spacing: .1em; cursor: pointer; color: var(--ink-soft);
  transition: all .2s ease; font-family: var(--font-body);
}
.filter-btn:hover { border-color: var(--ink); color: var(--ink); }
.filter-btn.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; padding: 30px 0 70px; }

/* 分类页头图 */
.page-hero-figure { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/6.5; margin-bottom: 10px; }
.page-hero-figure img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.9) saturate(1.05); }

/* ---------- 文章页 ---------- */
.article-wrap { max-width: 780px; margin: 0 auto; padding: 0 24px; }
.article-head { padding: 56px 0 26px; }
.article-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.2vw, 46px); line-height: 1.3;
  margin: 12px 0 16px;
}
.article-meta { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: var(--ink-soft); letter-spacing: .08em; align-items: center; }
.article-meta .tag-chip {
  border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 12px; font-size: 12px; letter-spacing: .16em; color: var(--green);
}
.article-hero { margin: 10px 0 34px; }
.article-hero img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--radius); filter: saturate(1.06); }
.article-hero figcaption { font-size: 12.5px; color: var(--ink-soft); margin-top: 8px; letter-spacing: .06em; }

.article-body { font-size: 16.5px; padding-bottom: 30px; }
.article-body > p { margin: 0 0 1.15em; }
.article-body h2 {
  font-family: var(--font-display); font-size: 24px;
  margin: 1.5em 0 .7em; padding-left: 14px;
  border-left: 3px solid var(--accent); line-height: 1.4;
}
.article-body h3 { font-size: 17px; margin: 1.3em 0 .55em; color: var(--green-deep); }
.article-body ul, .article-body ol { margin: 0 0 1.15em 1.4em; }
.article-body li { margin: .3em 0; }
.article-body strong { color: var(--green-deep); }
.article-body a.link { color: var(--accent-deep); border-bottom: 1px solid rgba(163, 75, 38, .4); }
.article-body a.link:hover { color: var(--accent); }

.tip {
  background: #f1ede0; border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px; margin: 1.2em 0; font-size: 15px;
}
.tip b { color: var(--gold); letter-spacing: .14em; font-size: 12.5px; text-transform: uppercase; }

blockquote.pull {
  font-family: var(--font-display); font-style: italic;
  font-size: 20px; color: var(--green-deep);
  border: 0; margin: 1.4em 0; padding: 4px 0 4px 22px;
  border-left: 1px solid var(--line);
}

figure.inline { margin: 1.5em 0; }
figure.inline img { width: 100%; border-radius: var(--radius); aspect-ratio: 3/2; object-fit: cover; }
figure.inline figcaption { font-size: 12.5px; color: var(--ink-soft); margin-top: 8px; }

table.simple { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 14.5px; }
table.simple th, table.simple td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; }
table.simple th { font-family: var(--font-display); color: var(--green-deep); border-bottom: 2px solid var(--green-deep); }
table.simple tr:nth-child(even) td { background: rgba(222, 214, 196, .18); }

.article-end { border-top: 1px solid var(--line); padding: 26px 0 8px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.article-end .label { font-size: 12px; letter-spacing: .22em; color: var(--ink-soft); text-transform: uppercase; margin-right: 4px; }

.related { background: var(--card); border-top: 1px solid var(--line-faint); }
.related .section-head { margin-bottom: 22px; }

/* ---------- 页脚 ---------- */
.site-foot {
  background: #1c2721; color: #b9c6ba;
  margin-top: 0; padding: 54px 0 30px;
}
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px; }
.foot-brand .logo-name { color: #f0e9d9; }
.foot-brand p { font-size: 13.5px; margin-top: 12px; max-width: 34ch; color: #8fa093; }
.site-foot h4 { font-family: var(--font-display); color: #e5ddc9; font-size: 16px; margin-bottom: 14px; letter-spacing: .06em; }
.site-foot ul { list-style: none; }
.site-foot ul li { margin: 8px 0; }
.site-foot ul a { font-size: 13.5px; color: #9db0a1; transition: color .2s ease; }
.site-foot ul a:hover { color: #e6b491; }
.foot-base {
  border-top: 1px solid rgba(185, 198, 186, .18);
  margin-top: 40px; padding-top: 18px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: #7d8f82; letter-spacing: .08em;
}

/* ---------- 入场动画 ---------- */
html.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
html.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding: 48px 0 40px; }
  .hero-figure { order: -1; }
  .grid-3, .post-grid, .cat-strip { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 10px 24px 18px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 0; border-bottom: 1px solid var(--line-faint); }
  .nav-toggle { display: block; }
  .grid-3, .post-grid, .cat-strip { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .hero-meta { flex-wrap: wrap; }
  .section { padding: 40px 0; }
}
