/* ============================================================
   拾穗集 · 个人随笔博客
   暖米白纸感 / 深酒红点缀 / 宋体杂志排版
   ============================================================ */

:root {
  --paper: #fcf9f2;          /* 米白纸色 */
  --paper-2: #f5f1e7;        /* 深一档米色 */
  --paper-3: #efe9dc;        /* 更深的米色 */
  --ink: #2b241f;            /* 墨色 */
  --ink-soft: #55493f;       /* 柔和墨色 */
  --wine: #5c2018;           /* 深酒红 */
  --wine-bright: #7a2f22;
  --plum: #4d3d4b;           /* 梅子紫（模版3深色区） */
  --plum-deep: #38292f;
  --muted: #8a7f74;          /* 灰褐 */
  --line: #e5ddcd;           /* 分隔线 */
  --gold: #b98a3e;           /* 少量金棕 */

  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --kai: "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", var(--serif);

  --container: 1080px;
  --shadow-soft: 0 2px 16px rgba(43, 36, 31, 0.07);
  --shadow-card: 0 10px 36px rgba(43, 36, 31, 0.12);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  /* 纸张噪点纹理 */
  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%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

::selection { background: var(--wine); color: var(--paper); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--paper-2); }
::-webkit-scrollbar-thumb { background: #c9bfae; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--wine); }

a { color: inherit; text-decoration: none; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 28px; }

/* ============================================================
   顶部导航
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(252, 249, 242, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-soft);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}
.brand .seal {
  width: 30px;
  height: 30px;
  flex: none;
  background: var(--wine);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  border-radius: 4px;
  transform: rotate(-3deg);
  box-shadow: 0 2px 6px rgba(92, 32, 24, 0.35);
}
.nav-links { display: flex; gap: 34px; font-size: 0.95rem; letter-spacing: 0.14em; }
.nav-links a { position: relative; padding: 4px 0; color: var(--ink-soft); transition: color 0.25s; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1.5px;
  background: var(--wine);
  transition: width 0.3s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--wine); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

/* ============================================================
   首屏 Hero
   ============================================================ */
.hero {
  position: relative;
  padding: 96px 0 72px;
  overflow: hidden;
}
/* 背景装饰：淡金圆弧 */
.hero::before {
  content: "";
  position: absolute;
  top: -180px; right: -140px;
  width: 460px; height: 460px;
  border-radius: 50%;
  border: 1px solid rgba(185, 138, 62, 0.28);
}
.hero::after {
  content: "";
  position: absolute;
  top: -110px; right: -70px;
  width: 320px; height: 320px;
  border-radius: 50%;
  border: 1px dashed rgba(92, 32, 24, 0.18);
}
.hero-inner { position: relative; z-index: 1; }
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  letter-spacing: 0.34em;
  color: var(--wine);
  margin-bottom: 22px;
}
.hero-kicker::before { content: ""; width: 34px; height: 1px; background: var(--wine); }
.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.32;
  max-width: 14em;
}
.hero h1 .accent { color: var(--wine); }
.hero-sub {
  margin-top: 20px;
  font-size: 1.02rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  max-width: 32em;
}
/* 竖排装饰 */
.hero-vertical {
  position: absolute;
  right: 6%;
  top: 110px;
  writing-mode: vertical-rl;
  font-family: var(--kai);
  font-size: 0.88rem;
  letter-spacing: 0.5em;
  color: #b3a68f;
  user-select: none;
}
.hero-scroll {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 46px;
  font-size: 0.82rem;
  letter-spacing: 0.28em;
  color: var(--muted);
}
.hero-scroll .line {
  display: inline-block;
  width: 1px; height: 34px;
  background: linear-gradient(var(--wine), transparent);
  animation: drip 2.2s ease-in-out infinite;
}
@keyframes drip {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  50% { transform: scaleY(0.45); opacity: 0.4; }
}

/* ============================================================
   精选文章（首页大卡片）
   ============================================================ */
.featured {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 40px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}
.featured:hover { box-shadow: var(--shadow-card); transform: translateY(-4px); }
.featured-media {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  overflow: hidden;
  background: linear-gradient(135deg, #6d5a52 0%, #4d3d4b 55%, #5c2018 100%);
}
.featured-media .grain { position: absolute; inset: 0; opacity: 0.25; }
.featured-media .label {
  position: absolute;
  left: 16px; bottom: 14px;
  color: rgba(252, 249, 242, 0.9);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
}
.featured-body .tag {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  color: var(--wine);
  border: 1px solid rgba(92, 32, 24, 0.45);
  padding: 3px 12px 3px 15px;
  border-radius: 2px;
  margin-bottom: 16px;
}
.featured-body h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.04em;
}
.featured-body .excerpt { margin-top: 14px; color: var(--ink-soft); font-size: 0.96rem; }
.featured-meta { margin-top: 22px; display: flex; align-items: center; gap: 16px; font-size: 0.82rem; color: var(--muted); letter-spacing: 0.12em; }
.featured-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.featured-body .more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  color: var(--wine);
  font-size: 0.92rem;
  letter-spacing: 0.2em;
}
.featured-body .more .arrow { transition: transform 0.3s ease; }
.featured:hover .more .arrow { transform: translateX(6px); }

/* ============================================================
   文章列表
   ============================================================ */
.posts-section { padding: 72px 0 24px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 36px;
}
.section-head h2 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.24em;
}
.section-head .count { font-size: 0.82rem; color: var(--muted); letter-spacing: 0.14em; }

