:root {
  color-scheme: light dark;
  --bg: #f7f7f5;
  --text: #202124;
  --muted: #62666d;
  --line: #d8d9d6;
  --link: #1b5e8c;
  --panel: #ffffff;
  --code: #f0f2f4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111315;
    --text: #e7e8ea;
    --muted: #a7abb2;
    --line: #30343a;
    --link: #79b8e8;
    --panel: #191c20;
    --code: #22262c;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  line-height: 1.75;
}

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

a:hover {
  text-decoration: underline;
}

.site-header,
.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

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

.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.home-head,
.page-head,
.article-head {
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
  padding-bottom: 20px;
}

h1,
h2,
h3 {
  line-height: 1.35;
}

.home-head h1,
.page-head h1,
.article-head h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 5vw, 48px);
}

.home-head p,
.meta,
.post-item time,
.site-footer {
  color: var(--muted);
}

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

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

.post-item h2 {
  margin: 4px 0 8px;
  font-size: 23px;
}

.post-item p {
  margin: 0;
}

.article {
  background: var(--panel);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cover {
  display: block;
  max-width: 100%;
  max-height: 420px;
  margin-top: 18px;
  object-fit: contain;
}

.content img {
  max-width: 100%;
  height: auto;
}

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

.content code {
  background: var(--code);
  padding: 2px 5px;
  border-radius: 4px;
}

.content pre code {
  padding: 0;
}

.content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

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

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
}

.tags a,
.term-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--muted);
}

.term-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
}

.term-list li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

@media (max-width: 640px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .article {
    padding: 20px;
  }
}
