:root {
  --bg: #fbfbf8;
  --bg-soft: #f0f2ee;
  --text: #23261f;
  --muted: #6d7168;
  --line: #d9ddd3;
  --accent: #0e7a6d;
  --accent-strong: #0a5f56;
  --warm: #c96a24;
  --code-bg: #eef0eb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161914;
    --bg-soft: #1f241d;
    --text: #e8e9df;
    --muted: #a6ab9f;
    --line: #333a30;
    --accent: #55c3ad;
    --accent-strong: #83d8c5;
    --warm: #e6a15f;
    --code-bg: #20251e;
  }
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}

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

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

.wrap {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 18px;
  font-size: 14px;
}

.nav a {
  color: var(--muted);
}

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

main {
  min-height: calc(100vh - 190px);
  padding: 48px 0 64px;
}

.intro {
  margin-bottom: 44px;
}

.intro h1 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.35;
}

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

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

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

.post-title {
  margin: 0 0 6px;
  font-size: 21px;
  line-height: 1.45;
}

.post-title a {
  color: var(--text);
}

.post-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

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

.post-summary {
  margin: 12px 0 0;
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.6;
}

.tag:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  text-decoration: none;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-large {
  font-size: 14px;
}

.tag-count {
  margin-left: 4px;
  color: var(--muted);
  font-size: 12px;
}

.page-header {
  margin-bottom: 36px;
}

.page-header h1 {
  margin: 0;
  font-size: 28px;
}

.post-header {
  margin-bottom: 30px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.post-header h1 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.4;
}

.post-content {
  font-size: 16px;
}

.post-content h2 {
  margin: 32px 0 12px;
  font-size: 23px;
}

.post-content h3 {
  margin: 26px 0 10px;
  font-size: 19px;
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote,
.post-content table {
  margin: 0 0 18px;
}

.post-content blockquote {
  margin-left: 0;
  padding-left: 16px;
  border-left: 3px solid var(--warm);
  color: var(--muted);
}

.post-content code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--code-bg);
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 0.9em;
}

.post-content pre {
  padding: 16px;
  overflow-x: auto;
  border-radius: 6px;
  background: var(--code-bg);
}

.post-content pre code {
  padding: 0;
  background: none;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.post-content th,
.post-content td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  color: var(--muted);
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 560px) {
  main {
    padding-top: 32px;
  }

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

  .intro h1,
  .post-header h1 {
    font-size: 25px;
  }
}
