/* ==========================================================
   个人服务搭建踩坑及排雷记录 — 样式表
   纯静态、无外部依赖、无字体/统计/广告请求
   ========================================================== */

:root {
  --paper: #fbfaf7;
  --card: #ffffff;
  --ink: #191c21;
  --ink-2: #3d434d;
  --muted: #6f7681;
  --faint: #9aa1ab;
  --line: #e7e3dc;
  --line-soft: #f0ece6;
  --accent: #2f6b5f;
  --accent-ink: #245247;
  --accent-soft: #eaf2ef;
  --code-bg: #f5f3ee;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(25, 28, 33, 0.04), 0 8px 24px -12px rgba(25, 28, 33, 0.12);
  --wrap: 1060px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.serif {
  font-family: "Songti SC", "Source Han Serif SC", "Noto Serif SC", Georgia, serif;
}

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 250, 247, 0.88);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #6f9d92 55%, transparent);
}

.header-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.brand .mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(3px);
  letter-spacing: 0;
}

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

.brand .name-short { display: none; }

.site-nav {
  margin-left: auto;
  display: flex;
  gap: 22px;
  font-size: 14px;
  color: var(--muted);
}

.site-nav a { padding: 4px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover { color: var(--accent-ink); border-bottom-color: var(--accent); }
.site-nav a.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- 通用容器 ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- 首页 Hero ---------- */
.hero {
  padding: 58px 0 40px;
  border-bottom: 1px solid var(--line-soft);
}

.hero h1 {
  margin: 0 0 14px;
  font-size: 34px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.hero p {
  margin: 0;
  max-width: 620px;
  color: var(--ink-2);
  font-size: 16px;
}

.hero-meta {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-size: 12.5px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid #d9e7e2;
  border-radius: 999px;
  padding: 3px 11px;
  line-height: 1.6;
}

.chip.ghost {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

/* ---------- 主体两栏 ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 56px;
  padding: 42px 0 72px;
}

.section-label {
  font-size: 12.5px;
  letter-spacing: 2px;
  color: var(--faint);
  text-transform: uppercase;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- 文章列表 ---------- */
.post-list { display: flex; flex-direction: column; gap: 2px; }

.post-item {
  position: relative;
  display: block;
  padding: 22px 20px 22px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.post-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 26px;
  bottom: 26px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.18s ease;
}

.post-item:hover {
  background: var(--card);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.post-item:hover::before { background: var(--accent); }

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--faint);
  margin-bottom: 7px;
  font-variant-numeric: tabular-nums;
}

.post-meta .tag {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 12px;
}

.post-item h2 {
  margin: 0 0 6px;
  font-size: 19.5px;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0.2px;
}

.post-item p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.75;
}

.post-item.draft { cursor: default; }
.post-item.draft:hover { background: transparent; border-color: transparent; box-shadow: none; }
.post-item.draft:hover::before { background: transparent; }
.post-item.draft h2 { color: var(--faint); font-weight: 500; }

/* ---------- 侧栏 ---------- */
.side { display: flex; flex-direction: column; gap: 30px; padding-top: 6px; }

.side-box h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.4px;
  color: var(--faint);
}

.side-box p { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); line-height: 1.8; }
.side-box p:last-child { margin-bottom: 0; }

.cat-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.cat-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  color: var(--ink-2);
}
.cat-list li:last-child { border-bottom: 0; }
.cat-list span { color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.note-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 8px;
  padding: 16px 18px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.85;
}

/* ---------- 文章页 ---------- */
.article-head {
  padding: 54px 0 26px;
  border-bottom: 1px solid var(--line-soft);
}

.back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}
.back-link:hover { color: var(--accent-ink); }

.article-head h1 {
  margin: 0 0 14px;
  font-size: 30px;
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.article-head .lede {
  margin: 0 0 18px;
  color: var(--ink-2);
  font-size: 15.5px;
  max-width: 720px;
}

.article-body {
  max-width: 720px;
  padding: 38px 0 60px;
  font-size: 16px;
  line-height: 1.95;
  color: #22262c;
}

.article-body h2 {
  margin: 40px 0 14px;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.3px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}

.article-body h3 { margin: 28px 0 10px; font-size: 17px; font-weight: 600; }

.article-body p { margin: 0 0 16px; }

.article-body ul, .article-body ol { margin: 0 0 16px; padding-left: 22px; }
.article-body li { margin-bottom: 7px; }

.article-body strong { font-weight: 600; }

.article-body code {
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 13.5px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  color: #8a3f2c;
}

.article-body pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 20px;
  line-height: 1.7;
}

.article-body pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: #2f353d;
  font-size: 13px;
}

.callout {
  background: #fdf7ef;
  border: 1px solid #f0e0c8;
  border-left: 3px solid #c98a2b;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 0 0 20px;
  font-size: 14.5px;
  color: #6b4d1d;
  line-height: 1.85;
}

.callout strong { color: #8a5d13; }

.article-end {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--faint);
  line-height: 1.9;
}

.next-links { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.next-links a {
  font-size: 14px;
  color: var(--accent-ink);
  border-bottom: 1px solid #cfe0da;
  align-self: flex-start;
}
.next-links a:hover { border-bottom-color: var(--accent); }

/* ---------- 关于页 ---------- */
.page-body { max-width: 720px; padding: 40px 0 70px; }
.page-body h2 {
  margin: 36px 0 12px;
  font-size: 19px;
  font-weight: 600;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}
.page-body h2:first-child { margin-top: 0; }
.page-body p { margin: 0 0 14px; color: var(--ink-2); }
.page-body ul { margin: 0 0 14px; padding-left: 22px; color: var(--ink-2); }
.page-body li { margin-bottom: 6px; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: #f6f4ef;
  padding: 30px 0 34px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.9;
}

.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  align-items: flex-start;
  justify-content: space-between;
}

.footer-inner p { margin: 0; }

.icp-link { color: var(--muted); }
.icp-link:hover { color: var(--accent-ink); }

.footer-note { color: var(--faint); font-size: 12.5px; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .side { padding-top: 0; border-top: 1px solid var(--line-soft); }
  .hero { padding: 40px 0 30px; }
  .hero h1 { font-size: 27px; }
  .article-head h1 { font-size: 24px; }
  .article-head { padding: 36px 0 22px; }
  .brand .name { display: none; }
  .brand .name-short { display: inline; }
  .site-nav { gap: 16px; }
}
