/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: 1.6;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: #333;
  background-color: #fff;
  max-width: 100%;
  overflow-x: hidden;
}

/* Container and layout */
.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header styles */
.site-header {
  padding: 60px 0 40px;
  border-bottom: 1px solid #eee;
  margin-bottom: 40px;
}

.site-header h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 16px;
}

.site-header h1 a {
  color: #333;
  text-decoration: none;
}

.site-header h1 a:hover {
  color: #0066cc;
}

.site-nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.site-nav a {
  color: #666;
  text-decoration: none;
  font-size: 15px;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.site-nav a:hover {
  color: #0066cc;
  border-bottom-color: #0066cc;
}

/* Main content */
.content {
  flex: 1;
  margin-bottom: 60px;
}

/* Post summary styles (index page) */
.post-summary {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid #f0f0f0;
}

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

.post-header h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
}

.post-header h2 a {
  color: #333;
  text-decoration: none;
}

.post-header h2 a:hover {
  color: #0066cc;
}

.post-meta {
  font-size: 14px;
  color: #666;
  margin-bottom: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.post-meta time {
  font-weight: 500;
}

.post-meta .category {
  background: #f5f5f5;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  color: inherit;
  text-decoration: none;
}

.post-meta .category:hover {
  color: inherit;
  text-decoration: none;
}

.post-excerpt {
  color: #555;
  line-height: 1.6;
}

/* Article styles */
.article {
  margin-bottom: 40px;
}

.article-header {
  margin-bottom: 32px;
}

.article-header h1 {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 16px;
  color: #333;
}

.article-meta {
  font-size: 14px;
  color: #666;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.article-meta time {
  font-weight: 500;
}

.article-meta .author {
  font-style: italic;
}

.article-meta .category {
  background: #f5f5f5;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  color: inherit;
  text-decoration: none;
}

.article-meta .category:hover {
  color: inherit;
  text-decoration: none;
}

.tag {
  background: #e8f4f8;
  color: #0066cc;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
}

.tag:hover {
  color: #0066cc;
  text-decoration: none;
}

/* Article content */
.article-content {
  font-size: 17px;
  line-height: 1.7;
  color: #333;
}

.article-content > * {
  margin-bottom: 24px;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  font-weight: 600;
  line-height: 1.3;
  color: #333;
  margin-top: 40px;
  margin-bottom: 16px;
}

.article-content h1 { font-size: 28px; }
.article-content h2 { font-size: 24px; }
.article-content h3 { font-size: 20px; }
.article-content h4 { font-size: 18px; }
.article-content h5 { font-size: 16px; }
.article-content h6 { font-size: 15px; }

.article-content p {
  margin-bottom: 20px;
}

.article-content a {
  color: #0066cc;
  text-decoration: none;
  border-bottom: 1px solid #e0e0e0;
  transition: all 0.2s ease;
}

.article-content a:hover {
  border-bottom-color: #0066cc;
}

.article-content ul,
.article-content ol {
  margin-left: 24px;
  margin-bottom: 20px;
}

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

.article-content blockquote {
  border-left: 4px solid #e0e0e0;
  padding: 16px 24px;
  margin: 24px 0;
  background: #f9f9f9;
  font-style: italic;
  color: #666;
}

.article-content code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 14px;
  color: #d73a49;
}

.article-content pre {
  background: #f8f8f8;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  margin: 24px 0;
  line-height: 1.5;
}

.article-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: #333;
  font-size: 14px;
}

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

/* Article navigation */
.article-navigation {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid #eee;
}

.nav-previous,
.nav-next {
  flex: 1;
}

.nav-next {
  text-align: right;
}

.nav-label {
  display: block;
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 600;
}

.article-navigation a {
  color: #0066cc;
  text-decoration: none;
  font-weight: 500;
}

.article-navigation a:hover {
  text-decoration: underline;
}

/* Footer */
.site-footer {
  border-top: 1px solid #eee;
  padding: 32px 0;
  margin-top: auto;
  text-align: center;
  color: #666;
  font-size: 14px;
}

