/* fork.work — developer blog — minimalist design */
/* Inspired by overreacted.io, antfu.me */

:root {
  --bg: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --quote-border: #d1d5db;
  --code-bg: #f3f4f6;
  --max-width: 680px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --border: #1e293b;
    --accent: #60a5fa;
    --accent-hover: #93bbfd;
    --quote-border: #334155;
    --code-bg: #1e293b;
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header / Nav */
header {
  padding: 48px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

header .container {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.site-title {
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.01em;
}

.site-title:hover {
  color: var(--accent);
}

nav a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  margin-left: 24px;
  transition: color 0.15s;
}

nav a:hover {
  color: var(--accent);
}

/* Article */
article {
  padding-bottom: 64px;
}

article header.article-header {
  border-bottom: none;
  padding: 0;
  margin-bottom: 32px;
}

.article-date {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.article-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.article-series {
  font-size: 13px;
  color: var(--accent);
  margin-top: 8px;
}

/* Body content */
.post-content {
  font-size: 16.5px;
}

.post-content p {
  margin-bottom: 1.5em;
}

.post-content h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 2em 0 0.8em;
  letter-spacing: -0.01em;
}

.post-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 1.8em 0 0.6em;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

.post-content blockquote {
  border-left: 3px solid var(--quote-border);
  padding-left: 20px;
  margin: 1.5em 0;
  color: var(--text-secondary);
  font-style: normal;
}

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

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

.post-content code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

.post-content pre {
  background: var(--code-bg);
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5em 0;
  font-size: 14px;
  line-height: 1.6;
}

/* Article footer / series note */
.article-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-secondary);
}

/* Footer */
.site-footer {
  padding: 32px 0 64px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

/* About page */
.about-section {
  line-height: 1.9;
}

.about-section h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 2em 0 0.8em;
}

.about-section p {
  margin-bottom: 1.2em;
}

.apps-list {
  margin: 1.5em 0;
}

.apps-list a {
  display: inline-block;
  margin-right: 16px;
  margin-bottom: 8px;
  padding: 4px 12px;
  background: var(--code-bg);
  border-radius: 6px;
  font-size: 14px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
}

.apps-list a:hover {
  background: var(--border);
}

/* Responsive */
@media (max-width: 600px) {
  body { font-size: 15px; }
  .article-title { font-size: 26px; }
  header .container { flex-direction: column; gap: 8px; }
  nav a:first-child { margin-left: 0; }
}