:root {
  --bg: #fbf9f6;
  --bg-soft: #f3efe9;
  --surface: #ffffff;
  --text: #1f1b17;
  --text-soft: #6b6259;
  --text-faint: #9a9088;
  --border: #e7e0d7;
  --accent: #c2593c;
  --accent-soft: #f3e3dc;
  --link: #9c3f28;
  --shadow: 0 10px 30px -12px rgba(60, 45, 35, 0.18);
  --radius: 16px;
  --maxw: 1080px;
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --bg: #16130f;
  --bg-soft: #1e1a15;
  --surface: #211d18;
  --text: #f1ece5;
  --text-soft: #b3a99e;
  --text-faint: #7d746a;
  --border: #322c25;
  --accent: #e08a6e;
  --accent-soft: #3a2a22;
  --link: #e8a08a;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

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

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

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-serif); font-weight: 700; font-size: 20px; color: var(--text); }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--text-soft); font-size: 15px; }
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }
.theme-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 16px;
  display: grid; place-items: center; transition: transform .2s ease;
}
.theme-btn:hover { transform: rotate(20deg); }

/* ---------- Hero ---------- */
.hero { padding: 84px 0 64px; }
.hero-inner { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-family: var(--font-serif); font-size: 48px; line-height: 1.2; margin: 18px 0 20px; }
.hero .lead { font-size: 18px; color: var(--text-soft); max-width: 520px; }
.hero .tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.tag { font-size: 13px; padding: 6px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.hero-actions { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: 999px;
  font-size: 15px; font-weight: 600; cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); text-decoration: none; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg-soft); text-decoration: none; }

.avatar-card { text-align: center; }
.avatar {
  width: 200px; height: 200px; border-radius: 50%; margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--accent), #e0a06e);
  display: grid; place-items: center; font-family: var(--font-serif);
  font-size: 64px; color: #fff; box-shadow: var(--shadow);
}
.avatar-card .name { font-family: var(--font-serif); font-size: 22px; }
.avatar-card .role { color: var(--text-soft); font-size: 14px; }

/* ---------- Section ---------- */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 32px; }
.section-head h2 { font-family: var(--font-serif); font-size: 30px; margin: 0; }
.section-head a { font-size: 14px; color: var(--text-soft); }

/* ---------- Post cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.post-thumb { height: 160px; background: var(--bg-soft); position: relative; overflow: hidden; }
.post-thumb .emoji { position: absolute; inset: 0; display: grid; place-items: center; font-size: 56px; }
.post-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.post-meta { font-size: 12px; color: var(--text-faint); display: flex; gap: 12px; margin-bottom: 10px; }
.post-card h3 { font-family: var(--font-serif); font-size: 19px; margin: 0 0 10px; line-height: 1.4; }
.post-card p { color: var(--text-soft); font-size: 14.5px; margin: 0 0 16px; flex: 1; }
.post-card .read { font-size: 13px; color: var(--accent); font-weight: 600; }

/* ---------- Feature split ---------- */
.feature { background: var(--bg-soft); border-radius: 24px; padding: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.feature h2 { font-family: var(--font-serif); font-size: 30px; margin: 0 0 16px; }
.feature p { color: var(--text-soft); }
.feature ul { list-style: none; padding: 0; margin: 18px 0 0; }
.feature li { padding-left: 26px; position: relative; margin-bottom: 10px; color: var(--text-soft); }
.feature li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* ---------- Newsletter ---------- */
.newsletter { text-align: center; padding: 64px 0; }
.newsletter h2 { font-family: var(--font-serif); font-size: 30px; margin: 0 0 12px; }
.newsletter p { color: var(--text-soft); margin: 0 0 26px; }
.sub-form { display: flex; gap: 10px; max-width: 440px; margin: 0 auto; }
.sub-form input { flex: 1; padding: 13px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 15px; }
.sub-form input:focus { outline: 2px solid var(--accent); }

/* ---------- Post page ---------- */
.article { max-width: 720px; margin: 0 auto; padding: 56px 24px 80px; }
.article .post-meta { font-size: 14px; margin-bottom: 16px; }
.article h1 { font-family: var(--font-serif); font-size: 40px; line-height: 1.25; margin: 0 0 24px; }
.article p { font-size: 17px; color: var(--text); margin: 0 0 22px; }
.article h2 { font-family: var(--font-serif); font-size: 26px; margin: 40px 0 16px; }
.article blockquote { margin: 28px 0; padding: 16px 24px; border-left: 4px solid var(--accent); background: var(--bg-soft); border-radius: 0 12px 12px 0; color: var(--text-soft); font-style: italic; }
.article pre { background: var(--bg-soft); padding: 18px 20px; border-radius: 12px; overflow: auto; font-size: 14px; }
.article code { font-family: "SFMono-Regular", Consolas, monospace; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; align-items: start; }
.about-side { position: sticky; top: 92px; }
.about-side .avatar { width: 160px; height: 160px; font-size: 52px; }
.about-side .stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 26px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; text-align: center; }
.stat b { font-family: var(--font-serif); font-size: 26px; display: block; color: var(--accent); }
.stat span { font-size: 13px; color: var(--text-soft); }
.about-body h2 { font-family: var(--font-serif); font-size: 28px; margin-top: 0; }
.about-body p { color: var(--text-soft); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 48px 0 30px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 36px; }
.footer-grid h4 { font-size: 15px; margin: 0 0 14px; }
.footer-grid a { display: block; color: var(--text-soft); font-size: 14px; margin-bottom: 8px; }
.footer-grid a:hover { color: var(--text); }
.footer-about p { color: var(--text-soft); font-size: 14px; max-width: 320px; }
.copyright { border-top: 1px solid var(--border); padding-top: 22px; text-align: center; color: var(--text-faint); font-size: 13px; line-height: 2; }
.copyright a { color: var(--text-faint); }
.copyright .beian { display: inline-flex; gap: 6px; align-items: center; }
.copyright .beian:hover { color: var(--text-soft); }

.menu-toggle { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-inner, .feature, .about-grid { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .hero h1 { font-size: 38px; }
}
@media (max-width: 560px) {
  .post-grid, .footer-grid { grid-template-columns: 1fr; }
  .sub-form { flex-direction: column; }
  .feature { padding: 30px; }
}
