:root {
  color-scheme: light dark;
  --bg: #f7f5f0;
  --surface: #ffffff;
  --text: #1f2124;
  --muted: #6b6f76;
  --line: #e4e1d8;
  --accent: #2f5d50;
  --accent-soft: rgba(47, 93, 80, 0.1);
  --code-bg: #efece4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a;
    --surface: #1f2125;
    --text: #e8e6e1;
    --muted: #9a9ea6;
    --line: #2e3136;
    --accent: #8cc3ae;
    --accent-soft: rgba(140, 195, 174, 0.12);
    --code-bg: #26292e;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.75 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC",
    "Microsoft YaHei", sans-serif;
}

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

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 64px 20px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* Home */
.intro { margin-bottom: 48px; }

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 20px;
}

img.avatar { object-fit: cover; }

.intro h1 { font-size: 32px; line-height: 1.2; margin: 0 0 8px; letter-spacing: 0.01em; }
.bio { margin: 0; color: var(--muted); font-size: 16px; word-break: keep-all; }

section { margin-bottom: 48px; }

h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 16px;
}

.app {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: inherit;
  transition: border-color 0.2s;
}
.app:hover { text-decoration: none; border-color: var(--accent); }
.app + .app { margin-top: 12px; }

.app-icon { width: 56px; height: 56px; border-radius: 13px; flex: none; }
.app-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.app-name { font-weight: 600; font-size: 18px; }
.app-tagline { font-weight: 400; font-size: 14px; color: var(--muted); margin-left: 10px; }
.app-description { font-size: 14px; line-height: 1.6; color: var(--muted); }
.app-arrow { color: var(--accent); flex: none; }

.posts { list-style: none; margin: 0; padding: 0; }
.posts li { border-bottom: 1px solid var(--line); }
.posts a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  color: inherit;
}
.posts a:hover { text-decoration: none; }
.posts a:hover .post-title { color: var(--accent); }
.posts time { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; flex: none; }

.empty { color: var(--muted); margin: 0; }

/* Post */
.back { margin-bottom: 40px; font-size: 15px; }

.post-header { margin-bottom: 32px; }
.post-header h1 { font-size: 30px; line-height: 1.3; margin: 0 0 8px; }
.post-header time { color: var(--muted); font-size: 14px; }

.prose { overflow-wrap: anywhere; }
.prose h2 { font-size: 22px; letter-spacing: 0; color: var(--text); margin: 40px 0 12px; }
.prose h3 { font-size: 19px; margin: 32px 0 8px; }
.prose h4, .prose h5, .prose h6 { font-size: 17px; margin: 24px 0 8px; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre { margin: 0 0 20px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 4px; }
/* Checklists (- [x] / - [ ]): a quiet ring, filled with a tick once done. */
.prose li.task { list-style: none; position: relative; }
.prose li.task::before {
  content: ""; position: absolute; left: -1.5em; top: 0.38em;
  width: 0.95em; height: 0.95em; box-sizing: border-box;
  border: 1.5px solid color-mix(in srgb, var(--muted) 55%, transparent); border-radius: 50%;
}
.prose li.task.done::before {
  content: "✓"; border-color: var(--accent); background: var(--accent); color: var(--bg);
  font-size: 0.7em; line-height: 1.2em; width: 1.35em; height: 1.35em; text-align: center; font-weight: 700;
  left: -2.15em; top: 0.5em;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.prose img { max-width: 100%; height: auto; border-radius: 10px; display: block; margin: 8px auto; }
.prose blockquote {
  margin-left: 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code {
  font: 0.88em/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 5px;
}
.prose pre {
  background: var(--code-bg);
  padding: 16px;
  border-radius: 10px;
  overflow-x: auto;
}
.prose pre code { background: none; padding: 0; font-size: 14px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

.missing { text-align: center; padding-top: 80px; }
.missing h1 { font-size: 48px; margin: 0; }

/* Footer */
.footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 13px;
  color: var(--muted);
}
.footer a { color: var(--muted); }

@media (max-width: 480px) {
  .page { padding-top: 40px; }
  .app-tagline { display: block; margin: 2px 0 0; }
}
