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

:root {
  --text: #2c3e50;
  --text-light: #6b7280;
  --bg: #fafafa;
  --surface: #ffffff;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --border: #e5e7eb;
  --radius: 6px;
  --max-width: 720px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  font-size: 17px;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--accent-hover); }

/* === Header === */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}
.site-title:hover { color: var(--accent); }
.site-nav a {
  margin-left: 1.5rem;
  color: var(--text-light);
  font-size: 0.95rem;
}
.site-nav a:hover, .site-nav a.active {
  color: var(--accent);
}

/* === Main === */
main {
  padding: 2.5rem 0;
  min-height: calc(100vh - 160px);
}

/* === Hero (homepage) === */
.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}
.hero h1 {
  font-size: 2.4rem;
  margin-bottom: 0.5rem;
}
.hero-subtitle {
  color: var(--text-light);
  font-size: 1.15rem;
  margin-bottom: 1rem;
}
.hero a {
  margin: 0 0.5rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-light);
}
.hero a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* === Home Sections === */
.home-section {
  margin-bottom: 2.5rem;
}
.home-section h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

/* === Post List === */
.post-list { margin-top: 1rem; }
.post-summary {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.post-summary h2, .post-summary h3 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}
.post-summary h2 a, .post-summary h3 a { color: var(--text); }
.post-summary h2 a:hover, .post-summary h3 a:hover { color: var(--accent); }
.post-summary time {
  color: var(--text-light);
  font-size: 0.85rem;
}
.post-summary p {
  margin-top: 0.5rem;
  color: var(--text-light);
  font-size: 0.95rem;
}
.read-more {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.95rem;
}

/* === Single Post === */
.post-header {
  margin-bottom: 2rem;
}
.post-header h1 {
  font-size: 2rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}
.post-header time {
  color: var(--text-light);
  font-size: 0.9rem;
}
.post-tags {
  margin-top: 0.5rem;
}
.post-tags a {
  font-size: 0.85rem;
  color: var(--accent);
  margin-right: 0.5rem;
}

/* === Post Content === */
.post-content h2 { font-size: 1.5rem; margin: 2rem 0 0.75rem; }
.post-content h3 { font-size: 1.25rem; margin: 1.5rem 0 0.5rem; }
.post-content p { margin-bottom: 1.25rem; }
.post-content ul, .post-content ol { margin: 0 0 1.25rem 1.5rem; }
.post-content li { margin-bottom: 0.3rem; }
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1rem 0;
}
.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--text-light);
  margin: 1.25rem 0;
}
.post-content code {
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
}
.post-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.25rem 0;
}
.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
}

/* === Responsive === */
@media (max-width: 600px) {
  .site-header .container {
    flex-direction: column;
    gap: 0.5rem;
  }
  .site-nav a { margin-left: 1rem; }
  .hero h1 { font-size: 1.8rem; }
  main { padding: 1.5rem 0; }
}
