:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #8a8a8a;
  --line: #e2e2e2;
  --card: #f7f7f7;
}

html[data-theme="dark"] {
  --bg: #0d0d0d;
  --fg: #f0f0f0;
  --muted: #7d7d7d;
  --line: #262626;
  --card: #161616;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 28px 96px;
}

/* ---------- 顶部 ---------- */
header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 40px 0 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 64px;
}

.logo {
  font-size: 15px;
  letter-spacing: .32em;
  text-transform: uppercase;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

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

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: .06em;
  font-family: ui-sans-serif, -apple-system, "PingFang SC", sans-serif;
  transition: color .2s;
}

nav a:hover { color: var(--fg); }

.toggle {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: .2s;
}

.toggle:hover { border-color: var(--fg); color: var(--fg); }

/* ---------- 首页引言 ---------- */
.intro { margin-bottom: 76px; }

.intro h1 {
  font-size: 40px;
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.25;
  margin-bottom: 18px;
}

.intro p { color: var(--muted); font-size: 16px; max-width: 46ch; }

.section-label {
  font-family: ui-sans-serif, -apple-system, "PingFang SC", sans-serif;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

/* ---------- 列表 ---------- */
a.post {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 30px 0;
  border-top: 1px solid var(--line);
  position: relative;
}

a.post:last-of-type { border-bottom: 1px solid var(--line); }

a.post .meta {
  font-family: ui-sans-serif, -apple-system, "PingFang SC", sans-serif;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .08em;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
}

a.post h2 {
  font-size: 23px;
  font-weight: 400;
  letter-spacing: -.01em;
  line-height: 1.4;
  margin-bottom: 8px;
  transition: opacity .2s;
}

a.post p { font-size: 15px; color: var(--muted); max-width: 54ch; }

a.post::after {
  content: "→";
  position: absolute;
  right: 0;
  top: 32px;
  color: var(--fg);
  opacity: 0;
  transform: translateX(-6px);
  transition: .25s ease;
  font-size: 16px;
}

a.post:hover::after { opacity: 1; transform: translateX(0); }
a.post:hover h2 { opacity: .6; }

/* ---------- 文章详情页 ---------- */
.back {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-family: ui-sans-serif, -apple-system, "PingFang SC", sans-serif;
  font-size: 13px;
  letter-spacing: .06em;
  margin-bottom: 44px;
  transition: color .2s, transform .2s;
}

.back:hover { color: var(--fg); transform: translateX(-3px); }

.back.bottom {
  display: block;
  margin: 72px 0 0;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.post-meta {
  font-family: ui-sans-serif, -apple-system, "PingFang SC", sans-serif;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .08em;
  margin-bottom: 16px;
}

.post-title {
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.3;
  margin-bottom: 48px;
}

.post-body { font-size: 17px; line-height: 1.95; }

.post-body p { margin-bottom: 1.55em; }

.post-body h2 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
  margin: 2.4em 0 1em;
  letter-spacing: 0;
}

.post-body blockquote {
  border-left: 2px solid var(--line);
  padding-left: 22px;
  margin: 2em 0;
  color: var(--muted);
}

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

.post-end {
  margin-top: 3em;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: .1em;
  text-align: center;
}

/* ---------- 页脚 ---------- */
footer {
  margin-top: 88px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-family: ui-sans-serif, -apple-system, "PingFang SC", sans-serif;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .04em;
}

@media (max-width: 560px) {
  .wrap { padding: 0 20px 64px; }
  header { margin-bottom: 48px; flex-wrap: wrap; gap: 16px; }
  .intro h1 { font-size: 30px; }
  .intro { margin-bottom: 52px; }
  a.post h2 { font-size: 20px; }
  nav { gap: 18px; }
  .post-title { font-size: 27px; margin-bottom: 36px; }
  .post-body { font-size: 16px; line-height: 1.9; }
  .back { margin-bottom: 34px; }
}
