@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;500;700&family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&display=swap');

/* ===== 变量 ===== */
:root {
  --bg: #FAF6EE;
  --green: #8BAE7A;
  --blue: #A8C8D8;
  --orange: #E8A87C;
  --cream: #F5F0E8;
  --text: #3D3530;
  --text-light: #8A7E78;
  --shadow: 0 4px 20px rgba(61,53,48,.10);
  --shadow-hover: 0 12px 40px rgba(61,53,48,.18);
  --r: 14px;
  --ease: cubic-bezier(.25,.46,.45,.94);
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Serif SC', serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.9;
  /* 纸张纹理 */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

a { color: var(--green); text-decoration: none; transition: color .25s; }
a:hover { color: var(--orange); }
img { max-width: 100%; display: block; }

/* ===== 导航 ===== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  background: rgba(250,246,238,.88);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid rgba(139,174,122,.18);
  transition: padding .35s var(--ease);
}
.site-header.scrolled { padding: 0; }
.header-inner {
  max-width: 1140px; margin: 0 auto; padding: 0 32px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  transition: height .35s var(--ease);
}
.site-header.scrolled .header-inner { height: 48px; }

.site-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem; font-style: italic;
  color: var(--text); letter-spacing: .02em;
}
.site-logo:hover { color: var(--green); }

.nav-list {
  list-style: none; display: flex; gap: 36px;
}
.nav-list a {
  font-size: .88rem; color: var(--text);
  letter-spacing: .08em;
  position: relative; padding-bottom: 2px;
}
.nav-list a::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 0; height: 1.5px; background: var(--green);
  transition: width .3s var(--ease);
}
.nav-list a:hover { color: var(--text); }
.nav-list a:hover::after { width: 100%; }

.header-right { display: flex; align-items: center; gap: 14px; }
.user-avatar img {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--green); object-fit: cover;
}
.login-icon { font-size: .95rem; opacity: .7; transition: opacity .2s; }
.login-icon:hover { opacity: 1; }
.nav-toggle {
  display: none; background: none; border: none;
  font-size: 1.3rem; cursor: pointer; color: var(--text);
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  position: relative; overflow: hidden;
  /* 默认冬季，JS/PHP 会覆盖 */
  background: linear-gradient(160deg, #EEF2F7 0%, #E8EDF5 50%, #FAF6EE 100%);
}
.hero-inner {
  position: relative; z-index: 2;
  padding: 0 24px;
}
.hero-tagline {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 300;
  color: var(--text);
  letter-spacing: .15em;
  line-height: 1.8;
  margin-bottom: 28px;
  opacity: .9;
}
.hero-tagline em {
  font-style: normal;
  color: var(--green);
}
.hero-date {
  display: flex; gap: 20px; justify-content: center; align-items: center;
  flex-wrap: wrap;
}
.date-solar {
  font-size: .9rem; color: var(--text-light); letter-spacing: .06em;
}
.date-lunar {
  font-size: .82rem; color: var(--text-light);
  opacity: .65; letter-spacing: .04em;
}
.hero-scroll {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  opacity: .45; animation: bounce 2.4s infinite;
}
.hero-scroll span { font-size: .72rem; letter-spacing: .1em; color: var(--text-light); }
.hero-scroll-arrow {
  width: 20px; height: 20px;
  border-right: 1.5px solid var(--text-light);
  border-bottom: 1.5px solid var(--text-light);
  transform: rotate(45deg);
}
@keyframes bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ===== 主体布局 ===== */
.site-main { padding: 64px 0 100px; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 32px; }
.content-area {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
}

/* ===== 文章卡片瀑布流 ===== */
.posts-masonry {
  columns: 2;
  column-gap: 28px;
}
.post-card {
  break-inside: avoid;
  margin-bottom: 28px;
  background: var(--cream);
  border-radius: var(--r);
  border: 1px solid rgba(139,174,122,.14);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), rotate .35s var(--ease);
}
/* 随机轻微旋转 — 用 nth-child 模拟 */
.post-card:nth-child(3n+1) { rotate: -1.2deg; }
.post-card:nth-child(3n+2) { rotate: 0.8deg; }
.post-card:nth-child(3n+3) { rotate: -0.5deg; }
.post-card:hover {
  rotate: 0deg;
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}
.post-card-thumb img {
  width: 100%; height: 180px; object-fit: cover;
}
.post-card-body { padding: 22px 24px 24px; }
.post-card-meta {
  font-size: .76rem; color: var(--text-light);
  letter-spacing: .05em; margin-bottom: 10px;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.post-card-cat {
  background: rgba(139,174,122,.15);
  color: var(--green);
  padding: 2px 8px; border-radius: 20px;
  font-size: .72rem;
}
.post-card-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.05rem; font-weight: 500;
  line-height: 1.6; margin-bottom: 12px;
}
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--green); }
.post-card-excerpt {
  font-size: .86rem; color: var(--text-light);
  line-height: 1.8;
}
.post-card-mood { font-size: 1.1rem; margin-top: 12px; }

/* ===== 侧边栏 ===== */
.sidebar { position: sticky; top: 80px; }
.widget {
  background: var(--cream);
  border-radius: var(--r);
  border: 1px solid rgba(139,174,122,.14);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 24px;
}
.widget-title {
  font-size: .78rem; font-weight: 500;
  letter-spacing: .12em; color: var(--text-light);
  text-transform: uppercase; margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(139,174,122,.2);
}
.widget ul { list-style: none; }
.widget ul li { padding: 5px 0; font-size: .88rem; border-bottom: 1px solid rgba(0,0,0,.04); }
.widget ul li:last-child { border-bottom: none; }

