/* ============================================================
   知行录 · 生活与学习知识博客
   简洁、清爽、专注阅读的博客主题
   ============================================================ */

:root {
  --primary: #2f5d8c;          /* 主色：沉稳蓝 */
  --primary-dark: #244a72;
  --accent: #d98e2b;           /* 强调色：暖金 */
  --text: #2b2f36;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --border: #e5e9f0;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(47, 93, 140, 0.08);
  --shadow-hover: 0 6px 24px rgba(47, 93, 140, 0.14);
  --font-body: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

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

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

img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
}

.logo span { color: var(--primary); }

.nav-list {
  display: flex;
  list-style: none;
  gap: 28px;
}

.nav-list a {
  color: var(--text-light);
  font-size: 15px;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--primary);
  border-bottom-color: var(--accent);
}

/* ---------------- Hero 区 ---------------- */
.hero {
  background: linear-gradient(135deg, #f0f5fb 0%, #e8f0f9 100%);
  padding: 72px 0 64px;
  text-align: center;
}

.hero h1 {
  font-size: 40px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.hero h1 span { color: var(--primary); }

.hero p {
  font-size: 17px;
  color: var(--text-light);
  max-width: 640px;
  margin: 0 auto 28px;
}

.hero .tags {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero .tag {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 14px;
  color: var(--primary);
  box-shadow: var(--shadow);
}

/* ---------------- 文章列表 ---------------- */
.section-title {
  font-size: 26px;
  font-weight: 700;
  margin: 56px 0 8px;
  position: relative;
  padding-left: 14px;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 4px;
  border-radius: 2px;
  background: var(--accent);
}

.section-sub {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 28px;
  padding-left: 14px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.post-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.post-meta {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.post-meta .cat {
  background: var(--bg-soft);
  color: var(--primary);
  border-radius: 4px;
  padding: 2px 10px;
  font-size: 12px;
}

.post-card h3 {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 10px;
}

.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--primary); }

.post-card p {
  font-size: 14.5px;
  color: var(--text-light);
  flex: 1;
}

.post-card .read-more {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
}

/* ---------------- 关于简介 ---------------- */
.about-strip {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin: 48px 0;
  display: flex;
  gap: 28px;
  align-items: center;
}

.about-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7aa5cf);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 700;
  flex-shrink: 0;
}

.about-strip h3 { font-size: 20px; margin-bottom: 6px; }
.about-strip p { color: var(--text-light); font-size: 15px; }
.about-strip a { font-weight: 500; }

/* ---------------- 页脚 ---------------- */
.site-footer {
  background: #f0f3f8;
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 40px 0 28px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 28px;
}

.footer-inner h4 {
  font-size: 15px;
  margin-bottom: 14px;
  color: var(--text);
}

.footer-inner p,
.footer-inner li {
  font-size: 14px;
  color: var(--text-light);
}

.footer-inner ul { list-style: none; }
.footer-inner ul li { margin-bottom: 8px; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
  line-height: 2;
}

.footer-bottom a { color: var(--text-light); }
.footer-bottom a:hover { color: var(--primary); }

/* ---------------- 文章详情页 ---------------- */
.post-hero {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 48px 0;
}

.post-hero .container { max-width: 800px; }

.post-hero h1 {
  font-size: 32px;
  line-height: 1.4;
  margin: 14px 0 12px;
}

.post-hero .post-meta { font-size: 14px; }

.post-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 44px 24px 60px;
}

.post-body h2 {
  font-size: 24px;
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.post-body h3 { font-size: 19px; margin: 28px 0 10px; }

.post-body p { margin-bottom: 18px; }

.post-body ul,
.post-body ol { margin: 0 0 20px 24px; }
.post-body li { margin-bottom: 8px; }

.post-body blockquote {
  border-left: 4px solid var(--accent);
  background: var(--bg-soft);
  padding: 14px 20px;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
  color: var(--text-light);
}

.post-body code {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 14px;
  font-family: "Consolas", "Courier New", monospace;
}

.post-nav {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 20px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 14px;
}

.post-nav a {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  max-width: 46%;
}

/* ---------------- 关于页 ---------------- */
.page-hero {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 56px 0;
  text-align: center;
}

.page-hero h1 { font-size: 34px; margin-bottom: 10px; }
.page-hero p { color: var(--text-light); }

.page-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px;
}

.page-body h2 {
  font-size: 22px;
  margin: 34px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.page-body p { margin-bottom: 16px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 768px) {
  .hero h1 { font-size: 30px; }
  .post-grid { grid-template-columns: 1fr; }
  .about-strip { flex-direction: column; text-align: center; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .header-inner { flex-direction: column; height: auto; padding: 14px 0; gap: 10px; }
  .nav-list { gap: 18px; }
  .post-hero h1 { font-size: 26px; }
}
