:root {
  --bg: #faf8f5;
  --bg-elevated: #ffffff;
  --bg-soft: #f1ede6;
  --text: #211e1a;
  --text-muted: #6c675f;
  --text-faint: #9a938a;
  --border: #e8e2d8;
  --border-strong: #d6cec1;
  --accent: #c2410c;
  --accent-soft: rgba(194, 65, 12, 0.09);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17151a;
    --bg-elevated: #201d23;
    --bg-soft: #28242b;
    --text: #ece7e1;
    --text-muted: #a49d92;
    --text-faint: #6f6962;
    --border: #332e36;
    --border-strong: #49424c;
    --accent: #f08a4c;
    --accent-soft: rgba(240, 138, 76, 0.14);
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

::selection {
  background: var(--accent-soft);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  font-size: 17px;
}

.site-nav {
  display: flex;
  gap: 18px;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.15s ease;
}

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

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 24px 90px;
}

/* 首页 hero */
.hero {
  text-align: center;
  padding: 46px 0 38px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 7vw, 52px);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.15;
}

.hero p {
  margin: 0;
  color: var(--text-muted);
  font-size: 16px;
}

.posts {
  display: flex;
  flex-direction: column;
}

.post-card {
  display: block;
  text-decoration: none;
  padding: 26px 2px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease;
}

.post-card:hover {
  background: var(--bg-elevated);
}

.post-card:first-child {
  border-top: 1px solid var(--border);
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-faint);
  font-size: 13px;
  margin-bottom: 8px;
}

.post-card-title {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.post-card-excerpt {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 12px;
}

/* 文章页 */
.article {
  max-width: 720px;
  margin: 0 auto;
  padding: 30px 0 20px;
}

.article-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
  margin-bottom: 32px;
}

.article-header h1 {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--text-faint);
  font-size: 14px;
}

.article-content {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.9;
}

.article-content p {
  margin: 0 0 1.2em;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  margin: 1.4em 0 0.6em;
  line-height: 1.3;
}

.article-content h2 {
  font-size: 1.45em;
}

.article-content h3 {
  font-size: 1.25em;
}

.article-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-content img {
  display: block;
  margin: 1.4em auto;
  border-radius: 10px;
}

.article-content blockquote {
  margin: 1.3em 0;
  padding: 2px 18px;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
  font-style: italic;
}

.article-content ul,
.article-content ol {
  margin: 0 0 1.2em;
  padding-left: 1.5em;
}

.article-content li {
  margin: 0.3em 0;
}

.article-content code {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.88em;
  background: var(--bg-soft);
  border-radius: 5px;
  padding: 0.12em 0.38em;
}

.article-content pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 1.3em 0;
}

.article-content pre code {
  background: transparent;
  padding: 0;
  font-size: 0.86em;
}

.article-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.2em auto;
  width: 60px;
}

.back-link {
  display: inline-block;
  margin-top: 40px;
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
}

/* 关于页 */
.about {
  max-width: 720px;
  margin: 0 auto;
  padding: 36px 0 20px;
}

.about h1 {
  font-family: var(--font-serif);
  font-size: 34px;
  margin: 0 0 20px;
}

.about p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.8;
}

.site-footer {
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  padding: 28px 20px 40px;
  border-top: 1px solid var(--border);
}

.site-footer a {
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .site-header {
    padding: 12px 16px;
  }

  .container {
    padding: 24px 18px 70px;
  }

  .hero {
    padding: 28px 0 26px;
  }

  .post-card-title {
    font-size: 21px;
  }

  .article-content {
    font-size: 17px;
  }
}