.social-links {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.social-links a {
  color: #666;
  text-decoration: none;
  font-size: 14px;
}

.social-links a:hover {
  color: #0066cc;
}

/* Admonition styles (for !!! note blocks) */
.article-content .admonition {
  border-left: 4px solid #ddd;
  margin: 24px 0;
  padding: 0;
  background: #f8f9fa;
  border-radius: 0 4px 4px 0;
  overflow: hidden;
}

.article-content .admonition-title {
  background: #e9ecef;
  font-weight: 600;
  padding: 12px 16px;
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #dee2e6;
}

.article-content .admonition p:not(.admonition-title) {
  padding: 16px;
  margin: 0;
  background: #f8f9fa;
}

/* Specific admonition types */
.article-content .admonition.note {
  border-left-color: #0066cc;
}

.article-content .admonition.note .admonition-title {
  background: #e3f2fd;
  color: #0066cc;
}

.article-content .admonition.warning {
  border-left-color: #ff9800;
}

.article-content .admonition.warning .admonition-title {
  background: #fff3e0;
  color: #e65100;
}

.article-content .admonition.danger {
  border-left-color: #f44336;
}

.article-content .admonition.danger .admonition-title {
  background: #ffebee;
  color: #c62828;
}

.article-content .admonition.tip {
  border-left-color: #4caf50;
}

.article-content .admonition.tip .admonition-title {
  background: #e8f5e8;
  color: #2e7d32;
}

/* No posts message */
.no-posts {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.no-posts p {
  margin-bottom: 12px;
}

/* Archive, Categories, Tags, Authors page styles */
.archive-page,
.categories-page,
.tags-page,
.authors-page {
  margin-bottom: 40px;
}

.archive-page h1,
.categories-page h1,
.tags-page h1,
.authors-page h1 {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #333;
}

.archive-page > p,
.categories-page > p,
.tags-page > p,
.authors-page > p {
  color: #666;
  margin-bottom: 32px;
}

.archive-year,
.category-section,
.tag-section,
.author-section {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid #f0f0f0;
}

.archive-year:last-child,
.category-section:last-child,
.tag-section:last-child,
.author-section:last-child {
  border-bottom: none;
}

.archive-year h2,
.category-section h2,
.tag-section h2,
.author-section h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.archive-year h2 a,
.category-section h2 a,
.tag-section h2 a,
.author-section h2 a {
  color: #333;
  text-decoration: none;
}

.archive-year h2 a:hover,
.category-section h2 a:hover,
.tag-section h2 a:hover,
.author-section h2 a:hover {
  color: #0066cc;
}

.category-section > p,
.tag-section > p,
.author-section > p {
  color: #666;
  margin-bottom: 16px;
  font-size: 14px;
}

.archive-list,
.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.archive-item,
.article-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid #f8f8f8;
  gap: 16px;
}

.archive-item:last-child,
.article-list li:last-child {
  border-bottom: none;
}

.archive-item time,
.article-list time {
  font-size: 14px;
  color: #666;
  font-weight: 500;
  white-space: nowrap;
}

.archive-item a,
.article-list a {
  color: #333;
  text-decoration: none;
  flex: 1;
}

.archive-item a:hover,
.article-list a:hover {
  color: #0066cc;
}

/* Individual tag/category/author page styles */
.tag-page,
.category-page,
.author-page {
  margin-bottom: 40px;
}

.tag-page h1,
.category-page h1,
.author-page h1 {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #333;
}

.tag-page > p,
.category-page > p,
.author-page > p {
  color: #666;
  margin-bottom: 32px;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  
  .site-header {
    padding: 40px 0 32px;
  }
  
  .site-header h1 {
    font-size: 24px;
  }
  
  .site-nav {
    gap: 16px;
  }
  
  .article-header h1 {
    font-size: 28px;
  }
  
  .article-navigation {
    flex-direction: column;
    gap: 16px;
  }
  
  .nav-next {
    text-align: left;
  }
  
  .post-meta,
  .article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}