/* Harness 工程学习笔记 - 全局样式 */

:root {
  --bg: #ffffff;
  --bg-secondary: #f8f9fa;
  --text: #1a1a2e;
  --text-secondary: #555;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e5e7eb;
  --radius: 8px;
  --max-width: 720px;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', 'Monaco', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* 导航栏 */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
}

.site-header .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
}

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

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  margin-left: 1.5rem;
  transition: color 0.15s;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
}

/* 主内容区 */
.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1rem 4rem;
}

/* 首页 - 站点头部 */
.hero {
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.hero .tagline {
  color: var(--text-secondary);
  font-size: 1rem;
}

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

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

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

.post-date {
  font-size: 0.82rem;
  color: #999;
  margin-bottom: 0.25rem;
}

.post-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.post-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

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

.post-excerpt {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* 文章详情页 */
.article-header {
  margin-bottom: 2rem;
}

.article-header h1 {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.article-meta {
  color: #999;
  font-size: 0.85rem;
}

.article-body h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  padding-top: 0.5rem;
}

.article-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

.article-body p {
  margin-bottom: 1rem;
  color: #333;
}

.article-body ul,
.article-body ol {
  margin: 0.75rem 0 1rem 1.25rem;
}

.article-body li {
  margin-bottom: 0.4rem;
  color: #333;
}

.article-body code {
  font-family: var(--font-mono);
  background: #f1f5f9;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.88em;
  color: #1e293b;
}

.article-body pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  background: #f0f4ff;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #444;
}

.back-link {
  display: inline-block;
  margin-top: 2.5rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  text-decoration: underline;
}

/* 关于页面 */
.about-section {
  margin-bottom: 2rem;
}

.about-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.about-section p {
  color: #333;
  margin-bottom: 0.75rem;
}

/* 页脚 */
.site-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.5rem 1rem;
  color: #aaa;
  font-size: 0.8rem;
}

/* 响应式 */
@media (max-width: 600px) {
  .site-main {
    padding: 2rem 1rem 3rem;
  }

  .hero h1 {
    font-size: 1.45rem;
  }

  .article-header h1 {
    font-size: 1.4rem;
  }

  .site-header .inner {
    height: 48px;
  }
}
