/* ===== keyt.srwz.net 个人博客样式 ===== */
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #2b2f36;
  --muted: #8a919c;
  --accent: #2563eb;
  --border: #e5e7eb;
  --code-bg: #1e2430;
  --code-text: #e6edf3;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 16px;
}

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

/* ===== 顶部导航 ===== */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.site-title {
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.5px;
}
.site-title:hover { opacity: 0.85; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  margin-left: 22px;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s;
}
.site-nav a:hover { color: var(--text); }
.site-nav a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ===== 首页 Hero ===== */
.hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 32px;
  margin: 28px 0 36px;
  border-left: 4px solid var(--accent);
}
.hero h1 { font-size: 26px; margin-bottom: 12px; }
.hero p { color: var(--muted); max-width: 620px; }

/* ===== 文章列表 ===== */
.section-title {
  font-size: 20px;
  margin: 32px 0 18px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}
.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 26px;
  margin-bottom: 18px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.post-card:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07); transform: translateY(-1px); }
.post-card h2 { font-size: 18px; margin-bottom: 6px; }
.post-card h2 a { color: var(--text); text-decoration: none; }
.post-card h2 a:hover { color: var(--accent); }
.post-meta { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.post-excerpt { font-size: 14.5px; color: #5b6470; }

/* ===== 文章页 ===== */
.post {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 38px;
  margin: 28px 0;
}
.post-header { border-bottom: 1px solid var(--border); padding-bottom: 18px; margin-bottom: 24px; }
.post-header h1 { font-size: 24px; line-height: 1.5; margin-bottom: 10px; }
.post-body h2 {
  font-size: 20px;
  margin: 30px 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}
.post-body p { margin: 0 0 16px; }
.post-body ul, .post-body ol { margin: 0 0 16px; padding-left: 26px; }
.post-body li { margin-bottom: 6px; }
.post-body code {
  background: #eef1f5;
  color: #b45309;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
  word-break: break-all;
}
.post-body pre {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 8px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.7;
}
.post-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}
.post-nav {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--border);
  margin-top: 30px;
  padding-top: 18px;
}
.pn-link { color: var(--accent); text-decoration: none; font-size: 14.5px; }
.pn-link:hover { text-decoration: underline; }

/* ===== 归档页 ===== */
.archive-list { list-style: none; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 18px 24px; margin-bottom: 22px; }
.archive-list li { padding: 9px 0; border-bottom: 1px dashed var(--border); }
.archive-list li:last-child { border-bottom: none; }
.archive-date { color: var(--muted); font-family: Consolas, monospace; font-size: 13.5px; margin-right: 14px; }
.archive-list a { color: var(--text); text-decoration: none; }
.archive-list a:hover { color: var(--accent); }

/* ===== 关于页 ===== */
.about-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 38px;
  margin: 28px 0;
}
.about-card h2 { font-size: 20px; margin: 26px 0 12px; padding-left: 12px; border-left: 4px solid var(--accent); }
.about-card h2:first-child { margin-top: 0; }
.about-card p { margin-bottom: 14px; }

/* ===== 404 ===== */
.error-card { text-align: center; padding: 90px 20px; }
.error-card h1 { font-size: 60px; color: var(--accent); margin-bottom: 10px; }
.error-card a { color: var(--accent); }

/* ===== 页脚 ===== */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 26px 0 34px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  background: var(--card);
}
.site-footer p { margin-bottom: 4px; }

/* ===== 响应式 ===== */
@media (max-width: 600px) {
  .site-header .container { height: auto; flex-direction: column; padding: 14px 20px; gap: 10px; }
  .site-nav a { margin: 0 10px; }
  .post, .about-card { padding: 24px 20px; }
  .hero { padding: 26px 22px; }
}
