/* 基础样式 */
:root {
  --primary-color: #3490dc;
  --secondary-color: #38b2ac;
  --dark-color: #2d3748;
  --light-color: #f7fafc;
  --gray-color: #a0aec0;
  --border-color: #e2e8f0;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Enable smooth scrolling for anchor and JS scrolls */
html { scroll-behavior: smooth; }

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

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--dark-color);
  background-color: #fff;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* 导航样式 */
.site-nav {
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000; /* Keep header above page content */
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li {
  margin-left: 1.5rem;
}

.nav-links a {
  color: var(--dark-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--primary-color);
}

/* 主要内容样式 */
main {
  padding: 2rem 0;
}

/* 文章列表样式 */
.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.post-card {
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.post-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-card-content {
  padding: 1.5rem;
}

.post-card-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.post-card-title a {
  color: var(--dark-color);
  text-decoration: none;
}

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

.post-card-excerpt {
  color: var(--dark-color);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.post-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--gray-color);
}

/* 文章页面样式 */
.post {
  max-width: 800px;
  margin: 0 auto;
}

.post-header {
  margin-bottom: 2rem;
}

.post-title {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.post-meta {
  display: flex;
  align-items: center;
  color: var(--gray-color);
  font-size: 0.9rem;
}

.post-tags {
  margin-left: 1rem;
}

.post-tag {
  background-color: var(--light-color);
  color: var(--dark-color);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  text-decoration: none;
  font-size: 0.8rem;
  margin-right: 0.5rem;
}

.post-content {
  font-size: 1.1rem;
  line-height: 1.8;
}

.post-content h2 {
  font-size: 1.8rem;
  margin: 2rem 0 1rem;
}

.post-content h3 {
  font-size: 1.4rem;
  margin: 1.5rem 0 0.75rem;
}

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

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1.5rem auto;
  display: block;
}

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

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--gray-color);
}

.related-posts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.related-posts h3 {
  margin-bottom: 1rem;
}

.related-posts ul {
  list-style: none;
}

.related-posts li {
  margin-bottom: 0.5rem;
}

.related-posts a {
  color: var(--primary-color);
  text-decoration: none;
}

/* 页脚样式 */
footer {
  background-color: var(--light-color);
  padding: 2rem 0;
  text-align: center;
  color: var(--gray-color);
  font-size: 0.9rem;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  border: none;
  background: var(--primary-color);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease-in-out, transform .2s ease-in-out;
  transform: translateY(8px);
}

.back-to-top:hover { background: #2779bd; }

.back-to-top--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .nav-links {
    margin-top: 1rem;
    flex-wrap: wrap;
  }
  
  .nav-links li {
    margin-left: 0;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
  }
  
  .post-title {
    font-size: 2rem;
  }
} 