/* 铁柱的个人日志 · 站点样式（纯静态，无外部依赖） */

:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #1e2328;
  --ink-soft: #5b6570;
  --line: #e3ded4;
  --accent: #0f766e;
  --accent-soft: #e6f2f0;
  --warm: #b45309;
  --warm-soft: #fdf3e4;
  --radius: 14px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.75;
}

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

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

/* ---------- 页头 ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }

.brand .mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand .sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-soft);
  letter-spacing: 0;
}

.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }

.site-nav a {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 15px;
}
.site-nav a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.site-nav a.active { background: var(--accent); color: #fff; }

/* ---------- 首屏 ---------- */
.hero {
  padding: 52px 0 34px;
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1.35;
  letter-spacing: .5px;
}
.hero p {
  margin: 0;
  max-width: 640px;
  color: var(--ink-soft);
}

/* ---------- 双栏 ---------- */
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  padding: 34px 0 10px;
}

.column > h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  font-size: 20px;
}
.column > h2::before {
  content: "";
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: var(--accent);
}
.column.life > h2::before { background: var(--warm); }

.column .desc {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--ink-soft);
}

.post-list { display: grid; gap: 14px; }

.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color .15s ease, transform .15s ease;
}
.post-card:hover { border-color: #c9c2b4; transform: translateY(-2px); }

.post-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.5;
}
.post-card h3 a { color: var(--ink); }
.post-card h3 a:hover { color: var(--accent); text-decoration: none; }

.post-card .meta {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.post-card .meta .tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.column.life .post-card .meta .tag { background: var(--warm-soft); color: var(--warm); }

.post-card p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }

/* ---------- 文章页 ---------- */
.article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 40px 40px;
  margin: 34px 0;
}
.article h1 { margin: 0 0 10px; font-size: 26px; line-height: 1.4; }
.article .meta {
  color: var(--ink-soft);
  font-size: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.article h2 { font-size: 19px; margin: 30px 0 10px; }
.article p { margin: 0 0 16px; }
.article ul, .article ol { margin: 0 0 16px; padding-left: 22px; }
.article li { margin-bottom: 6px; }
.article code {
  background: #f1efe9;
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.article blockquote {
  margin: 0 0 16px;
  padding: 10px 18px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
  color: #23403c;
}

.back-link { display: inline-block; margin-bottom: 6px; font-size: 14px; }

/* 公式块 */
.article .formula {
  background: #f1efe9;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 0 0 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 2;
  overflow-x: auto;
}
.article .formula b { color: var(--accent); }

/* 代码块 */
.article pre {
  background: #1e2328;
  color: #e8e6e1;
  border-radius: 10px;
  padding: 16px 18px;
  margin: 0 0 18px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.65;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.article pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  white-space: pre;
}

/* 用料表 */
.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px;
  font-size: 15px;
}
.article th, .article td {
  border: 1px solid var(--line);
  padding: 8px 14px;
  text-align: left;
}
.article th { background: #f1efe9; font-weight: 600; }
.article td.num { width: 130px; color: var(--ink-soft); }

.article .steps { counter-reset: step; list-style: none; padding-left: 0; }
.article .steps li {
  position: relative;
  padding-left: 40px;
  margin-bottom: 14px;
}
.article .steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--warm-soft);
  color: var(--warm);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article .note {
  font-size: 14px;
  color: var(--ink-soft);
  border-top: 1px dashed var(--line);
  margin-top: 26px;
  padding-top: 16px;
}

/* ---------- 页脚（备案号必挂此处）---------- */
.site-footer {
  margin-top: 46px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 30px 0 40px;
  font-size: 14px;
  color: var(--ink-soft);
}
.site-footer .cols {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.site-footer .about { max-width: 460px; }
.site-footer .about strong { color: var(--ink); }
.site-footer .about p { margin: 6px 0 0; }

.icp {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  text-align: center;
  font-size: 13.5px;
}
.icp a { color: var(--ink-soft); }
.icp a:hover { color: var(--accent); }
.icp .dot { margin: 0 8px; color: var(--line); }

@media (max-width: 760px) {
  .columns { grid-template-columns: 1fr; gap: 30px; }
  .hero { padding: 36px 0 26px; }
  .hero h1 { font-size: 24px; }
  .article { padding: 24px 20px 28px; }
  .site-footer .cols { flex-direction: column; }
}