/* ==========================================================================
   文集 · 样式表
   设计方向：线装书、宋体、留白、无装饰、纯粹阅读
   ========================================================================== */

/* ---------- 基础重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  /* 字体：优先系统里的"好看宋体"，退回到通用 serif */
  font-family:
    "Songti SC",          /* macOS */
    "STSong",             /* macOS 旧 */
    "Source Han Serif SC","Source Han Serif CN","思源宋体",
    "Noto Serif SC",
    "SimSun", "宋体",      /* Windows */
    "Hiragino Mincho ProN", "MS Mincho",
    Georgia, "Times New Roman", serif;

  color: #1a1a1a;
  background: #f5f1e8;   /* 米白，像旧纸 */
  line-height: 1.85;
  letter-spacing: 0.02em;

  min-height: 100vh;
  display: flex;
  flex-direction: column;

  /* 诗歌友好：全局禁用首行缩进，需要的地方单独处理 */
  text-indent: 0;
}

/* ---------- 链接 ---------- */
a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

a:hover {
  border-bottom-color: #1a1a1a;
}

a:focus-visible {
  outline: 1px dashed #1a1a1a;
  outline-offset: 3px;
}

/* ---------- 主容器 ---------- */
.page {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 4rem 2rem 3rem;
  flex: 1 0 auto;
}

/* ---------- 文章（首页 & 单篇共用） ---------- */
.article {
  margin-bottom: 4rem;
}

.article__title {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  letter-spacing: 0.03em;
}

.article__title a:hover {
  border-bottom-color: transparent;
  color: #555;
}

.article__meta {
  font-size: 0.875rem;
  color: #6b6b6b;
  margin-bottom: 2.5rem;
  letter-spacing: 0.05em;
}

.article__meta .sep {
  margin: 0 0.5em;
  color: #999;
}

.article__body {
  font-size: 1.0625rem;
  line-height: 2;
}

.article__body p {
  margin-bottom: 1.25rem;
  text-indent: 0;
}

/* 诗歌、引用块：更宽松 */
.article__body .poem {
  margin: 2rem 0;
  padding-left: 1rem;
  line-height: 2.1;
}

.article__body blockquote {
  margin: 2rem 1.5rem;
  padding-left: 1rem;
  border-left: 1px solid #999;
  color: #4a4a4a;
}

.article__body h2,
.article__body h3 {
  font-weight: 600;
  margin: 2rem 0 1rem;
  letter-spacing: 0.05em;
}

.article__body h2 { font-size: 1.25rem; }
.article__body h3 { font-size: 1.1rem; }

.article__body em { font-style: italic; }
.article__body strong { font-weight: 600; }

.article__time {
  text-align: right;
  font-size: 0.875rem;
  color: #6b6b6b;
  margin-top: 3rem;
  letter-spacing: 0.05em;
}

/* ---------- 文章间导航（单篇） ---------- */
.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #c9c0ad;
  font-size: 0.9375rem;
}

.article-nav a {
  max-width: 45%;
  color: #4a4a4a;
}

.article-nav .prev::before { content: "← "; }
.article-nav .next::after { content: " →"; }
.article-nav .next { text-align: right; }

/* ---------- 分类 / 总目录 / 搜索：列表 ---------- */
.list-page {
  padding-top: 3rem;
}

.list-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #c9c0ad;
}

/* 文章列表项 */
.entry-list {
  list-style: none;
  margin-bottom: 3rem;
}

.entry-list li {
  display: flex;
  align-items: baseline;
  padding: 0.6rem 0;
  font-size: 1rem;
  border-bottom: 1px dotted #d4c9b0;
}

.entry-list li:last-child { border-bottom: none; }

.entry-list .date {
  color: #999;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  margin-right: 1.25rem;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  /* 使用西文字体让数字整齐 */
  font-family: "Georgia", "Times New Roman", serif;
}

.entry-list .title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-list .title a:hover { color: #555; }

/* ---------- 分类目录（带省略号对齐） ---------- */
.toc {
  list-style: none;
  margin: 2rem 0 3rem;
}

.toc li {
  display: flex;
  align-items: baseline;
  padding: 0.75rem 0;
  font-size: 1.0625rem;
  letter-spacing: 0.08em;
}

.toc .cat-name { white-space: nowrap; }

.toc .dots {
  flex: 1;
  margin: 0 0.5rem;
  border-bottom: 1px dotted #a89b7d;
  transform: translateY(-4px);
}

.toc .cat-count {
  color: #6b6b6b;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  font-family: "Georgia", serif;
}

.toc-footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #c9c0ad;
  letter-spacing: 0.15em;
  font-size: 1rem;
}

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2rem 0;
  font-size: 0.9375rem;
  color: #4a4a4a;
  letter-spacing: 0.05em;
}

.pagination .prev,
.pagination .next {
  min-width: 5em;
}

.pagination .next { text-align: right; }

.pagination .disabled {
  color: #bbb;
  cursor: default;
  pointer-events: none;
}

.page-jump {
  text-align: center;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
  color: #6b6b6b;
  letter-spacing: 0.05em;
}

