/* ==========================================================================
   捂紧手记 —— 静态博客样式
   零外部依赖：不引任何 CDN、Web Font，断网也能完整渲染。
   ========================================================================== */

:root {
  --bg: #faf8f4;
  --card: #ffffff;
  --fg: #2f3a35;
  --fg-soft: #55605a;
  --muted: #8b8478;
  --muted-2: #a8a196;
  --accent: #9a6b2f;
  --accent-soft: #f3ebdc;
  --line: #e9e3d7;
  --line-soft: #f2ede3;
  --radius: 14px;
  --wrap: 720px;
  --wrap-wide: 880px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-size: 17px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.16s ease;
}

a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; }

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

.wrap-wide { max-width: var(--wrap-wide); }

/* ---------- 顶部 ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: "Songti SC", "Source Han Serif SC", "Noto Serif SC", Georgia, serif;
}

.brand-name {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 15px;
  color: var(--fg-soft);
}

.nav a { position: relative; }

.nav a.is-active { color: var(--fg); font-weight: 600; }

.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- 首屏介绍 ---------- */

.hero {
  padding: 64px 0 44px;
  border-bottom: 1px solid var(--line-soft);
}

.hero-title {
  margin: 0 0 14px;
  font-family: "Songti SC", "Source Han Serif SC", "Noto Serif SC", Georgia, serif;
  font-size: 34px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.hero-desc {
  margin: 0;
  color: var(--fg-soft);
  font-size: 16px;
  max-width: 600px;
}

.hero-meta {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 14px;
  color: var(--muted);
}

.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }

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

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 46px 0 8px;
}

