/* 基础重置和变量 */
:root {
  --bg: #faf8f5;
  --fg: #1a1a2e;
  --accent: #e85d3a; /* 主色调：橘红 */
  --muted: #6b6b7b;
  --border: #ddd;
  --max-width: 780px;
}

/* 全局样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.75;
  padding-top: 80px; /* 留出固定 header 空间 */
}

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

/* Header 和导航 */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  padding: 12px 0;
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-title {
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
  color: var(--fg);
}
.site-title:hover {
  color: var(--accent);
}
.site-nav a {
  margin-left: 14px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.site-nav a:hover, .site-nav a.active {
  color: var(--accent);
  font-weight: 600;
}

/* 主内容区 */
main {
  padding-top: 20px;
  padding-bottom: 60px;
}

/* 英雄区 (首页) */
.hero {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 60px 0 40px;
  border-bottom: 1px solid var(--border);
}
.hero-text {
  flex: 1;
}
.hero-visual {
  flex-shrink: 0;
}
.hero-visual img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.hero-kicker {
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 8px;
}
.hero h1 {
  font-size: 38px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 18px;
}
.hero .lead {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 24px;
}
.hero-actions .btn {
  margin-right: 12px;
}

/* 通用按钮样式 */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 15px;
  transition: background 0.2s;
}
.btn:hover {
  background: #c44e32;
}
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-ghost:hover {
  background: rgba(232, 93, 58, 0.1);
}

/* 文章布局 (Post Layout) */
.article {
  padding-top: 20px;
}
.article-header {
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}
.article-meta {
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--muted);
}
.article-meta .dot { margin: 0 8px; }
.article-header h1 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 10px;
}
.article-desc {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 20px;
}
.article-hero img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 20px 0;
}
.article-body h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 40px 0 20px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--accent);
}
.article-body h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 30px 0 15px;
}
.article-tags {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.tags-label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}
.tag {
  display: inline-block;
  background: #f0f0f0;
  color: var(--fg);
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-right: 8px;
  margin-bottom: 8px;
  text-decoration: none;
}

/* TOC 目录 */
.toc {
  margin: 30px 0 40px;
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 8px;
}
.toc-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}
.toc-body ol {
  list-style: none;
}
.toc-body li {
  margin: 8px 0;
}
.toc-h2 a {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
}
.toc-h3 a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}

/* 页面导航 (面包屑, 上下一篇) */
.breadcrumb {
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--muted);
}
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}
.post-pager {
  display: flex;
  justify-content: space-between;
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.pager-prev, .pager-next {
  padding: 10px 15px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--accent);
  transition: background 0.2s;
}
.pager-prev:hover, .pager-next:hover {
  background: rgba(232, 93, 58, 0.1);
}

/* 列表页/分类页 */
.page-hero {
  padding: 40px 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
}
.page-hero h1 {
  font-size: 32px;
  margin: 10px 0;
}
.page-hero p {
  color: var(--muted);
}

.post-list {
  margin-top: 30px;
}
.post-row {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.post-row:last-child {
  border-bottom: none;
}
.row-img {
  flex-shrink: 0;
  width: 300px;
  max-height: 180px;
  overflow: hidden;
  border-radius: 8px;
}
.row-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.row-body {
  flex-grow: 1;
}
.row-meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 5px;
}
.row-body h2 {
  font-size: 22px;
  margin-bottom: 8px;
  border-bottom: none;
}
.row-body h2 a {
  color: var(--fg);
  text-decoration: none;
}
.row-body h2 a:hover {
  color: var(--accent);
}
.row-body p {
  color: var(--muted);
}

/* 首页 特性区 */
.feature-strip {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 0;
  margin-bottom: 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.feature-item {
  flex: 1;
  padding: 15px;
  border: 1px solid #eee;
  border-radius: 8px;
  transition: all 0.3s;
}
.feature-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: var(--accent);
}
.feature-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 10px;
}
.feature-item h3 {
  font-size: 18px;
  margin-bottom: 5px;
}
.feature-item p {
  font-size: 14px;
  color: var(--muted);
}

/* 首页 卡片网格 */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 30px;
}
.post-card {
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s;
}
.post-card:hover {
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.card-img {
  overflow: hidden;
  height: 200px;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.post-card:hover .card-img img {
  transform: scale(1.05);
}
.card-body {
  padding: 15px;
}
.card-body time {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}
.card-cat {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}
.card-body h3 {
  font-size: 18px;
  margin-top: 5px;
  margin-bottom: 8px;
}
.card-body h3 a {
  color: var(--fg);
  text-decoration: none;
}
.card-body h3 a:hover {
  color: var(--accent);
}
.card-body p {
  font-size: 14px;
  color: var(--muted);
}

/* 分类导航 */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.cat-grid-large {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 15px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  text-decoration: none;
  color: var(--fg);
  transition: all 0.3s;
}
.cat-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--accent);
  transform: translateY(-3px);
}
.cat-name {
  display: block;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 5px;
}
.cat-count {
  font-size: 14px;
  color: var(--muted);
}

/* FAQ */
.faq {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}
.faq-list details {
  background: #fff;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid #eee;
}
.faq-list summary {
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none; /* 隐藏默认三角 */
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: '+';
  float: right;
  transition: transform 0.2s;
}
.faq-list details[open] summary::after {
  content: '−';
}
.faq-list details p {
  padding: 15px 20px;
  color: var(--muted);
}

/* 页脚 */
.site-footer {
  margin-top: 48px;
  padding: 24px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.footer-note {
  margin-top: 8px;
  font-size: 12px;
}

/* 响应式调整 */
@media (max-width: 992px) {
  .hero {
    flex-direction: column;
    text-align: center;
  }
  .hero-visual {
    order: -1;
    margin-bottom: 30px;
  }
  .hero h1 {
    font-size: 30px;
  }
  .post-row {
    flex-direction: column;
  }
  .row-img {
    width: 100%;
    max-height: none;
  }
  .site-header .container {
    flex-direction: column;
    text-align: center;
  }
  .site-nav {
    margin-top: 10px;
  }
  .site-nav a {
    margin: 0 8px;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 40px 0 30px;
  }
  .hero h1 {
    font-size: 24px;
  }
  .hero-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .btn {
    width: 100%;
  }
  .post-grid, .cat-grid {
    grid-template-columns: 1fr;
  }
  .post-row {
    padding: 15px 0;
  }
}