.page-jump input {
  width: 3em;
  padding: 0.15rem 0.35rem;
  margin: 0 0.3rem;
  font-family: "Georgia", serif;
  font-size: 0.9375rem;
  text-align: center;
  border: none;
  border-bottom: 1px solid #666;
  background: transparent;
  color: inherit;
}

.page-jump input:focus {
  outline: none;
  border-bottom-color: #1a1a1a;
}

/* ---------- 搜索 ---------- */
.search-box {
  text-align: center;
  margin: 2rem 0 3rem;
  font-size: 1.125rem;
  letter-spacing: 0.1em;
}

.search-box .bracket {
  color: #6b6b6b;
}

.search-box input {
  width: 10em;
  margin: 0 0.5rem;
  padding: 0.25rem 0.5rem;
  border: none;
  border-bottom: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 1.125rem;
  color: inherit;
  text-align: center;
  letter-spacing: 0.1em;
}

.search-box input:focus {
  outline: none;
  border-bottom-color: #1a1a1a;
}

.search-box button {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0.15em;
  color: inherit;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.search-box button:hover {
  border-bottom-color: #1a1a1a;
}

.search-empty {
  text-align: center;
  color: #6b6b6b;
  font-size: 1rem;
  margin: 3rem 0;
  letter-spacing: 0.15em;
}

/* ---------- 页脚 ---------- */
.footer {
  flex-shrink: 0;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
  text-align: center;
  font-size: 0.875rem;
  color: #4a4a4a;
  letter-spacing: 0.1em;
}

.footer .nav-line {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-top: 1px solid #c9c0ad;
  padding-top: 2rem;
  font-size: 0.9375rem;
  letter-spacing: 0.2em;
}

.footer .nav-line .sep {
  margin: 0 0.75em;
  color: #a89b7d;
}

.footer .site-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  margin-bottom: 0.4rem;
}

.footer .site-subtitle {
  font-size: 0.875rem;
  color: #6b6b6b;
  margin-bottom: 1.25rem;
  letter-spacing: 0.15em;
}

.footer .copyright {
  font-size: 0.8125rem;
  color: #6b6b6b;
  margin-bottom: 0.5rem;
  letter-spacing: 0.1em;
}

.footer .copyright .sep {
  margin: 0 0.4em;
  color: #a89b7d;
}

.footer .counter {
  font-size: 0.75rem;
  color: #999;
  font-family: "Georgia", serif;
  letter-spacing: 0.15em;
}

/* ---------- 二维码页 ---------- */
.qr-page {
  text-align: center;
  padding: 4rem 2rem;
}

.qr-page h1 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  margin-bottom: 0.5rem;
}

.qr-page .hint {
  font-size: 0.9375rem;
  color: #6b6b6b;
  letter-spacing: 0.15em;
  margin-bottom: 3rem;
}

.qr-frame {
  display: inline-block;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #c9c0ad;
  margin-bottom: 2rem;
}

.qr-frame img {
  display: block;
  width: 240px;
  height: 240px;
  max-width: 100%;
}

.qr-page .account-name {
  font-size: 1rem;
  letter-spacing: 0.25em;
  margin-bottom: 0.5rem;
}

.qr-page .account-note {
  font-size: 0.875rem;
  color: #6b6b6b;
  letter-spacing: 0.15em;
  margin-bottom: 3rem;
}

.qr-page .back {
  font-size: 0.9375rem;
  letter-spacing: 0.2em;
  color: #4a4a4a;
}

.article__body img {
    max-width: 100% !important;
    height: auto !important;
}

.article__body .wp-caption {
    max-width: 100% !important;
    width: auto !important;
}

/* ---------- 响应式：手机 ---------- */
@media (max-width: 640px) {
  html { font-size: 16px; }

  .page {
    padding: 2.5rem 1.25rem 2rem;
  }

  .article__title {
    font-size: 1.375rem;
  }

  .article__body {
    font-size: 1rem;
    line-height: 1.95;
  }

  .list-title {
    font-size: 1.125rem;
  }

  .entry-list li {
    font-size: 0.9375rem;
    padding: 0.55rem 0;
  }

  .entry-list .date {
    font-size: 0.8125rem;
    margin-right: 0.9rem;
  }

  .toc li {
    font-size: 1rem;
  }

  .footer {
    padding: 1.5rem 1.25rem 2.5rem;
  }

  .footer .nav-line .sep {
    margin: 0 0.5em;
  }

  .pagination {
    font-size: 0.875rem;
  }

  .qr-frame img {
    width: 220px;
    height: 220px;
  }
}

/* ---------- 更小屏：避免列表横向溢出 ---------- */
@media (max-width: 380px) {
  .article__meta {
    font-size: 0.8125rem;
  }
  .footer .nav-line {
    letter-spacing: 0.15em;
  }
}

/* ---------- 打印：真的像一本书 ---------- */
@media print {
  body { background: #fff; color: #000; }
  .footer .nav-line, .pagination, .page-jump, .article-nav { display: none; }
}
