/* 基础变量 */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --bg-color: #ffffff;
  --bg-secondary: #f9fafb;
  --border-color: #e5e7eb;
  --max-width: 800px;
  --spacing: 1.5rem;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  line-height: 1.7;
  color: var(--text-color);
  background: var(--bg-color);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing);
}

/* 头部 */
.site-header {
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  background: var(--bg-color);
  z-index: 100;
}

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

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

.site-title:hover {
  color: var(--primary-color);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--text-light);
  font-size: 0.95rem;
}

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

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

/* 文章图片样式 */
.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 首页文章列表 */
.post-list {
  list-style: none;
}

.post-item {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.post-item h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.post-item h2 a {
  color: var(--text-color);
}

.post-item h2 a:hover {
  color: var(--primary-color);
}

.post-meta {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.post-excerpt {
  color: var(--text-light);
  line-height: 1.6;
}

/* 文章页面 */
.post {
  margin-bottom: 3rem;
}

.post-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.post-tags {
  display: flex;
  gap: 0.5rem;
}

.tag {
  background: var(--bg-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  color: var(--text-light);
}

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

.post-content h1,
.post-content h2,
.post-content h3 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.post-content h1 { font-size: 1.75rem; }
.post-content h2 { font-size: 1.5rem; }
.post-content h3 { font-size: 1.25rem; }

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

.post-content ul,
.post-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

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

.post-content code {
  background: var(--bg-secondary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: "SF Mono", Monaco, "Courier New", monospace;
}

.post-content pre {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

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

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

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

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

.post-share {
  display: flex;
  gap: 1rem;
}

/* 关于页面 */
.about-content {
  line-height: 1.8;
}

.about-content h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

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

/* 页脚 */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
}

.site-footer p {
  margin-bottom: 0.5rem;
}

/* 响应式 */
@media (max-width: 640px) {
  .site-header .container {
    flex-direction: column;
    gap: 1rem;
  }

  .site-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .post-title {
    font-size: 1.5rem;
  }

  .post-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* 代码高亮 */
.highlight {
  background: #f6f8fa;
  border-radius: 8px;
}

.highlight pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
}

/* 表格 */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.post-content th,
.post-content td {
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  text-align: left;
}

.post-content th {
  background: var(--bg-secondary);
  font-weight: 600;
}

/* 动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.post-item {
  animation: fadeIn 0.5s ease-out;
}
