/* docs_default —— 纸墨编辑部主题
   米纸底 · 墨色字 · 印泥红点缀 · 宋体标题 · 书目点线；
   零外部字体 / 零图片（纹理用内联 SVG 噪点），国内直连 workers.dev 不被资源拖住。 */

:root {
  --paper: #f7f3ea;
  --paper-2: #efe9db;
  --surface: #fdfbf5;
  --ink: #23231e;
  --ink-soft: #6f6d61;
  --line: #d9d2c1;
  --line-strong: #23231e;
  --red: #b93a1c;
  --red-deep: #8f2c14;
  --indigo: #2d3d5c;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  --radius: 4px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.8 var(--sans);
}
/* 纸纹颗粒（SVG 噪点，极低透明度，盖满全页） */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 40;
  pointer-events: none; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--red); color: var(--paper); }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 22px; }
a { color: var(--ink); text-decoration: none; }

/* ================= 顶栏 ================= */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 243, 234, .94);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--line-strong);
}
.bar-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-weight: 700; font-size: 19px; letter-spacing: .04em;
}
.seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 3px;
  background: var(--red); color: #f7f3ea;
  font-size: 17px; font-weight: 700; line-height: 1;
  transform: rotate(-4deg);
  box-shadow: 2px 2px 0 rgba(35, 35, 30, .18);
}
.nav a {
  margin-left: 22px; color: var(--ink-soft); font-size: 14.5px;
  padding-bottom: 3px; border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav a:hover { color: var(--red); border-color: var(--red); }

/* ================= 首页 hero ================= */
.hero { text-align: center; padding: 68px 0 30px; }
.hero-kicker {
  margin: 0 0 14px; color: var(--red);
  font-family: var(--serif); font-size: 14px; letter-spacing: .5em; text-indent: .5em;
}
.hero h1 {
  position: relative; display: inline-block;
  margin: 0 0 16px; font-family: var(--serif);
  font-size: 44px; font-weight: 900; letter-spacing: .06em; line-height: 1.25;
}
.hero h1::after {
  content: ""; position: absolute; left: 4%; right: 4%; bottom: -6px; height: 12px;
  background: linear-gradient(90deg, rgba(185, 58, 28, .85), rgba(185, 58, 28, .25));
  border-radius: 6px; transform: skewX(-12deg);
}
.hero-sub { max-width: 620px; margin: 18px auto 14px; color: var(--ink-soft); font-size: 16px; }
.hero-stats { margin: 0 0 22px; display: flex; justify-content: center; gap: 14px; }
.stat {
  display: inline-block; padding: 6px 18px;
  border: 1.5px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); font-size: 14px; color: var(--ink-soft);
}
.stat strong {
  font-family: Georgia, var(--serif); font-style: italic;
  font-size: 22px; color: var(--red); margin-right: 4px;
}
.btn {
  display: inline-block; margin: 4px 3px; padding: 10px 30px;
  background: var(--ink); color: var(--paper);
  border: 1.5px solid var(--ink); border-radius: 2px;
  font-size: 15px; letter-spacing: .15em; text-indent: .15em;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.btn:hover { background: var(--red); border-color: var(--red); color: #fff; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }

/* ================= 分节标题 ================= */
.hot h2, .list-head h1, .also h2 {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--serif); font-weight: 900; letter-spacing: .08em;
}
.hot h2 { font-size: 25px; margin: 40px 0 18px; }
.h2-mark {
  width: 10px; height: 26px; background: var(--red);
  transform: skewX(-8deg); flex: none;
}

/* ================= 卡片（纸片 + 印章编号） ================= */
.cards {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
}
.card {
  position: relative;
  display: flex; flex-direction: column; gap: 3px;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px 14px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card::after {
  content: ""; position: absolute; top: 0; right: 0;
  width: 0; height: 0; border-style: solid;
  border-width: 0 14px 14px 0; border-color: transparent var(--red) transparent transparent;
  opacity: 0; transition: opacity .18s;
}
.card:hover {
  text-decoration: none; transform: translateY(-3px);
  border-color: var(--ink); box-shadow: 4px 6px 0 rgba(35, 35, 30, .12);
}
.card:hover::after { opacity: 1; }
.card-top { display: flex; justify-content: space-between; align-items: baseline; }
.card-no { font-family: Georgia, var(--serif); font-style: italic; font-size: 12.5px; color: var(--red); }
.card-meta { font-size: 12px; color: var(--ink-soft); }
.card-name {
  font-family: var(--serif); font-weight: 700; font-size: 18px;
  color: var(--ink); margin-top: 4px;
}
.card-host { font-size: 12.5px; color: var(--ink-soft); word-break: break-all; }
.more { text-align: center; margin: 26px 0 8px; }
.more a { color: var(--red); border-bottom: 1px solid currentColor; padding-bottom: 2px; }

/* ================= 列表页（书目点线） ================= */
.list-head { padding-top: 42px; }
.list-head h1 { font-size: 30px; margin: 0 0 6px; }
.filter {
  width: 100%; max-width: 480px; padding: 11px 16px; margin: 16px 0 22px;
  border: 1.5px solid var(--line-strong); border-radius: 2px;
  background: var(--surface); color: var(--ink); font-size: 15px;
}
.filter:focus { outline: 2px solid var(--red); outline-offset: 2px; }
.site-list { list-style: none; margin: 0; padding: 0; }
.site-item {
  display: flex; align-items: baseline; gap: 12px;
  padding: 9px 4px; border-bottom: 1px solid var(--line);
}
.site-item a { display: flex; align-items: baseline; gap: 10px; flex: 1; min-width: 0; }
.site-item .name {
  font-family: var(--serif); font-weight: 700; font-size: 16.5px;
  white-space: nowrap; transition: color .15s;
}
.site-item .dots {
  flex: 1; border-bottom: 2px dotted var(--line);
  transform: translateY(-4px); min-width: 24px;
}
.site-item .host { color: var(--ink-soft); font-size: 13px; word-break: break-all; }
.site-item a:hover .name { color: var(--red); }
.site-item .count { color: var(--ink-soft); font-size: 12.5px; white-space: nowrap; }

/* ================= 面包屑 ================= */
.crumbs { margin: 30px 0 14px; color: var(--ink-soft); font-size: 13.5px; }
.crumbs span + span, .crumbs a + span { margin-left: 9px; }
.crumbs a { color: var(--ink-soft); border-bottom: 1px dotted var(--ink-soft); }
.crumbs a:hover { color: var(--red); border-color: var(--red); }

/* ================= 正文（纸上墨字） ================= */
.doc {
  background: var(--surface);
  border: 1px solid var(--line); border-top: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 36px 42px; margin-bottom: 20px;
  max-width: 860px;
}
.doc h1 {
  font-family: var(--serif); font-weight: 900;
  font-size: 27px; line-height: 1.45; margin: 0 0 18px; letter-spacing: .02em;
}
.doc h2 {
  font-family: var(--serif); font-weight: 900; font-size: 20px;
  margin: 30px 0 12px; padding-top: 16px; border-top: 1px solid var(--line);
}
.doc h3 { font-family: var(--serif); font-size: 17px; margin: 22px 0 8px; }
.doc p, .doc li { font-size: 15.5px; }
.doc blockquote {
  margin: 16px 0; padding: 4px 20px;
  border-left: 3px solid var(--red); color: var(--ink-soft);
  background: linear-gradient(90deg, rgba(185, 58, 28, .06), transparent 70%);
}
.doc blockquote p { margin: 8px 0; }
.doc pre {
  background: #26261f; color: #ece7d9;
  padding: 16px 18px; border-radius: var(--radius);
  overflow-x: auto; font-size: 13.5px; line-height: 1.65;
}
.doc code {
  font-family: var(--mono); font-size: .88em;
  background: var(--paper-2); border-radius: 3px; padding: 1.5px 6px;
}
.doc pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
/* 表格：booktabs（上下粗线 + 细行线） */
.doc table {
  width: 100%; border-collapse: collapse; margin: 18px 0;
  font-size: 14.5px; display: block; overflow-x: auto;
}
.doc th, .doc td { border: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.doc thead th { border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); font-family: var(--serif); font-weight: 700; }
.doc tbody tr:last-child td { border-bottom: 2px solid var(--ink); }
.doc tbody tr:hover td { background: rgba(185, 58, 28, .045); }
.doc hr { border: 0; text-align: center; margin: 26px 0; }
.doc hr::after { content: "※"; color: var(--red); font-size: 15px; letter-spacing: 1em; text-indent: 1em; }
.doc a { color: var(--indigo); border-bottom: 1px solid rgba(45, 61, 92, .35); transition: color .15s, border-color .15s; }
.doc a:hover { color: var(--red); border-color: var(--red); }
.doc img { max-width: 100%; height: auto; }

/* ================= 同站文档 / 翻页 ================= */
.also { max-width: 860px; }
.also h2 { font-size: 19px; margin: 6px 0 12px; }
.doc-list { list-style: none; margin: 0 0 8px; padding: 0; }
.doc-list li { margin: 7px 0; }
.doc-list a { border-bottom: 1px dotted var(--ink-soft); }
.doc-list a:hover { color: var(--red); border-color: var(--red); }
.pager {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  max-width: 860px; margin: 4px 0 24px; font-size: 14.5px;
}
.pager a { color: var(--indigo); }
.pager a:hover { color: var(--red); }
.ext { margin: 18px 0 34px; }
.muted { color: var(--ink-soft); }

/* ================= 页脚（含 sitemap 锚文本） ================= */
.site-footer {
  margin-top: 40px; padding: 30px 0 40px;
  border-top: 2px solid var(--line-strong);
  text-align: center;
}
.foot-brand { font-family: var(--serif); font-weight: 900; font-size: 17px; margin: 0 0 6px; letter-spacing: .06em; }
.foot-note { color: var(--ink-soft); font-size: 12.5px; margin: 0 0 12px; }
.foot-nav { font-size: 13.5px; color: var(--line); }
.foot-nav a { color: var(--ink-soft); border-bottom: 1px dotted var(--ink-soft); padding-bottom: 1px; }
.foot-nav a:hover { color: var(--red); border-color: var(--red); }
.foot-nav span { margin: 0 8px; }

/* ================= 动效（系统偏好降级） ================= */
@media (prefers-reduced-motion: no-preference) {
  .card, .site-item { animation: rise .45s both; animation-delay: calc(var(--i, 0) * 22ms); }
  .hero h1, .hero-sub, .hero-stats, .hero .btn { animation: rise .5s both; }
  .hero-sub { animation-delay: .08s; }
  .hero-stats { animation-delay: .16s; }
  .hero .btn { animation-delay: .24s; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.card:hover, .site-item { will-change: transform; }

/* ================= 落点页画廊（借用站线真实截图） ================= */
.gallery {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px; max-width: 860px; margin: 0 0 22px;
}
.gallery img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}

@media (max-width: 640px) {
  .doc { padding: 24px 20px; }
  .hero h1 { font-size: 30px; }
  .hero h1::after { height: 8px; bottom: -4px; }
  .bar-inner { height: 54px; }
  .brand { font-size: 16.5px; }
  .nav a { margin-left: 14px; }
  .site-item .host { display: none; }
}
