/* ==========================================================================
   林深暮雪 — 博客样式
   纯静态，无外部依赖，可离线自托管
   ========================================================================== */

:root {
  --bg: #fbf9f5;
  --bg-soft: #f4f0e8;
  --card: #ffffff;
  --text: #201d19;
  --text-soft: #55504a;
  --muted: #8b847a;
  --line: #e5dfd3;
  --accent: #b4462f;
  --accent-soft: rgba(180, 70, 47, 0.09);
  --shadow: 0 1px 2px rgba(32, 29, 25, 0.04), 0 12px 32px rgba(32, 29, 25, 0.06);
  --radius: 14px;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  --bg: #14120f;
  --bg-soft: #1c1916;
  --card: #1d1a16;
  --text: #ece6dc;
  --text-soft: #b9b1a5;
  --muted: #8a8378;
  --line: #322d27;
  --accent: #e07155;
  --accent-soft: rgba(224, 113, 85, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after { box-sizing: border-box; }

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

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

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s ease;
}
a:hover { opacity: 0.75; }

.container {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
}

/* ---------- 顶栏 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.brand:hover { opacity: 1; }

.brand .mark {
  width: 26px;
  height: 26px;
  flex: none;
}

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

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav a {
  color: var(--text-soft);
  font-size: 14.5px;
  letter-spacing: 0.03em;
  position: relative;
}

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

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

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--muted);
  transform: rotate(-12deg);
}

.icon-btn svg { width: 17px; height: 17px; }

.nav-toggle { display: none; }

/* ---------- 首页 Hero ---------- */

.hero {
  padding: 96px 0 72px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -160px;
  right: -120px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}

.hero .eyebrow {
  display: inline-block;
  font-size: 12.5px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(38px, 6.2vw, 66px);
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 24px;
  max-width: 16em;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero p.lede {
  font-size: 17.5px;
  color: var(--text-soft);
  max-width: 34em;
  margin: 0 0 36px;
}

.hero .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  color: var(--muted);
  font-size: 13.5px;
  letter-spacing: 0.05em;
}

.hero .meta-row span::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 2px;
}

/* ---------- 区块标题 ---------- */

.section {
  padding: 20px 0 72px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

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

.section-head .count {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.16em;
}

/* ---------- 精选文章 ---------- */

.featured {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 56px;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.featured:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 50px rgba(32, 29, 25, 0.12);
}

.featured .visual {
  position: relative;
  min-height: 300px;
  background:
    radial-gradient(circle at 22% 20%, rgba(180, 70, 47, 0.35), transparent 55%),
    radial-gradient(circle at 78% 82%, rgba(47, 93, 80, 0.35), transparent 58%),
    linear-gradient(140deg, #22201c, #3a332a);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.featured .visual::after {
  content: "林";
  font-family: var(--serif);
  font-size: 108px;
  color: rgba(255, 255, 255, 0.1);
  letter-spacing: 0;
}

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

.tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 11.5px;
  letter-spacing: 0.2em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 18px;
}

.featured h3 {
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.4;
  font-weight: 600;
  margin: 0 0 16px;
}

.featured h3 a { color: var(--text); }

.featured p {
  color: var(--text-soft);
  font-size: 15px;
  margin: 0 0 26px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.06em;
}

.read-more {
  font-size: 14px;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- 文章列表 ---------- */

.post-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.post-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: baseline;
  gap: 24px;
  padding: 28px 6px;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.3s ease, background-color 0.3s ease;
}

.post-item:hover {
  padding-left: 18px;
  background: var(--bg-soft);
}

.post-item .date {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.post-item h3 {
  font-family: var(--serif);
  font-size: 19.5px;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.5;
}

.post-item h3 a { color: var(--text); }

.post-item p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.65;
}

.post-item .arrow {
  color: var(--muted);
  font-size: 18px;
  transition: transform 0.3s ease, color 0.3s ease;
}

.post-item:hover .arrow {
  transform: translateX(5px);
  color: var(--accent);
}

/* ---------- 文章页 ---------- */

.article-header {
  padding: 76px 0 36px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 48px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 30px;
}

.article-header h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.32;
  font-weight: 600;
  margin: 0 0 24px;
  max-width: 22em;
}

.article-body {
  max-width: 720px;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.95;
  color: var(--text);
  padding-bottom: 40px;
}

.article-body > p { margin: 0 0 1.5em; }

.article-body h2 {
  font-size: 23px;
  font-weight: 600;
  margin: 2.2em 0 0.9em;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.article-body h2::before {
  content: "";
  display: block;
  width: 34px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin-bottom: 18px;
}

.article-body h3 {
  font-size: 18.5px;
  font-weight: 600;
  margin: 1.9em 0 0.7em;
}

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

.article-body li { margin-bottom: 0.5em; }

.article-body blockquote {
  margin: 2em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--accent);
  color: var(--text-soft);
  font-style: italic;
}

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

.article-body code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.12em 0.42em;
}

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

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

.article-body hr {
  border: none;
  height: 1px;
  background: var(--line);
  margin: 3em 0;
}

.article-body a {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.article-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 0 80px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
}

.article-footer .share-note {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  color: var(--text);
  background: var(--card);
  transition: border-color 0.25s ease, transform 0.25s ease, background-color 0.25s ease;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  opacity: 1;
}

/* ---------- 关于页 ---------- */

.about-wrap {
  padding: 80px 0 60px;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 64px;
  align-items: start;
}

.about-wrap h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 4.6vw, 48px);
  font-weight: 600;
  margin: 0 0 28px;
  line-height: 1.3;
}

.about-text {
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.95;
  color: var(--text-soft);
}

.about-text p { margin: 0 0 1.4em; }

.about-side {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.about-side h4 {
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 16px;
  font-weight: 600;
}

.about-side ul {
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
  font-size: 14px;
  color: var(--text-soft);
}

.about-side ul li {
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.about-side ul li:last-child { border-bottom: none; }
.about-side ul li span:last-child { color: var(--text); font-family: var(--mono); font-size: 13px; }

/* ---------- 页脚 ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 42px 0 56px;
  margin-top: 40px;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.site-footer a { color: var(--text-soft); }

/* ---------- 入场动画 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.3, 1),
    transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 响应式 ---------- */

@media (max-width: 860px) {
  .container { width: calc(100% - 36px); }

  .nav {
    position: absolute;
    top: 64px;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 8px 18px 18px;
    display: none;
  }

  .nav.open { display: flex; }

  .nav a {
    padding: 12px 0;
    width: 100%;
    border-bottom: 1px solid var(--line);
  }

  .nav a::after { display: none; }

  .nav .icon-btn { margin-top: 14px; }

  .nav-toggle { display: inline-grid; }

  .hero { padding: 64px 0 48px; }

  .featured { grid-template-columns: 1fr; }
  .featured .visual { min-height: 180px; }
  .featured .body { padding: 30px 26px 32px; }

  .post-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 24px 2px;
  }

  .post-item .arrow { display: none; }

  .about-wrap {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 56px 0 40px;
  }

  .article-header { padding: 52px 0 28px; }
  .article-body { font-size: 16px; line-height: 1.9; }
}
