/* 基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f5f5f5;
}

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

/* 头部 */
.header {
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  color: #333;
}

.nav a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: #666;
  transition: color 0.2s;
}

.nav a:hover {
  color: #333;
}

/* 主内容 */
.main {
  min-height: calc(100vh - 140px);
  padding: 2rem 0;
}

.page-title {
  margin-bottom: 2rem;
  color: #333;
}

/* 文章列表 */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.article-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

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

.article-card .article-title a {
  color: #333;
  text-decoration: none;
}

.article-card .article-title a:hover {
  color: #0066cc;
}

.article-meta {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 0.75rem;
}

.article-date {
  margin-right: 1rem;
}

.tag {
  display: inline-block;
  margin-right: 0.5rem;
  color: #0066cc;
  text-decoration: none;
}

.tag:hover {
  text-decoration: underline;
}

.article-description {
  color: #666;
  margin-bottom: 1rem;
}

.read-more {
  color: #0066cc;
  text-decoration: none;
  font-weight: 500;
}

.read-more:hover {
  text-decoration: underline;
}

/* 文章详情 */
.article-detail {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.article-detail .article-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.article-detail .article-title {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.article-content {
  line-height: 1.8;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  margin: 2rem 0 1rem;
}

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

.article-content pre {
  background: #f6f8fa;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1rem 0;
}

.article-content code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.875em;
}

.article-content :not(pre) > code {
  background: #f6f8fa;
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

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

.article-content ul,
.article-content ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

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

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.article-content th,
.article-content td {
  border: 1px solid #ddd;
  padding: 0.5rem;
  text-align: left;
}

.article-content th {
  background: #f6f8fa;
}

.article-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.back-link {
  color: #666;
  text-decoration: none;
}

.back-link:hover {
  color: #333;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 4rem 0;
  color: #666;
}

/* 错误页 */
.error-page {
  text-align: center;
  padding: 4rem 0;
}

.error-page h1 {
  font-size: 6rem;
  color: #ddd;
}

/* 底部 */
.footer {
  background: #333;
  color: #fff;
  text-align: center;
  padding: 1.5rem 0;
}

.footer p {
  opacity: 0.8;
}

/* 响应式 */
@media (max-width: 600px) {
  .header .container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav a {
    margin: 0 0.75rem;
  }
  
  .article-detail {
    padding: 1rem;
  }
  
  .article-detail .article-title {
    font-size: 1.5rem;
  }
}
