:root {
  --paper: #f7f5f0;
  --ink: #1f1d1a;
  --ink-soft: #6b6459;
  --accent: #b0432a;
  --card: #fffdf9;
  --line: rgba(31, 29, 26, 0.08);
}

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

/* hidden 属性必须压过组件自身的 display 规则（如 #loadMore） */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

.wrap { max-width: 680px; margin: 0 auto; padding: 0 20px; }

/* 头部 */
.site-head { padding: 44px 0 8px; text-align: center; }
.site-head-inner h1 {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 26px; letter-spacing: 2px; font-weight: 700;
}
.site-head-inner h1::after {
  content: ""; display: block; width: 36px; height: 3px;
  background: var(--accent); margin: 12px auto 0; border-radius: 2px;
}
.site-tag { margin-top: 10px; font-size: 12px; color: var(--ink-soft); letter-spacing: 3px; }

/* 分类筛选 */
.cats {
  display: flex; gap: 8px; overflow-x: auto; padding: 20px 0 0;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: 0 0 auto; padding: 6px 16px; font-size: 14px; color: var(--ink-soft);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
.cat-chip.active { color: #fff; background: var(--accent); border-color: var(--accent); }

/* 列表 */
#list { padding-top: 22px; display: flex; flex-direction: column; gap: 14px; }
.post-card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: 0 1px 2px rgba(31, 29, 26, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.post-card:active { transform: scale(0.99); }
.post-card .cover { width: 100%; aspect-ratio: 2.35 / 1; object-fit: cover; display: block; }
.post-card .txt { padding: 14px 16px 16px; }
.post-card h2 { font-size: 17px; font-weight: 600; line-height: 1.45; }
.post-card p.sum {
  margin-top: 6px; font-size: 13px; color: var(--ink-soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card .meta { margin-top: 10px; font-size: 12px; color: var(--ink-soft); display: flex; gap: 10px; }
.post-card .meta .author { color: var(--accent); }
.post-card.no-cover { display: flex; gap: 14px; align-items: stretch; }
.post-card.no-cover .thumb {
  flex: 0 0 96px; background: linear-gradient(135deg, #e8e2d6, #d9d0be);
  display: flex; align-items: center; justify-content: center;
  font-family: "Noto Serif SC", "Songti SC", serif; font-size: 28px; color: #a99f8b;
}
.post-card.no-cover .body { flex: 1; min-width: 0; padding: 14px 14px 14px 0; }
.post-card.no-cover h2 { font-size: 16px; }
.post-card.no-cover .txt { padding: 0; }

.state { text-align: center; color: var(--ink-soft); font-size: 14px; padding: 36px 0; }
.state.error { color: var(--accent); }

.more-btn {
  display: block; margin: 18px auto 8px; padding: 10px 34px;
  background: transparent; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px; font-size: 14px; cursor: pointer;
}
.more-btn:active { background: rgba(31, 29, 26, 0.04); }

/* 详情：页面只显示正文，标题/作者/时间不进正文区 */
.article-wrap { padding-top: 30px; padding-bottom: 30px; }
.article-video { margin: 0 0 20px; background: #000; border-radius: 8px; overflow: hidden; }
/* 视频宽度撑满、按比例缩放；微信 X5 内核下 object-fit 也生效 */
.article-video video { display: block; width: 100%; max-height: 62vh; background: #000; object-fit: contain; }
.article-body { font-size: 17px; line-height: 1.85; word-break: break-word; }
.article-body p { margin: 0 0 1em; }
.article-body img { max-width: 100%; height: auto; display: block; margin: 14px auto; border-radius: 6px; }
.article-body h2, .article-body h3 { font-family: "Noto Serif SC", "Songti SC", serif; margin: 1.4em 0 0.6em; line-height: 1.5; }
.article-body h2 { font-size: 20px; }
.article-body h3 { font-size: 18px; }
.article-body blockquote {
  margin: 1em 0; padding: 10px 16px; border-left: 3px solid var(--accent);
  background: rgba(176, 67, 42, 0.05); color: var(--ink-soft); border-radius: 0 6px 6px 0;
}
.article-body pre {
  background: #26241f; color: #eee8da; padding: 14px 16px; border-radius: 8px;
  overflow-x: auto; font-size: 14px; line-height: 1.6; margin: 1em 0;
}
.article-body code { font-family: ui-monospace, "SF Mono", Consolas, monospace; }
.article-body ul, .article-body ol { padding-left: 1.6em; margin: 0 0 1em; }
.article-body hr { border: none; border-top: 1px solid var(--line); margin: 2em auto; width: 60%; }
.article-body a { color: var(--accent); }
.article-body table { border-collapse: collapse; margin: 1em 0; width: 100%; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 8px 10px; font-size: 14px; }

.site-foot { text-align: center; padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); font-size: 12px; color: var(--ink-soft); }
.back-link { color: var(--ink-soft); text-decoration: none; }

.wx-debug {
  position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 99;
  max-height: 45vh; overflow: auto; margin: 0; padding: 10px 12px; border-radius: 8px;
  background: #1d1b17; color: #f0e9dc; font-size: 11px; line-height: 1.55; white-space: pre-wrap;
  word-break: break-all; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}
