/* ============================================================
   林间小筑 · 个人博客样式表
   设计：柔和暖米白 + 鼠尾草绿主色 + 陶土色点缀
   结构：变量 / 基础 / 导航 / 简介 / 文章 / 侧栏 / 页脚 / 响应式
   ============================================================ */

:root {
  --bg:            #f6f4ef;
  --surface:       #ffffff;
  --surface-soft:  #fbfaf7;
  --ink:           #3c4742;
  --ink-strong:    #26302b;
  --muted:         #7d8883;
  --line:          #e9e5dc;
  --primary:       #6f9183;
  --primary-dark:  #557567;
  --primary-soft:  #e9f1eb;
  --accent:        #d9a486;
  --accent-dark:   #b57e5f;
  --accent-soft:   #faf1ea;
  --radius:        16px;
  --radius-sm:     10px;
  --shadow:        0 8px 28px rgba(52, 64, 58, .055);
  --shadow-hover:  0 14px 36px rgba(52, 64, 58, .10);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: Georgia, "Songti SC", "STSong", "Noto Serif SC", serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; color: var(--ink-strong); }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .9em;
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 2px 6px;
  border-radius: 5px;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary-dark);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------------- 顶部导航 ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 244, 239, .9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--primary) 0%, #8aab9c 100%);
  color: #fff;
  font-family: var(--serif);
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(111, 145, 131, .28);
}

.brand-text {
  display: flex;
  flex-direction: column;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink-strong);
  letter-spacing: .5px;
}
.brand-sub {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
}

.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a {
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  transition: color .2s ease, background-color .2s ease;
}
.site-nav a:hover { color: var(--primary-dark); background: var(--primary-soft); }
.site-nav a.is-active { color: var(--primary-dark); background: var(--primary-soft); font-weight: 600; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------------- 个人简介 ---------------- */
.hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 30px;
  align-items: center;
  margin-top: 34px;
  padding: 38px 40px;
  background: linear-gradient(125deg, #ffffff 0%, var(--surface-soft) 62%, #f3f7f2 100%);
}

.hero-avatar {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: linear-gradient(145deg, #7fa393 0%, #b6cbbd 55%, var(--accent) 100%);
  color: #fff;
  font-family: var(--serif);
  font-size: 46px;
  border: 4px solid #fff;
  box-shadow: 0 10px 26px rgba(111, 145, 131, .22);
}

.eyebrow {
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--accent-dark);
  font-weight: 600;
}

.hero h1 {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.4;
  letter-spacing: .5px;
}

.hero-desc {
  margin-top: 12px;
  max-width: 660px;
  color: #5c665f;
  line-height: 1.9;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--muted);
}
.hero-meta span { position: relative; padding-left: 13px; }
.hero-meta span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.hero-links a {
  padding: 7px 16px;
  font-size: 13px;
  color: var(--primary-dark);
  border: 1px solid #cddfd4;
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  transition: background-color .2s ease, transform .2s ease;
}
.hero-links a:hover { background: var(--primary-soft); transform: translateY(-1px); }

/* ---------------- 两栏布局 ---------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
  margin-top: 36px;
}

/* Grid 子项显式归零最小宽度，避免长代码 / 长链接撑破栏宽 */
.content, .hero-body { min-width: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 {
  position: relative;
  padding-left: 14px;
  font-family: var(--serif);
  font-size: 22px;
}
.section-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 4px;
  border-radius: 4px;
  background: var(--primary);
}
.section-count {
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 3px 12px;
  border-radius: 999px;
}

/* ---------------- 文章卡片 ---------------- */
.post {
  padding: 30px 32px 22px;
  margin-bottom: 24px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.post:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.post-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.post-top time { font-size: 12.5px; color: var(--muted); }

.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
}
.tag-warm { background: var(--accent-soft); color: var(--accent-dark); }

.post-title {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.45;
  letter-spacing: .3px;
  transition: color .2s ease;
}
.post:hover .post-title { color: var(--primary-dark); }

.post-summary {
  margin-top: 12px;
  color: #5c665f;
  line-height: 1.9;
}

/* 折叠正文 */
.post-full { margin-top: 20px; }
.post-full summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  color: var(--primary-dark);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.post-full summary::-webkit-details-marker { display: none; }
.post-full summary:hover { color: var(--accent-dark); }
.arrow {
  width: 7px;
  height: 7px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .2s ease;
}
.post-full[open] .arrow { transform: rotate(-135deg) translateY(-2px); }

.post-body {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  color: #4b5550;
  line-height: 1.95;
}
.post-body p + p { margin-top: 14px; }
.post-body h4 {
  margin: 26px 0 10px;
  padding-left: 12px;
  border-left: 3px solid var(--primary);
  font-size: 16px;
  font-family: var(--sans);
  line-height: 1.5;
}
.post-body blockquote {
  margin: 22px 0;
  padding: 14px 20px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--accent-dark);
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
}

.post-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------------- 侧边栏 ---------------- */
.widget { padding: 24px 26px; margin-bottom: 22px; }

.widget-title {
  position: relative;
  padding-left: 12px;
  margin-bottom: 14px;
  font-size: 16px;
  font-family: var(--sans);
  font-weight: 700;
}
.widget-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.widget-text { color: #5c665f; line-height: 1.9; font-size: 14px; }

.widget-line {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.widget-line:first-of-type { margin-top: 16px; }
.widget-line strong { color: var(--ink-strong); font-weight: 600; }

.cat-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.cat-list li:last-child { border-bottom: none; }
.cat-list a { color: #5c665f; transition: color .2s ease, padding-left .2s ease; }
.cat-list a:hover { color: var(--primary-dark); padding-left: 4px; }
.count {
  min-width: 24px;
  text-align: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud span {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12.5px;
  transition: background-color .2s ease, color .2s ease;
}
.tag-cloud span:hover { background: var(--primary-soft); color: var(--primary-dark); }

.note-card {
  background: linear-gradient(150deg, var(--accent-soft) 0%, #fff 100%);
  border-color: #f0ded0;
}
.btn {
  display: inline-block;
  margin-top: 16px;
  padding: 9px 20px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  transition: background-color .2s ease, transform .2s ease;
}
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ---------------- 页脚 ---------------- */
.site-footer {
  margin-top: 52px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 88px;
  padding-top: 20px;
  padding-bottom: 20px;
  font-size: 13px;
  color: var(--muted);
}
.footer-inner nav { display: flex; gap: 20px; }
.footer-inner nav a:hover { color: var(--primary-dark); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
  }
  .widget { margin-bottom: 0; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .container { padding: 0 18px; }

  .header-inner { min-height: 64px; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 18px;
    right: 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 10px 14px; border-radius: 8px; }

  .hero {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 22px;
    padding: 28px 24px;
    text-align: center;
  }
  .hero-avatar { width: 84px; height: 84px; font-size: 38px; margin: 0 auto; }
  .hero h1 { font-size: 23px; }
  .hero-desc { text-align: left; }
  .hero-meta, .hero-links { justify-content: center; }
  .hero-links a { padding: 7px 14px; }

  .layout { margin-top: 28px; }
  .sidebar { grid-template-columns: 1fr; }

  .post { padding: 24px 22px 18px; }
  .post-title { font-size: 21px; }
  .post-top time { font-size: 12px; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