.post-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 28px;
  padding: 30px 12px;
  border-bottom: 1px solid var(--line);
  transition: background 0.25s ease, padding-left 0.25s ease;
}
.post-item:hover { background: var(--paper-2); padding-left: 22px; }
.post-date {
  font-size: 0.84rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  padding-top: 6px;
}
.post-date .day { display: block; font-size: 1.9rem; color: var(--wine); font-weight: 600; letter-spacing: 0.02em; line-height: 1.1; }
.post-main h3 {
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.5;
  transition: color 0.25s;
}
.post-item:hover .post-main h3 { color: var(--wine); }
.post-main .excerpt {
  margin-top: 8px;
  font-size: 0.94rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-tags { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.post-tags span {
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  background: var(--paper-3);
  padding: 2px 10px;
  border-radius: 2px;
}
.post-item:hover .post-tags span { background: #e9e1cf; }

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
  margin-top: 80px;
  background: var(--plum);
  color: rgba(252, 249, 242, 0.82);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px 28px;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand { font-size: 1rem; letter-spacing: 0.22em; color: var(--paper); }
.footer-links { display: flex; gap: 26px; font-size: 0.86rem; letter-spacing: 0.14em; }
.footer-links a { transition: color 0.25s; }
.footer-links a:hover { color: #d8b36a; }
.footer-note {
  border-top: 1px solid rgba(252, 249, 242, 0.14);
  text-align: center;
  padding: 18px 28px;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: rgba(252, 249, 242, 0.5);
}
.footer-note a { text-decoration: underline; text-underline-offset: 4px; }

/* ============================================================
   文章详情页
   ============================================================ */
.article-hero { padding: 64px 0 28px; text-align: center; }
.article-hero .tag {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.34em;
  color: var(--wine);
  border: 1px solid rgba(92, 32, 24, 0.45);
  padding: 3px 14px 3px 17px;
  border-radius: 2px;
  margin-bottom: 24px;
}
.article-hero h1 {
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.45;
  max-width: 16em;
  margin: 0 auto;
}
.article-meta {
  margin-top: 26px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  font-size: 0.84rem;
  color: var(--muted);
  letter-spacing: 0.16em;
}
.article-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }

.article-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 30px 28px 10px;
  font-size: 1.02rem;
  color: var(--ink);
}
.article-body p {
  text-indent: 2em;
  margin-bottom: 1.5em;
  text-align: justify;
}
.article-body h2 {
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  margin: 2.2em 0 1em;
  padding-left: 14px;
  border-left: 3px solid var(--wine);
}
.article-body blockquote {
  margin: 2em 0;
  padding: 22px 26px;
  background: var(--paper-2);
  border-left: 3px solid var(--gold);
  font-family: var(--kai);
  color: var(--ink-soft);
  border-radius: 0 4px 4px 0;
}
.article-body blockquote p { text-indent: 0; margin: 0; }

/* 文末大图区（呼应模版3深色区块） */
.article-cover {
  margin: 56px auto 0;
  max-width: 1080px;
  padding: 0 28px;
}
.article-cover .cover-img {
  position: relative;
  aspect-ratio: 16 / 7;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(160deg, #5d4455 0%, #4d3d4b 40%, #3a2a30 72%, #5c2018 100%);
  box-shadow: var(--shadow-card);
}
.article-cover .cover-img .grain { position: absolute; inset: 0; opacity: 0.3; }
.article-cover .cover-img .sun {
  position: absolute;
  right: 12%; top: 16%;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #d8b36a, #9c6f3c 62%, transparent 68%);
  opacity: 0.85;
  filter: blur(0.5px);
}
.article-cover figcaption {
  margin-top: 12px;
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--muted);
}

/* 上一篇 / 下一篇 */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 64px;
}
.post-nav a {
  background: var(--paper);
  padding: 26px 30px;
  transition: background 0.25s ease;
}
.post-nav a:hover { background: var(--paper-2); }
.post-nav .dir { display: block; font-size: 0.76rem; letter-spacing: 0.3em; color: var(--muted); margin-bottom: 8px; }
.post-nav .title { font-size: 1rem; letter-spacing: 0.04em; }
.post-nav a.next { text-align: right; }

.back-home {
  display: table;
  margin: 48px auto 0;
  font-size: 0.86rem;
  letter-spacing: 0.24em;
  color: var(--wine);
  border-bottom: 1px solid rgba(92, 32, 24, 0.4);
  padding-bottom: 3px;
  transition: letter-spacing 0.3s ease;
}
.back-home:hover { letter-spacing: 0.34em; }

/* ============================================================
   动效：进入视口渐显
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: var(--d, 0s);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* 页面加载首屏逐项浮现 */
.load-fade {
  animation: fadeUp 0.8s ease both;
  animation-delay: var(--d, 0s);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 860px) {
  .hero { padding: 64px 0 52px; }
  .hero-vertical { display: none; }
  .featured { grid-template-columns: 1fr; gap: 28px; padding: 28px; }
  .post-item { grid-template-columns: 1fr; gap: 10px; padding: 26px 8px; }
  .post-item:hover { padding-left: 16px; }
  .post-date { display: flex; align-items: baseline; gap: 12px; }
  .post-date .day { font-size: 1.2rem; }
  .article-cover .cover-img { aspect-ratio: 4 / 3; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav a.next { text-align: left; }
}
@media (max-width: 560px) {
  .nav-links { gap: 20px; font-size: 0.88rem; }
  .footer-inner { justify-content: center; text-align: center; }
}
