:root {
  --bg: #f7f5f0;
  --text: #22201c;
  --muted: #6f685f;
  --line: rgba(34, 32, 28, 0.12);
  --line-soft: rgba(34, 32, 28, 0.06);
  --accent: #6f7c88;
}

html[data-theme="dark"] {
  --bg: #111111;
  --text: #ece7df;
  --muted: #a79f95;
  --line: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.08);
  --accent: #b3c0cb;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #111111;
    --text: #ece7df;
    --muted: #a79f95;
    --line: rgba(255, 255, 255, 0.14);
    --line-soft: rgba(255, 255, 255, 0.08);
    --accent: #b3c0cb;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family:
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    Arial,
    sans-serif;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family:
    "Songti SC",
    "STSong",
    "Noto Serif SC",
    serif;
  font-weight: 600;
  letter-spacing: 0.02em;
}

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

.wrap {
  width: min(760px, 90%);
  margin: 0 auto;
}

/* header */
.site-header {
  border-bottom: 1px solid var(--line);
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-name {
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  font-size: 0.9rem;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--text);
}

.site-nav {
  padding: 14px 0 18px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.94rem;
}

.site-nav a:hover {
  color: var(--text);
}

/* main */
main {
  padding: 40px 0 80px;
}

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

.hero h1 {
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}

.hero p {
  color: var(--muted);
  font-size: 1rem;
  max-width: 680px;
}

.home-list,
.post-single {
  padding: 34px 0;
}

.section-title {
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.list {
  border-top: 1px solid var(--line-soft);
}

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

.item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.item h2 {
  font-size: 1.16rem;
}

.item h2 a:hover {
  color: var(--accent);
}

.meta {
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.item p {
  color: var(--muted);
  font-size: 0.96rem;
}

.more {
  display: inline-block;
  margin-top: 10px;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
}

.more:hover {
  color: var(--accent);
  border-color: var(--accent);
}

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

.post-header h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.15;
  margin-bottom: 10px;
}

.post-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.post-content {
  color: var(--text);
  font-size: 1rem;
}

.post-content > * + * {
  margin-top: 1.2em;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  margin-top: 2em;
  margin-bottom: 0.6em;
  line-height: 1.4;
}

.post-content h2 {
  font-size: 1.6rem;
}

.post-content h3 {
  font-size: 1.3rem;
}

.post-content p,
.post-content li {
  color: var(--muted);
}

.post-content ul,
.post-content ol {
  padding-left: 1.4em;
}

.post-content blockquote {
  padding-left: 1em;
  border-left: 2px solid var(--line);
  color: var(--muted);
}

.post-content a {
  color: var(--accent);
  border-bottom: 1px solid var(--line-soft);
}

.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5em 0;
}

.post-content pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--line-soft);
  font-size: 0.92rem;
  line-height: 1.7;
}

.post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 20px 0 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .topbar {
    min-height: 64px;
  }

  .item-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .hero h1 {
    font-size: 2.4rem;
  }

  .post-header h1 {
    font-size: 2rem;
  }
}



/* page hero */
.page-hero {
  padding: 18px 0 34px;
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  font-size: clamp(2rem, 6vw, 3.8rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.page-hero p {
  color: var(--muted);
  font-size: 1rem;
}

.archive-page,
.taxonomy-page,
.taxonomy-posts {
  padding: 34px 0;
}

.archive-group + .archive-group {
  margin-top: 34px;
}

.archive-year {
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.archive-list,
.taxonomy-list {
  border-top: 1px solid var(--line-soft);
}

.archive-item,
.taxonomy-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
}

.archive-item h2,
.taxonomy-main h2 {
  font-size: 1.04rem;
}

.archive-item h2 a:hover,
.taxonomy-main h2 a:hover {
  color: var(--accent);
}

.taxonomy-main p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.taxonomy-meta {
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.pager {
  padding-top: 22px;
  display: flex;
  gap: 18px;
  align-items: center;
  color: var(--muted);
}

.pager a {
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}

.pager a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 640px) {
  .archive-item,
  .taxonomy-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .page-hero h1 {
    font-size: 2.1rem;
  }

  .pager {
    flex-wrap: wrap;
  }
}