/* ===== 蔡梓溢的生活随笔 - 主样式表 ===== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: #fefff5;
  color: #333;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC",
               "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 70px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #fefff5;
  border-bottom: 1px solid #e8e4d8;
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .site-title {
  font-family: "SimSun", "宋体", "Noto Serif CJK SC", serif;
  font-size: 1.3rem;
  font-weight: bold;
  color: #4a3f2b;
  text-decoration: none;
  letter-spacing: 2px;
}

.site-header .site-nav {
}

.main-container {
  width: 100%;
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  flex: 1;
  display: flex;
  gap: 2rem;
}

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

.content-sidebar {
  width: 240px;
  flex-shrink: 0;
}

.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: #4a3f2b;
  color: #ccc;
  font-size: 0.8rem;
  text-align: center;
  padding: 12px 1rem;
  line-height: 1.6;
}

.site-footer a {
  color: #c4b896;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

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

.post-list-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid #e8e4d8;
}

.post-list-item:first-child {
  padding-top: 0;
}

.post-list-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.post-list-title a {
  color: #4a3f2b;
  text-decoration: none;
}

.post-list-title a:hover {
  color: #8b7355;
}

.post-list-date {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 0.5rem;
}

.post-list-excerpt {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.7;
}

.blog-post {
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.blog-post h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: #4a3f2b;
}

.blog-post .post-meta {
  color: #999;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e8e4d8;
}

.blog-post .post-content h2 {
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  color: #4a3f2b;
}

.blog-post .post-content h3 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
}

.blog-post .post-content p {
  margin-bottom: 1rem;
}

.blog-post .post-content blockquote {
  border-left: 4px solid #c4b896;
  padding-left: 1rem;
  color: #666;
  margin: 1rem 0;
}

.blog-post .post-content pre {
  background-color: #f5f2e8;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1rem 0;
}

.blog-post .post-content code {
  background-color: #f5f2e8;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

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

.blog-post .post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.blog-post .post-content ul,
.blog-post .post-content ol {
  margin: 0.5rem 0 1rem 1.5rem;
}

@media (max-width: 960px) {
  .content-sidebar {
    display: none;
  }
}

@media (max-width: 600px) {
  .main-container {
    padding: 0 1rem;
  }
  .site-header {
    padding: 0 1rem;
  }
  .site-header .site-title {
    font-size: 1.1rem;
  }
  .site-footer {
    font-size: 0.7rem;
    padding: 8px 0.5rem;
  }
}

@media print {
  body {
    padding-bottom: 0;
  }
  .site-footer {
    position: static;
  }
}
