:root {
  --bg: #f7f8f5;
  --paper: #ffffff;
  --text: #222831;
  --muted: #6b7280;
  --line: #e4e7dc;
  --accent: #2f6f5e;
  --accent-soft: #e4f0eb;
  --code-bg: #f3f5f0;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 245, 0.92);
  backdrop-filter: blur(10px);
}

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

.brand {
  font-size: 20px;
  font-weight: 700;
}

.site-nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 15px;
}

.site-nav a:hover,
.post-item h2 a:hover,
.archive-item:hover {
  color: var(--accent);
}

.main {
  padding: 36px 0 48px;
}

.hero {
  padding: 28px 0 34px;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.25;
}

.hero p {
  margin: 10px 0 0;
  color: var(--muted);
}

.post-list {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

.post-item,
.article,
.comments {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.post-item {
  padding: 22px;
}

.post-item time,
.article-header time,
.archive-item time {
  color: var(--muted);
  font-size: 14px;
}

.post-item h2 {
  margin: 6px 0 10px;
  font-size: 24px;
  line-height: 1.35;
}

.post-item p {
  margin: 0 0 14px;
  color: #3f4652;
}

.post-item.compact h2 {
  margin-bottom: 0;
}

.read-more {
  display: inline-flex;
  color: var(--accent);
  font-weight: 600;
}

.article {
  padding: 30px;
}

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

.article-header h1 {
  margin: 8px 0 10px;
  font-size: 34px;
  line-height: 1.25;
}

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

.tags a {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
}

.article-content {
  padding-top: 8px;
}

.article-content h2,
.article-content h3 {
  margin-top: 30px;
  line-height: 1.35;
}

.article-content p {
  margin: 16px 0;
}

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

.article-content blockquote {
  margin: 18px 0;
  padding: 2px 16px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  color: #334155;
}

.article-content code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--code-bg);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.92em;
}

.article-content pre,
.article-content figure.highlight {
  overflow-x: auto;
  margin: 18px 0;
  border-radius: 8px;
  background: var(--code-bg);
}

.article-content figure.highlight table {
  width: 100%;
  border-spacing: 0;
}

.article-content figure.highlight td {
  padding: 0;
}

.article-content figure.highlight .gutter {
  width: 48px;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  color: #9aa2ad;
  text-align: right;
  user-select: none;
}

.article-content figure.highlight .code {
  padding: 14px 16px;
}

.article-content pre code {
  padding: 0;
  background: transparent;
}

.article-content .highlight .comment,
.article-content .highlight .quote {
  color: #7a8491;
  font-style: italic;
}

.article-content .highlight .keyword,
.article-content .highlight .selector-tag,
.article-content .highlight .subst {
  color: #8b3d8b;
}

.article-content .highlight .string,
.article-content .highlight .regexp,
.article-content .highlight .attr,
.article-content .highlight .symbol {
  color: #1f7a4d;
}

.article-content .highlight .number,
.article-content .highlight .literal,
.article-content .highlight .params {
  color: #a45c20;
}

.article-content .highlight .title,
.article-content .highlight .name,
.article-content .highlight .section {
  color: #1f5f99;
  font-weight: 600;
}

.article-content .highlight .built_in,
.article-content .highlight .class,
.article-content .highlight .type {
  color: #0f766e;
}

.article-content .highlight .variable,
.article-content .highlight .template-variable,
.article-content .highlight .language_ {
  color: #4b5563;
}

.article-content .highlight .deletion {
  color: #b42318;
  background: #fde8e7;
}

.article-content .highlight .addition {
  color: #166534;
  background: #e7f6ec;
}

.comments {
  margin-top: 22px;
  padding: 24px;
}

.comments h2,
.page-title h1 {
  margin: 0 0 18px;
}

.page-title p {
  margin: -8px 0 0;
  color: var(--muted);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.tag-cloud a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--accent);
  font-weight: 600;
}

.tag-cloud a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tag-cloud em {
  min-width: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  text-align: center;
}

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

.archive-list {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.archive-list h2 {
  margin: 22px 0 4px;
  color: var(--accent);
}

.archive-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.pager {
  margin-top: 28px;
  text-align: center;
}

.pager a,
.pager span {
  margin: 0 4px;
  color: var(--accent);
}

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

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 0;
}

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

  .hero h1,
  .article-header h1 {
    font-size: 28px;
  }

  .post-item,
  .article,
  .comments {
    padding: 18px;
  }

  .archive-item {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
