/* 基础样式 - 简约风格 */
* { 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;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* 头部 */
.header {
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-size: 1.5em;
  font-weight: bold;
  color: #1e40af;
}

.logo:hover { text-decoration: none; }

.nav a {
  margin-left: 20px;
  color: #666;
}

.nav a:hover { color: #2563eb; }

/* 主体 */
.main { padding: 40px 0; min-height: calc(100vh - 200px); }

.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
}

/* 文章卡片 */
.post-card {
  background: white;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.post-title {
  font-size: 1.5em;
  margin-bottom: 10px;
}

.post-title a { color: #1e293b; }
.post-title a:hover { color: #2563eb; }

.post-meta {
  color: #64748b;
  font-size: 0.9em;
  margin-bottom: 15px;
}

.post-meta span { margin-right: 15px; }

.post-summary {
  color: #475569;
  margin-bottom: 15px;
}

.read-more {
  color: #2563eb;
  font-weight: 500;
}

/* 侧边栏 */
.sidebar .widget {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.widget h3 {
  margin-bottom: 15px;
  color: #1e293b;
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  background: #e0e7ff;
  color: #3730a3;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85em;
}

.tag:hover {
  background: #3730a3;
  color: white;
  text-decoration: none;
}

/* 文章详情 */
.post-detail {
  background: white;
  border-radius: 8px;
  padding: 40px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.post-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}

.post-header h1 {
  font-size: 2em;
  margin-bottom: 15px;
  color: #1e293b;
}

.post-tags { margin-top: 15px; }
.post-tags .tag { margin-right: 8px; }

.post-content {
  font-size: 1.05em;
  line-height: 1.8;
  color: #334155;
}

.post-content h1, .post-content h2, .post-content h3 {
  margin: 30px 0 15px;
  color: #1e293b;
}

.post-content p { margin-bottom: 15px; }
.post-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 20px 0;
}

.post-content code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

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

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 20px 0;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.post-nav a {
  color: #64748b;
  max-width: 45%;
}

.post-nav a:hover { color: #2563eb; }

/* 评论 */
.comments-section {
  background: white;
  border-radius: 8px;
  padding: 30px;
  margin-top: 30px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.comments-section h2 {
  margin-bottom: 20px;
  color: #1e293b;
}

.comment-form { margin-bottom: 30px; }

.form-group { margin-bottom: 15px; }

.form-control {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1em;
}

.form-control:focus {
  outline: none;
  border-color: #2563eb;
}

textarea.form-control { resize: vertical; min-height: 100px; }

.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.2s;
}

.btn-primary {
  background: #2563eb;
  color: white;
}

.btn-primary:hover {
  background: #1d4ed8;
  text-decoration: none;
}

.comments-list .comment {
  padding: 20px 0;
  border-bottom: 1px solid #e2e8f0;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.comment-author { font-weight: 600; color: #1e293b; }
.comment-date { color: #64748b; font-size: 0.9em; }

.comment-content { color: #475569; }

.comment-replies {
  margin-left: 40px;
  margin-top: 15px;
  padding-left: 15px;
  border-left: 2px solid #e0e7ff;
}

/* 搜索页 */
.search-form {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

.search-form input { flex: 1; }

/* 页脚 */
.footer {
  background: #1e293b;
  color: #94a3b8;
  padding: 30px 0;
  text-align: center;
}

/* 响应式 */
@media (max-width: 768px) {
  .content-wrapper { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .post-detail { padding: 25px; }
  .post-header h1 { font-size: 1.5em; }
}

/* 工具类 */
.page-title {
  font-size: 1.8em;
  margin-bottom: 25px;
  color: #1e293b;
}

.no-posts, .no-results, .no-comments {
  text-align: center;
  color: #64748b;
  padding: 40px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
}

.pagination a {
  color: #2563eb;
  padding: 8px 16px;
  border: 1px solid #2563eb;
  border-radius: 6px;
}

.pagination a:hover {
  background: #2563eb;
  color: white;
  text-decoration: none;
}

/* 错误页 */
.error-page {
  text-align: center;
  padding: 60px 20px;
}

.error-page h1 {
  font-size: 6em;
  color: #2563eb;
  margin-bottom: 20px;
}

.error-message {
  font-size: 1.5em;
  color: #1e293b;
  margin-bottom: 10px;
}

.error-hint {
  color: #64748b;
  margin-bottom: 30px;
}
