/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Font Stacks ── */
:root {
  --font-serif: "Source Serif 4", "Source Han Serif SC", "Noto Serif CJK SC", "PingFang SC", serif;
  --font-sans: "Source Sans 3", "Source Han Sans SC", "Noto Sans CJK SC", "PingFang SC", sans-serif;
  --font-mono: "Source Code Pro", "Menlo", "Consolas", monospace;

  --color-fg: #2e405b;
  --color-bg: #ffffff;
  --color-muted: #6b7f99;
  --color-border: #e0e4e8;
  --color-code-bg: var(--color-code-bg);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-fg: #c8d1e0;
    --color-bg: #0f1117;
    --color-muted: #6b7a92;
    --color-border: #1e2433;
    --color-code-bg: #161a24;
  }
}

/* ── Base ── */
html {
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--color-fg);
  background: var(--color-bg);
  line-height: 1.5;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
}

h1 { font-size: 2.333rem; }
h2 { font-size: 2rem; margin-top: 2rem; }
h3 { font-size: 1.667rem; margin-top: 1.5rem; }
h4 { font-size: 1.333rem; margin-top: 1.25rem; }

a {
  color: var(--color-fg);
  text-decoration: none;
  border-bottom: 2px solid var(--color-fg);
  transition: color 0.2s, background 0.2s;
}

a:hover {
  color: var(--color-bg);
  background: var(--color-fg);
}

/* ── Home Page ── */
.page-home {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}

.home-card {
  text-align: center;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
}

.home-name {
  font-size: 1.5rem;
  margin-top: 1rem;
}

.home-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.75rem;
}

.home-links a {
  color: var(--color-fg);
  border-bottom: none;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.home-links a:hover {
  opacity: 1;
  background: none;
  color: var(--color-fg);
}

.home-archive-link {
  display: inline-block;
  margin-top: 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.889rem;
  color: var(--color-muted);
  border-bottom: 1px solid var(--color-muted);
}

.home-archive-link:hover {
  color: var(--color-bg);
  background: var(--color-fg);
  border-color: var(--color-fg);
}

/* ── Container ── */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 80px 20px;
}

/* ── Archive ── */
.page-title {
  margin-bottom: 2rem;
}

.archive-year {
  font-size: 1.333rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.archive-list {
  list-style: none;
}

.archive-item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.25rem 0;
}

.archive-date {
  font-family: var(--font-mono);
  font-size: 0.778rem;
  color: var(--color-muted);
  flex-shrink: 0;
}

.archive-item a {
  font-family: var(--font-serif);
  border-bottom: 1px solid var(--color-border);
}

.archive-item a:hover {
  border-color: var(--color-fg);
}

/* ── Heading Anchors (hexo-renderer-marked) ── */
.post-content h1 a,
.post-content h2 a,
.post-content h3 a,
.post-content h4 a,
.post-content h5 a,
.post-content h6 a {
  border-bottom: none;
  color: inherit;
  background: none;
}

.post-content .headerlink {
  display: none;
}

/* ── Post ── */
.post-cover {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 2rem;
}

.post-title {
  margin-bottom: 0.25rem;
}

.post-date {
  display: block;
  font-size: 0.778rem;
  color: var(--color-muted);
  margin-bottom: 2.5rem;
}

.post-content p {
  margin-bottom: 1rem;
}

.post-content h2 { margin-bottom: 0.5rem; }
.post-content h3 { margin-bottom: 0.5rem; }

.post-content ul,
.post-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.25rem;
}

.post-content blockquote {
  border-left: 3px solid var(--color-border);
  padding-left: 1rem;
  color: var(--color-muted);
  margin-bottom: 1rem;
  font-style: italic;
}

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

.post-content figure {
  margin: 1.5rem 0;
}

.post-content figure img {
  max-width: 100%;
}

.post-content figcaption {
  font-size: 0.778rem;
  color: var(--color-muted);
  margin-top: 0.5rem;
  text-align: center;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-code-bg);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

.post-content pre {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--color-code-bg);
  border-radius: 4px;
  overflow-x: auto;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.833rem;
}

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

.post-content a:hover {
  border-color: var(--color-fg);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  html { font-size: 16px; }
  .container { padding: 40px 16px; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.667rem; }
}