.section-title {
  margin: 0;
  font-family: "Songti SC", "Source Han Serif SC", "Noto Serif SC", Georgia, serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.section-more { font-size: 14px; color: var(--muted); }

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-item {
  padding: 26px 0;
  border-bottom: 1px solid var(--line-soft);
}

.post-item:last-child { border-bottom: none; }

.post-date {
  display: inline-block;
  font-size: 13px;
  color: var(--muted-2);
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

.post-title {
  display: block;
  margin: 6px 0 8px;
  font-family: "Songti SC", "Source Han Serif SC", "Noto Serif SC", Georgia, serif;
  font-size: 23px;
  line-height: 1.5;
  font-weight: 700;
}

.post-item:hover .post-title { color: var(--accent); }

.post-excerpt {
  margin: 0 0 12px;
  color: var(--fg-soft);
  font-size: 15.5px;
  line-height: 1.75;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #7d5620;
  font-size: 12.5px;
  letter-spacing: 0.3px;
}

.tag:hover { background: #ecdfc8; color: #6b4818; }

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

.post-header {
  padding: 56px 0 30px;
  border-bottom: 1px solid var(--line-soft);
}

.post-header h1 {
  margin: 10px 0 16px;
  font-family: "Songti SC", "Source Han Serif SC", "Noto Serif SC", Georgia, serif;
  font-size: 32px;
  line-height: 1.45;
  font-weight: 700;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--muted);
}

.post-meta .sep { color: var(--line); }

.article {
  padding: 34px 0 10px;
}

.article p {
  margin: 0 0 22px;
  color: #33403a;
}

.article h2 {
  margin: 42px 0 18px;
  font-family: "Songti SC", "Source Han Serif SC", "Noto Serif SC", Georgia, serif;
  font-size: 23px;
  line-height: 1.5;
  font-weight: 700;
}

.article h3 {
  margin: 32px 0 14px;
  font-size: 19px;
  font-weight: 700;
}

.article ul, .article ol {
  margin: 0 0 22px;
  padding-left: 22px;
  color: #33403a;
}

.article li { margin-bottom: 8px; }

.article blockquote {
  margin: 26px 0;
  padding: 16px 22px;
  border-left: 3px solid var(--accent);
  background: #fdfbf6;
  border-radius: 0 10px 10px 0;
  color: #5a5449;
}

.article blockquote p { margin: 0; }

.article code {
  padding: 2px 6px;
  background: #f1ece2;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.article pre {
  margin: 0 0 22px;
  padding: 18px 20px;
  background: #2f3a35;
  color: #e8e4d9;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.7;
}

.article pre code { background: none; padding: 0; color: inherit; }

.article hr {
  margin: 40px 0;
  border: none;
  border-top: 1px solid var(--line);
}

.article img { border-radius: 12px; margin: 8px 0 24px; }

.post-footer {
  margin-top: 20px;
  padding: 26px 0 0;
  border-top: 1px solid var(--line-soft);
}

.post-nav {
  display: flex;
  gap: 16px;
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
}

.post-nav-item {
  flex: 1;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.post-nav-item:hover {
  border-color: #d9cfb8;
  transform: translateY(-1px);
}

.post-nav-label {
  display: block;
  font-size: 12.5px;
  color: var(--muted-2);
  margin-bottom: 6px;
}

.post-nav-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.post-nav-item.is-empty { visibility: hidden; }

/* ---------- 归档 ---------- */

.archive-year {
  margin: 42px 0 6px;
  font-family: "Songti SC", "Source Han Serif SC", "Noto Serif SC", Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

.archive-month {
  margin: 26px 0 4px;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 1px;
}

.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.archive-list li {
  display: flex;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px dashed var(--line-soft);
  align-items: baseline;
}

.archive-list li:last-child { border-bottom: none; }

.archive-date {
  flex: none;
  width: 46px;
  font-size: 13.5px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.archive-link { font-size: 16px; }

/* ---------- 标签页 ---------- */

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 34px 0 10px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 15px;
}

.tag-pill:hover { border-color: #d9cfb8; }

.tag-count {
  font-size: 12.5px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

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

.about-card {
  margin: 34px 0;
  padding: 30px 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.about-card h2 {
  margin: 0 0 14px;
  font-family: "Songti SC", "Source Han Serif SC", "Noto Serif SC", Georgia, serif;
  font-size: 21px;
}

.about-card p { margin: 0 0 14px; color: #46514b; }
.about-card p:last-child { margin-bottom: 0; }

.info-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.info-list li {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 15.5px;
}

.info-list li:last-child { border-bottom: none; }

.info-key {
  flex: none;
  width: 88px;
  color: var(--muted);
}

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

.site-footer {
  margin-top: 76px;
  padding: 34px 0 46px;
  border-top: 1px solid var(--line);
  background: #f6f2ea;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  font-size: 13.5px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-icp { color: var(--muted-2); }

/* ---------- 404 ---------- */

.notfound {
  padding: 110px 0 120px;
  text-align: center;
}

.notfound-code {
  font-family: "Songti SC", Georgia, serif;
  font-size: 84px;
  line-height: 1;
  color: #e2d9c7;
  font-weight: 700;
}

.notfound h1 { margin: 18px 0 10px; font-size: 22px; }
.notfound p { color: var(--muted); margin: 0 0 26px; }

.btn {
  display: inline-block;
  padding: 11px 26px;
  border-radius: 999px;
  background: var(--fg);
  color: #fdfbf6;
  font-size: 15px;
}

.btn:hover { background: var(--accent); color: #fff; }

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

@media (max-width: 640px) {
  body { font-size: 16px; }

  .wrap { padding: 0 18px; }

  .header-inner { height: 56px; gap: 10px; }

  .brand-name { font-size: 17px; }

  /* 四个导航项在 375px 下会顶到屏幕外，字号和间距一起收 */
  .nav { gap: 12px; font-size: 13.5px; }

  .nav a.is-active::after { bottom: -4px; height: 1.5px; }

  .hero { padding: 36px 0 28px; }

  .hero-title { font-size: 23px; line-height: 1.45; }

  .hero-desc { font-size: 15px; }

  .hero-meta { margin-top: 16px; gap: 14px; font-size: 13px; }

  .post-item { padding: 22px 0; }

  .post-title { font-size: 19px; line-height: 1.55; }

  .post-excerpt { font-size: 14.5px; }

  .post-header { padding: 34px 0 20px; }

  .post-header h1 { font-size: 23px; line-height: 1.5; }

  .article p { margin-bottom: 18px; }

  .article h2 { margin: 32px 0 14px; font-size: 20px; }

  .post-nav { flex-direction: column; }

  .about-card { padding: 20px 18px; }

  .info-list li { flex-direction: column; gap: 2px; }

  .info-key { width: auto; font-size: 13px; }

  .archive-list li { gap: 12px; }

  .archive-date { width: 42px; }

  .notfound { padding: 70px 0 80px; }

  .notfound-code { font-size: 64px; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* 兜底：任何情况下都不允许出现横向滚动条 */
html,
body {
  overflow-x: hidden;
}

@media (prefers-color-scheme: dark) {
  /* 保持浅色：域名审核截图多为浅色，避免深色模式下的对比度问题 */
}