/* ===== 单篇文章 ===== */
.single-wrap { max-width: 740px; margin: 0 auto; }
.single-header { text-align: center; padding: 80px 0 48px; }
.single-header .post-meta {
  font-size: .82rem; color: var(--text-light);
  margin-bottom: 20px; letter-spacing: .05em;
}
.single-header h1 {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500; line-height: 1.5;
}
.single-thumb { border-radius: var(--r); overflow: hidden; margin-bottom: 48px; }
.single-thumb img { width: 100%; max-height: 480px; object-fit: cover; }
.entry-content {
  font-size: 1.05rem; line-height: 2.1;
}
.entry-content p { margin-bottom: 1.6em; }
.entry-content img { border-radius: 10px; margin: 28px auto; }
.entry-content h2,h3 { margin: 2em 0 .8em; font-weight: 500; }
.entry-content blockquote {
  border-left: 3px solid var(--green);
  padding: 12px 24px; margin: 2em 0;
  background: rgba(139,174,122,.07);
  border-radius: 0 8px 8px 0;
  color: var(--text-light); font-style: italic;
}

/* ===== 归档/分类 ===== */
.archive-header { padding: 100px 0 48px; text-align: center; }
.archive-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem; font-style: italic; color: var(--text);
}

/* ===== 分页 ===== */
.pagination { margin-top: 48px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  font-size: .88rem; color: var(--text);
  border: 1.5px solid rgba(139,174,122,.3);
  transition: all .2s;
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover {
  background: var(--green); color: #fff; border-color: var(--green);
}
.pagination .prev, .pagination .next { width: auto; padding: 0 16px; border-radius: 20px; }

/* ===== 404 ===== */
.error-404 {
  min-height: 80vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 40px 24px;
}
.error-404-text h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem; font-style: italic;
  color: var(--text); margin: 32px 0 12px;
}
.error-404-text p { color: var(--text-light); font-size: .95rem; margin-bottom: 28px; }
.btn-back {
  display: inline-block; padding: 12px 36px;
  background: var(--green); color: #fff;
  border-radius: 28px; font-size: .9rem;
  transition: background .2s, transform .2s;
}
.btn-back:hover { background: var(--orange); color: #fff; transform: translateY(-2px); }

/* ===== CSS 龙猫 ===== */
.totoro {
  position: relative; width: 160px; height: 180px;
  margin: 0 auto;
}
/* 身体 */
.totoro-body {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 120px; height: 140px;
  background: #7A8C7A;
  border-radius: 60px 60px 50px 50px;
}
/* 肚子 */
.totoro-belly {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  width: 70px; height: 90px;
  background: #C8C8A0;
  border-radius: 35px 35px 30px 30px;
}
/* 花纹 */
.totoro-belly::before {
  content: ''; position: absolute;
  top: 20px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 50px;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 6px,
    rgba(100,100,80,.25) 6px, rgba(100,100,80,.25) 7px
  );
  border-radius: 20px;
}
/* 耳朵 */
.totoro-ear-l, .totoro-ear-r {
  position: absolute; top: -28px;
  width: 28px; height: 40px;
  background: #7A8C7A;
  border-radius: 50% 50% 0 0;
}
.totoro-ear-l { left: 14px; transform: rotate(-12deg); }
.totoro-ear-r { right: 14px; transform: rotate(12deg); }
/* 眼睛 */
.totoro-eye-l, .totoro-eye-r {
  position: absolute; top: 28px;
  width: 22px; height: 26px;
  background: #fff;
  border-radius: 50%;
}
.totoro-eye-l { left: 22px; }
.totoro-eye-r { right: 22px; }
.totoro-eye-l::after, .totoro-eye-r::after {
  content: ''; position: absolute;
  top: 6px; left: 5px;
  width: 12px; height: 14px;
  background: #2A2A2A; border-radius: 50%;
}
/* 鼻子 */
.totoro-nose {
  position: absolute; top: 58px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 8px;
  background: #5A6A5A; border-radius: 50%;
}
/* 胡须 */
.totoro-whisker {
  position: absolute; top: 64px;
  height: 1.5px; background: #5A6A5A; border-radius: 2px;
  opacity: .6;
}
.totoro-whisker:nth-child(1) { width: 30px; left: 8px; transform: rotate(-8deg); }
.totoro-whisker:nth-child(2) { width: 28px; left: 8px; top: 70px; transform: rotate(4deg); }
.totoro-whisker:nth-child(3) { width: 30px; right: 8px; transform: rotate(8deg); }
.totoro-whisker:nth-child(4) { width: 28px; right: 8px; top: 70px; transform: rotate(-4deg); }
/* 脚 */
.totoro-foot-l, .totoro-foot-r {
  position: absolute; bottom: -12px;
  width: 36px; height: 22px;
  background: #7A8C7A; border-radius: 0 0 18px 18px;
}
.totoro-foot-l { left: 14px; }
.totoro-foot-r { right: 14px; }

/* ===== 页脚 ===== */
.site-footer {
  background: var(--cream);
  border-top: 1px solid rgba(139,174,122,.15);
  padding: 48px 0 32px;
  text-align: center;
}
.footer-text { font-size: .88rem; color: var(--text-light); margin-bottom: 8px; }
.footer-copy { font-size: .75rem; color: var(--text-light); opacity: .55; }

/* ===== 粒子画布 ===== */
#particles-canvas {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .content-area { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .posts-masonry { columns: 1; }
}
@media (max-width: 768px) {
  .nav-list { display: none; }
  .nav-toggle { display: block; }
  .site-nav.open .nav-list {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(250,246,238,.97);
    padding: 16px 32px 24px;
    border-bottom: 1px solid rgba(139,174,122,.2);
  }
  .site-nav.open .nav-list li { padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,.05); }
  .container { padding: 0 20px; }
  .posts-masonry { columns: 1; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .posts-masonry { columns: 2; }
}
