/* 我的 AI 编程分享 - 站点样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #6b7280;
  --border: #e5e7eb;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶部导航 */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.brand span {
  color: var(--accent);
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 20px;
  font-size: 15px;
}

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

/* 主体 */
main {
  flex: 1;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px;
}

.hero {
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 30px;
  margin-bottom: 12px;
}

.hero p {
  color: var(--muted);
  font-size: 16px;
}

/* 文章卡片列表 */
.section-title {
  font-size: 18px;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.article-list {
  list-style: none;
  display: grid;
  gap: 16px;
}

.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
  transition: box-shadow 0.15s, transform 0.15s;
}

.article-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.article-card a {
  color: var(--text);
  text-decoration: none;
}

.article-card h3 {
  font-size: 17px;
  margin-bottom: 6px;
}

.article-card h3 a:hover {
  color: var(--accent);
}

.article-card .meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.article-card .excerpt {
  color: var(--muted);
  font-size: 14px;
}

/* 文章正文 */
.article-body {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
}

.article-body h1 {
  font-size: 26px;
  margin-bottom: 8px;
}

.article-body .meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.article-body h2 {
  font-size: 19px;
  margin: 26px 0 10px;
}

.article-body p {
  margin-bottom: 14px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 14px 22px;
}

.article-body li {
  margin-bottom: 6px;
}

.article-body code {
  background: #f0f2f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13.5px;
}

.article-body pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
}

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

.back-link {
  display: inline-block;
  margin-top: 24px;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}

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

/* 页脚 - 备案号 */
.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 22px 20px;
  font-size: 14px;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 24px;
  }
  main {
    padding: 28px 16px;
  }
  .article-body {
    padding: 22px;
  }
}
