:root {
  --bg: #ffffff;
  --surface: #f6f8fa;
  --border: #d1d9e0;
  --text: #1f2328;
  --text-secondary: #656d76;
  --accent: #0969da;
  --accent-hover: #0550ae;
  --tag-bg: #ddf4ff;
  --code-bg: #f6f8fa;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-wide {
  max-width: 1080px;
}

/* Card grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1080px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .post-grid { grid-template-columns: 1fr; }
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.2s, transform 0.2s;
}

.post-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.card-cover {
  width: 100%;
  height: 180px;
  background-size: cover;
  background-position: center;
  background-color: var(--surface);
}

.card-cover-empty {
  background: linear-gradient(135deg, var(--tag-bg), var(--surface));
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.05em;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--text);
}

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

.card-excerpt {
  font-size: 0.88em;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 12px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.78em;
  color: var(--text-secondary);
}

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

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  margin-bottom: 40px;
}

.site-header .container {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.site-title {
  font-size: 1.4em;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

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

.site-desc {
  color: var(--text-secondary);
  font-size: 0.9em;
}

.site-nav {
  margin-left: auto;
}

.site-nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9em;
  font-weight: 500;
}

.site-nav a:hover { opacity: 0.7; }

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

.post-list li {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.post-list li:last-child { border-bottom: none; }

.post-cover {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
}

.post-list .post-link {
  font-size: 1.25em;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.post-list .post-link:hover { color: var(--accent-hover); text-decoration: underline; }

.post-list .post-meta {
  color: var(--text-secondary);
  font-size: 0.85em;
  margin-top: 4px;
}

.post-date-badge {
  display: inline-block;
  color: var(--text-secondary);
  font-size: 0.82em;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 12px;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.post-tags-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.post-list .post-excerpt {
  color: var(--text-secondary);
  margin-top: 8px;
  font-size: 0.95em;
}

.post-title {
  font-size: 1.8em;
  margin-bottom: 8px;
  line-height: 1.3;
}

.post-date {
  color: var(--text-secondary);
  font-size: 0.9em;
  display: block;
  margin-bottom: 16px;
}

.post-tags { margin-bottom: 24px; }

.tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8em;
  margin-right: 6px;
}

.post-content { margin-top: 24px; }

.post-content h2 {
  font-size: 1.4em;
  margin: 32px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.post-content h3 {
  font-size: 1.15em;
  margin: 24px 0 8px;
}

.post-content p { margin: 12px 0; }

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

.post-content ul, .post-content ol {
  margin: 12px 0 12px 24px;
}

.post-content li { margin: 4px 0; }

.post-content blockquote {
  border-left: 3px solid var(--border);
  padding: 8px 16px;
  margin: 16px 0;
  color: var(--text-secondary);
  background: var(--surface);
  border-radius: 0 6px 6px 0;
}

.post-content code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-content pre {
  background: var(--code-bg);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--border);
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9em;
}

.post-content th, .post-content td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.post-content th {
  background: var(--surface);
  font-weight: 600;
}

.post-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 16px 0;
}

.about-banner {
  text-align: center;
  margin-bottom: 24px;
}

.about-banner img {
  max-width: 100%;
  border-radius: 12px;
}

.about-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.about-content {
  flex: 1;
  min-width: 0;
}

.about-content ul {
  padding-left: 1.5em;
}

.about-content li {
  margin: 6px 0;
}

.about-avatar {
  flex-shrink: 0;
  width: 280px;
  padding-top: 8px;
}

.about-avatar img {
  width: 100%;
  border-radius: 12px;
}

@media (max-width: 600px) {
  .about-layout {
    flex-direction: column-reverse;
    align-items: center;
  }
  .about-avatar {
    width: 160px;
  }
}

.site-footer {
  margin-top: 60px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85em;
  text-align: center;
}
