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

/* Header */
header {
  padding: 60px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 60px;
  position: relative;
}

.site-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

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

nav {
  display: flex;
  gap: 20px;
  font-size: 16px;
}

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

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

/* Theme Switcher */
.theme-switcher {
  position: absolute;
  top: 60px;
  right: 0;
}

.theme-toggle {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.theme-toggle:hover {
  background: var(--border);
}

.theme-icon {
  display: block;
}

/* Responsive */
@media (max-width: 768px) {
  .theme-switcher {
    top: 72px;
  }
}

/* Home page */
.intro {
  margin-bottom: 60px;
  font-size: 20px;
  color: var(--text-secondary);
}

.visitor-count {
  font-size: 14px;
  color: var(--text-secondary);
  opacity: 0.8;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.visitor-count::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  opacity: 0.8;
}

.posts {
  margin-bottom: 80px;
}

.post-item {
  margin-bottom: 40px;
}

.post-item time {
  display: block;
  font-size: 15px;
  color: var(--meta);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.post-item h2 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
}

.post-item h2 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.post-item h2 a:hover {
  color: var(--orange);
}

/* Post page */
.post {
  margin-bottom: 80px;
  margin-top: -20px;
}

.post-header {
  margin-bottom: 50px;
}

.post-header h1 {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
}

.post-header time {
  display: block;
  font-size: 16px;
  color: var(--meta);
}

.post-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.post-meta-row time {
  display: inline-flex;
  align-items: center;
}

.post-meta-row .visitor-count {
  font-size: 14px;
  margin-top: 0;
}

.post-meta-row .read-time {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 0;
}

.post-content {
  font-size: 18px;
  line-height: 1.7;
}

.post-content h2 {
  font-size: 28px;
  font-weight: 600;
  margin: 50px 0 20px;
  line-height: 1.3;
  color: var(--heading);
}

.post-content h3 {
  font-size: 22px;
  font-weight: 600;
  margin: 40px 0 16px;
  line-height: 1.3;
  color: var(--heading-secondary);
}

.post-content p {
  margin-bottom: 24px;
}

.post-content ul,
.post-content ol {
  margin: 24px 0;
  padding-left: 28px;
}

.post-content li {
  margin-bottom: 8px;
}

.post-content a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

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

.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 40px auto;
  border-radius: 4px;
}

.post-content strong {
  font-weight: 600;
}

.post-content em {
  font-style: italic;
}

/* Blockquotes */
.post-content blockquote {
  margin: 32px 0;
  padding-left: 24px;
  padding-right: 0;
  border-left: 3px solid var(--border);
  color: var(--text-secondary);
}

.post-content blockquote p {
  margin-bottom: 16px;
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

/* Code blocks */
.post-content code {
  font-family: "SpaceMono", "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  font-size: 0.9em;
}

.post-content :not(pre)>code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--code-border);
}

/* Chroma-generated code blocks (pre.chroma) */
.post-content pre.chroma {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 6px;
  padding: 20px;
  overflow-x: auto;
  margin: 32px 0;
  font-size: 15px;
  line-height: 1.5;
  font-family: "SpaceMono", "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
}

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

/* Fallback for non-Chroma code blocks */
.post-content pre:not(.chroma) {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 6px;
  padding: 20px;
  overflow-x: auto;
  margin: 32px 0;
  font-size: 15px;
  line-height: 1.5;
  font-family: "SpaceMono", "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
}

.post-content pre:not(.chroma) code {
  background: none;
  border: none;
  padding: 0;
}

/* Post footer */
.post-footer {
  margin-top: 80px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

.post-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 16px;
  transition: color 0.2s;
}

.post-footer a:hover {
  color: var(--text);
}

/* About page */
.about {
  margin-bottom: 80px;
}

.about h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
}

.about .visitor-count {
  margin-bottom: 40px;
}

.about-content {
  font-size: 18px;
  line-height: 1.7;
}

.about-content p {
  margin-bottom: 24px;
}

.about-content h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 50px 0 20px;
  color: var(--heading);
}

.about-content a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.about-content a:hover {
  color: var(--link-hover);
  border-bottom-color: var(--link-hover);
}

.about-content code {
  font-family: "SpaceMono", "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--code-border);
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 60px;
  margin-top: 80px;
}

footer p {
  font-size: 15px;
  color: var(--text-secondary);
}

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

footer a:hover {
  color: var(--orange);
}

/* Responsive */
@media (max-width: 768px) {
  body {
    font-size: 17px;
  }

  .container {
    padding: 0 16px;
  }

  header {
    padding: 40px 0 30px;
    margin-bottom: 40px;
  }

  .site-title {
    font-size: 24px;
  }

  .intro {
    font-size: 18px;
    margin-bottom: 50px;
  }

  .post-item {
    margin-bottom: 36px;
  }

  .post-item h2 {
    font-size: 21px;
  }

  .post {
    margin-top: -10px;
  }

  .post-header h1 {
    font-size: 30px;
  }

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

  .post-content h2 {
    font-size: 24px;
    margin: 40px 0 16px;
  }

  .post-content h3 {
    font-size: 20px;
    margin: 32px 0 12px;
  }

  .post-content pre {
    padding: 16px;
    font-size: 14px;
    border-radius: 4px;
  }

  .about h1 {
    font-size: 30px;
  }

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