/* ============================================================
   李明笔下的青岛 · 知识库
   版式：老纸本 / 朱砂 / 宋字 / 石刻
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;500;600;700;900&family=Noto+Sans+SC:wght@300;400;500;700&family=ZCOOL+XiaoWei&family=Ma+Shan+Zheng&display=swap');

:root {
  /* 主色：老宣纸 + 墨 */
  --paper:        #f3ebd9;       /* 老纸底色 */
  --paper-deep:   #ebdfc4;       /* 深纸 */
  --paper-card:   #fbf5e6;       /* 卡片纸 */
  --ink:          #1f1a14;       /* 浓墨 */
  --ink-soft:     #3d352a;       /* 淡墨 */
  --ink-muted:    #7a6f5d;       /* 灰墨 */
  --ink-faint:    #a89b83;       /* 远墨 */

  /* 强调色：朱砂 / 青金 / 黛绿 / 赭石 */
  --cinnabar:     #9b2f1f;       /* 朱砂红 */
  --cinnabar-2:   #b8442f;
  --azure:        #2f5a6b;       /* 青金石 - 海 */
  --dai:          #475a3a;       /* 黛绿 */
  --ochre:        #8a5a2b;       /* 赭石 */

  --rule:         #c9b994;       /* 细线 */
  --rule-strong:  #8a7a55;       /* 粗线 */
  --shadow:       0 1px 0 rgba(0,0,0,0.04);

  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans:  "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --hand:  "ZCOOL XiaoWei", "Ma Shan Zheng", "Noto Serif SC", serif;
}

/* ----------  reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.95;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* 老纸纹理：极淡噪点 + 米黄渐变 */
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(139,90,43,0.06), transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(47,90,107,0.05), transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.28  0 0 0 0 0.18  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

a {
  color: var(--cinnabar);
  text-decoration: none;
  transition: color .2s, border-color .2s;
  border-bottom: 1px dotted rgba(155,47,31,.35);
}
a:hover { color: var(--cinnabar-2); border-bottom-style: solid; }

/* ----------  侧边导航  ---------- */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 270px;
  height: 100vh;
  padding: 2.2rem 1.4rem 2rem;
  overflow-y: auto;
  z-index: 100;
  background:
    linear-gradient(180deg, #ede2c6 0%, #e5d7b3 100%);
  border-right: 1px solid var(--rule);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.35), 1px 0 8px rgba(60,40,10,.05);
}
/* 侧边栏纸纹 */
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.25  0 0 0 0 0.18  0 0 0 0 0.08  0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: .7;
}
.sidebar > * { position: relative; z-index: 1; }

.sidebar-logo {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: .08em;
  color: #f8ecc9;
  line-height: 1.3;
  display: block;
  padding: .55rem .5rem .5rem;
  border: 2px solid var(--cinnabar);
  background: var(--cinnabar);
  border-radius: 2px;
  margin-bottom: .4rem;
  text-align: center;
  text-shadow: 0 1px 0 rgba(0,0,0,.15);
  box-shadow: 1px 1px 0 rgba(0,0,0,.1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-subtitle {
  font-size: .78rem;
  color: var(--ink-muted);
  margin-bottom: 1.8rem;
  font-family: var(--sans);
  letter-spacing: .12em;
  text-align: center;
  display: block;
}

.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 2px; }
.sidebar-nav a {
  display: block;
  padding: .5rem .7rem .5rem .9rem;
  color: var(--ink-soft);
  font-size: .95rem;
  font-family: var(--serif);
  border-radius: 0;
  border-left: 3px solid transparent;
  border-bottom: none;
  letter-spacing: .04em;
  transition: all .18s;
}
.sidebar-nav a:hover {
  background: rgba(155,47,31,.07);
  color: var(--cinnabar);
  border-left-color: var(--cinnabar);
  text-decoration: none;
}
.sidebar-nav a.active {
  background: rgba(155,47,31,.1);
  color: var(--cinnabar);
  border-left-color: var(--cinnabar);
  font-weight: 600;
}

.sidebar-nav .nav-section {
  font-size: .72rem;
  letter-spacing: .35em;
  color: var(--ink-faint);
  margin: 1.5rem 0 .55rem;
  padding: 0 .7rem;
  font-family: var(--sans);
  font-weight: 500;
  text-transform: uppercase;
  position: relative;
}
.sidebar-nav .nav-section::after {
  content: "";
  display: block;
  height: 1px;
  background: linear-gradient(to right, var(--rule-strong), transparent);
  margin-top: .35rem;
}

.sidebar-book {
  display: block;
  padding: .4rem .7rem .4rem .9rem;
  font-size: .88rem;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--serif);
  border-left: 3px solid transparent;
  border-bottom: none;
  letter-spacing: .03em;
  transition: all .18s;
}
.sidebar-book:hover {
  background: rgba(47,90,107,.07);
  color: var(--azure);
  border-left-color: var(--azure);
  text-decoration: none;
}
.sidebar-book .book-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(0,0,0,.1);
}

/* ----------  主内容区  ---------- */
.main {
  margin-left: 270px;
  padding: 3rem 3.5rem 5rem;
  max-width: 920px;
}

/* ----------  首页 Hero  ---------- */
.hero {
  text-align: center;
  padding: 2.5rem 0 2.8rem;
  margin-bottom: 3rem;
  position: relative;
  /* 双线边框，像扉页 */
  border: 1px solid var(--rule-strong);
  outline: 1px solid var(--rule-strong);
  outline-offset: 6px;
  background:
    linear-gradient(180deg, rgba(251,245,230,.6), rgba(251,245,230,.3));
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  width: 28px; height: 28px;
  border: 1.5px solid var(--cinnabar);
}
.hero::before { top: -8px; left: -8px; border-right: none; border-bottom: none; }
.hero::after  { bottom: -8px; right: -8px; border-left: none; border-top: none; }

.hero h1 {
  font-family: var(--serif);
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: .18em;
  margin-bottom: .3rem;
  text-indent: .18em;
  white-space: nowrap;
}
.hero .hero-about-link {
  display: block;
  margin-top: 1rem;
  font-family: var(--sans);
  font-size: .82rem;
  color: var(--ink-muted);
  text-decoration: none;
  letter-spacing: .15em;
  opacity: .7;
  transition: opacity .2s;
}
.hero .hero-about-link:hover {
  opacity: 1;
  color: var(--cinnabar);
}
.hero .tagline {
  font-family: var(--hand);
  font-size: 1.15rem;
  color: var(--ink-muted);
  letter-spacing: .25em;
  margin: .8rem 0 1.8rem;
  position: relative;
  display: inline-block;
  padding: 0 1.8rem;
}
.hero .tagline::before, .hero .tagline::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 36px;
  height: 1px;
  background: var(--rule-strong);
}
.hero .tagline::before { left: -30px; }
.hero .tagline::after  { right: -30px; }

.hero .stats-row {
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding-top: 1.4rem;
  border-top: 1px dashed var(--rule);
}
.hero .stat-item {
  text-align: center;
  padding: 0 1.4rem;
  position: relative;
}
.hero .stat-item + .stat-item::before {
  content: "";
  position: absolute;
  left: 0; top: 20%;
  height: 60%;
  width: 1px;
  background: var(--rule);
}
.hero .stat-num {
  font-family: var(--serif);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--cinnabar);
  line-height: 1.2;
  letter-spacing: .02em;
  font-variant-numeric: oldstyle-nums;
}
.hero .stat-label {
  font-size: .78rem;
  color: var(--ink-muted);
  font-family: var(--sans);
  margin-top: .3rem;
  letter-spacing: .15em;
}

/* ----------  章节标题  ---------- */
h2.section-title {
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--ink);
  margin: 3rem 0 1.5rem;
  padding-bottom: .55rem;
  letter-spacing: .08em;
  position: relative;
  border-bottom: 2px solid var(--ink);
}
h2.section-title::before {
  content: "";
  display: inline-block;
  width: 14px; height: 14px;
  background: var(--cinnabar);
  margin-right: .7rem;
  vertical-align: 2px;
  transform: rotate(45deg);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--cinnabar);
}
h3.subsection-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.8rem 0 .9rem;
  color: var(--ink);
  letter-spacing: .05em;
  padding-left: .8rem;
  border-left: 4px solid var(--cinnabar);
}

/* ----------  书籍卡片  ---------- */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.4rem;
  margin: 2rem 0;
  counter-reset: book;
}
.book-card {
  display: block;
  padding: 1.5rem 1.5rem 1.4rem;
  background: var(--paper-card);
  border: 1px solid var(--rule);
  position: relative;
  color: var(--ink);
  transition: transform .25s, box-shadow .25s;
  border-bottom: none;
  counter-increment: book;
}
.book-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(60,40,10,.12), 0 2px 4px rgba(60,40,10,.06);
  text-decoration: none;
}
/* 书脊 */
.book-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 6px;
  height: 100%;
  background: var(--card-color, var(--cinnabar));
}
/* 右上角卷次朱印 */
.book-card::after {
  content: "卷" counter(book, cjk-decimal);
  position: absolute;
  top: .75rem;
  right: .85rem;
  font-family: var(--serif);
  font-size: .72rem;
  color: var(--cinnabar);
  letter-spacing: .1em;
  padding: .15rem .35rem;
  border: 1px solid var(--cinnabar);
  background: rgba(155,47,31,.04);
}
.book-card h3 {
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 700;
  margin-bottom: .3rem;
  color: var(--ink);
  letter-spacing: .06em;
  padding-right: 1.5rem;
}
.book-card .book-sub {
  font-size: .82rem;
  color: var(--cinnabar);
  font-family: var(--hand);
  margin-bottom: .9rem;
  letter-spacing: .12em;
}
.book-card .book-sub:empty { display: none; }
.book-card .book-desc {
  font-size: .9rem;
  color: var(--ink-soft);
  line-height: 1.85;
  font-family: var(--serif);
  text-indent: 2em;
}
.book-card .book-meta {
  margin-top: 1.1rem;
  padding-top: .8rem;
  border-top: 1px dashed var(--rule);
  font-size: .76rem;
  color: var(--ink-muted);
  font-family: var(--sans);
  display: flex;
  gap: 1.2rem;
  letter-spacing: .08em;
}
.book-card .book-meta span::before {
  content: "·";
  margin-right: .4rem;
  color: var(--cinnabar);
}

/* ----------  索引列表  ---------- */
.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0;
  margin: 1.2rem 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  background: var(--paper-card);
}
.index-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem 1rem;
  font-size: .95rem;
  font-family: var(--serif);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  border-bottom: none;
  transition: background .15s;
  letter-spacing: .04em;
}
.index-item:hover {
  background: rgba(155,47,31,.06);
  text-decoration: none;
}
.index-item .count {
  font-family: var(--sans);
  font-size: .75rem;
  color: var(--ink-muted);
  background: transparent;
  padding: 0;
  border-radius: 0;
  border: 1px solid var(--rule);
  padding: .05rem .5rem;
  min-width: 2rem;
  text-align: center;
}

/* ----------  实体词条页  ---------- */
.entity-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.6rem;
  border-bottom: 2px solid var(--ink);
  position: relative;
}
.entity-header::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 60px;
  height: 2px;
  background: var(--cinnabar);
}
.entity-header h1 {
  font-family: var(--serif);
  font-size: 2.3rem;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: .1em;
  margin-bottom: .8rem;
}
.entity-meta {
  display: flex;
  gap: 1.8rem;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: .85rem;
  color: var(--ink-muted);
}
.entity-meta > div {
  display: flex;
  align-items: baseline;
  gap: .4rem;
}
.entity-meta .meta-num {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--cinnabar);
  font-size: 1.15rem;
}

.book-tag {
  display: inline-block;
  padding: .15rem .65rem;
  border-radius: 0;
  font-size: .74rem;
  font-family: var(--sans);
  color: #fff;
  margin-right: .4rem;
  margin-bottom: .4rem;
  letter-spacing: .08em;
  box-shadow: 1px 1px 0 rgba(0,0,0,.15);
}

.mention-card {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--cinnabar);
  padding: 1.1rem 1.4rem 1.2rem;
  margin-bottom: 1.1rem;
  font-size: .96rem;
  line-height: 2;
  position: relative;
  box-shadow: var(--shadow);
}
.mention-card::before {
  content: "";
  position: absolute;
  top: -1px; right: -1px;
  border-width: 0 14px 14px 0;
  border-style: solid;
  border-color: transparent var(--paper) transparent transparent;
}
.mention-card .mention-source {
  font-size: .76rem;
  color: var(--cinnabar);
  font-family: var(--sans);
  margin-bottom: .6rem;
  letter-spacing: .1em;
  padding-bottom: .4rem;
  border-bottom: 1px dotted var(--rule);
}
.mention-card .mention-text {
  color: var(--ink-soft);
  text-indent: 2em;
}
.mention-card .mention-text mark {
  background: linear-gradient(transparent 60%, rgba(155,47,31,.25) 60%);
  padding: 0 2px;
  color: inherit;
  font-weight: 600;
}

/* ----------  正文阅读页  ---------- */
.book-reader { max-width: 720px; margin: 0 auto; }
.book-reader h1 {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--ink);
  text-align: center;
  letter-spacing: .15em;
  margin-bottom: .4rem;
}
.book-reader .book-subtitle {
  text-align: center;
  font-size: 1rem;
  color: var(--cinnabar);
  font-family: var(--hand);
  margin-bottom: 2.5rem;
  letter-spacing: .3em;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule-strong);
  position: relative;
}
.book-reader .book-subtitle::after {
  content: "❦";
  display: block;
  text-align: center;
  color: var(--ink-faint);
  font-size: 1.2rem;
  margin-top: .8rem;
  letter-spacing: 0;
}

.chapter-list {
  list-style: none;
  margin: 1.5rem 0 2.5rem;
  columns: 2;
  column-gap: 2rem;
}
.chapter-list li {
  padding: .4rem 0;
  border-bottom: 1px dotted var(--rule);
  break-inside: avoid;
}
.chapter-list a {
  font-size: .95rem;
  border-bottom: none;
}

.chapter-content h2 {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ink);
  margin: 3rem 0 1.2rem;
  padding: .5rem 0 .6rem;
  text-align: center;
  letter-spacing: .12em;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule-strong);
}
.chapter-content p {
  margin-bottom: 1.1rem;
  text-indent: 2em;
  font-size: 1.02rem;
  line-height: 2.05;
  color: var(--ink-soft);
  text-align: justify;
  hanging-punctuation: allow-end;
}
/* 首字下沉（仅正文第一段） */
.chapter-content > p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 900;
  float: left;
  line-height: 1;
  padding: .25rem .5rem .1rem 0;
  color: var(--cinnabar);
}

.chapter-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--ink);
  font-family: var(--serif);
  font-size: .92rem;
}
.chapter-nav a {
  border-bottom: none;
  padding: .4rem .8rem;
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  transition: all .15s;
}
.chapter-nav a:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

/* ----------  时间线  ---------- */
.timeline {
  position: relative;
  padding-left: 2.5rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: .5rem;
  bottom: .5rem;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--ink) 0, var(--ink) 4px,
    transparent 4px, transparent 8px
  );
}
.timeline-year {
  position: relative;
  margin-bottom: 2.2rem;
}
.timeline-year::before {
  content: '';
  position: absolute;
  left: -2.5rem;
  top: .55rem;
  width: 18px; height: 18px;
  background: var(--cinnabar);
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 1.5px var(--ink);
  z-index: 1;
  transform: rotate(45deg);
}
.timeline-year h3 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: .8rem;
  letter-spacing: .08em;
  display: inline-block;
  padding: .1rem .8rem .2rem;
  background: var(--paper-card);
  border: 1px solid var(--rule);
  position: relative;
  left: -.5rem;
}
.timeline-event {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  padding: .85rem 1.1rem .9rem;
  margin-bottom: .6rem;
  font-size: .93rem;
  line-height: 1.85;
  color: var(--ink-soft);
  position: relative;
  border-left: 3px solid var(--ochre);
}
.timeline-event::before {
  content: "";
  position: absolute;
  left: -8px; top: 1rem;
  width: 0; height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 8px solid var(--rule);
}
.timeline-event .event-source {
  display: block;
  font-size: .73rem;
  color: var(--cinnabar);
  font-family: var(--sans);
  margin-top: .5rem;
  letter-spacing: .08em;
}

/* ----------  搜索  ---------- */
.search-box {
  width: 100%;
  padding: .9rem 1.2rem;
  font-size: 1.05rem;
  font-family: var(--serif);
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  margin-bottom: 1.8rem;
  background: var(--paper-card);
  color: var(--ink);
  letter-spacing: .04em;
}
.search-box:focus {
  outline: none;
  border-color: var(--cinnabar);
  box-shadow: inset 0 0 0 1px var(--cinnabar);
}
.search-result {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--cinnabar);
  padding: 1rem 1.3rem 1.1rem;
  margin-bottom: .9rem;
  transition: background .15s;
}
.search-result:hover { background: #fff9e8; }
.search-result .result-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: .35rem;
  font-family: var(--serif);
  color: var(--ink);
}
.search-result .result-title a { border-bottom: none; }
.search-result .result-snippet {
  font-size: .9rem;
  color: var(--ink-soft);
  line-height: 1.75;
}
.search-result .result-snippet mark {
  background: linear-gradient(transparent 60%, rgba(155,47,31,.28) 60%);
  padding: 0 2px;
  color: inherit;
  font-weight: 600;
}
.search-result .result-meta {
  font-size: .75rem;
  color: var(--cinnabar);
  font-family: var(--sans);
  margin-top: .5rem;
  letter-spacing: .08em;
}

/* ----------  知识图谱  ---------- */
#graph-container {
  width: 100%;
  height: 70vh;
  border: 1px solid var(--rule-strong);
  background:
    radial-gradient(ellipse at center, #fbf5e6 0%, var(--paper-deep) 100%);
  position: relative;
}
#graph-container::after {
  content: "人物 · 地名 · 机构 关联图谱";
  position: absolute;
  bottom: .8rem;
  right: 1rem;
  font-size: .72rem;
  color: var(--ink-faint);
  font-family: var(--sans);
  letter-spacing: .2em;
}
.graph-legend {
  display: flex;
  gap: 1.8rem;
  margin: 1.2rem 0;
  font-family: var(--sans);
  font-size: .85rem;
  flex-wrap: wrap;
  color: var(--ink-soft);
}
.graph-legend span { display: flex; align-items: center; gap: .5rem; }
.graph-legend .dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px currentColor;
}

/* ----------  面包屑  ---------- */
.breadcrumb {
  font-family: var(--sans);
  font-size: .8rem;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
  letter-spacing: .08em;
}
.breadcrumb a { color: var(--ink-muted); border-bottom: 1px dotted var(--ink-faint); }
.breadcrumb a:hover { color: var(--cinnabar); }

/* ----------  正文中的实体链接  ---------- */
.entity-link {
  color: var(--cinnabar);
  border-bottom: 1px dashed rgba(155,47,31,.4);
  cursor: pointer;
  transition: all .15s;
}
.entity-link:hover {
  text-decoration: none;
  background: rgba(155,47,31,.06);
}
.entity-link.person { color: var(--azure); border-bottom-color: rgba(47,90,107,.4); }
.entity-link.place  { color: var(--dai);   border-bottom-color: rgba(71,90,58,.4); }
.entity-link.org    { color: var(--ochre); border-bottom-color: rgba(138,90,43,.4); }

/* ----------  移动端菜单按钮  ---------- */
.menu-toggle {
  display: none;
  position: fixed;
  top: .8rem;
  left: .8rem;
  z-index: 200;
  background: var(--cinnabar);
  color: #f8ecc9;
  border: none;
  padding: .55rem .9rem;
  font-size: 1.2rem;
  cursor: pointer;
  font-family: var(--serif);
  box-shadow: 1px 1px 4px rgba(0,0,0,.2);
  letter-spacing: .1em;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30,20,10,.45);
  z-index: 99;
}

/* ----------  响应式  ---------- */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .3s;
    width: 250px;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main {
    margin-left: 0;
    padding: 4rem 1.3rem 3rem;
  }
  .menu-toggle { display: block; }
  .hero { padding: 2rem 1rem; outline-offset: 4px; }
  .hero h1 { font-size: 1.7rem; letter-spacing: .1em; text-indent: .1em; white-space: nowrap; }
  .hero .tagline { font-size: 1rem; letter-spacing: .15em; padding: 0 .8rem; }
  .hero .tagline::before, .hero .tagline::after { width: 20px; }
  .hero .tagline::before { left: -18px; }
  .hero .tagline::after { right: -18px; }
  .hero .stat-item { padding: 0 .9rem; }
  .hero .stat-num { font-size: 1.5rem; }
  .books-grid { grid-template-columns: 1fr; }
  .chapter-list { columns: 1; }
}

@media (max-width: 600px) {
  html { font-size: 15px; }
  .main { padding: 4rem 1rem 3rem; }
  .hero { padding: 1.8rem .8rem; }
  .hero h1 { font-size: 1.4rem; letter-spacing: .08em; text-indent: .08em; }
  .hero .stat-num { font-size: 1.3rem; }
  .hero .stat-label { font-size: .7rem; }
  .chapter-content > p:first-of-type::first-letter { font-size: 2.4rem; }
}

/* ----------  选中文本  ---------- */
::selection {
  background: rgba(155,47,31,.2);
  color: var(--ink);
}

/* ----------  滚动条  ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--paper-deep); }
::-webkit-scrollbar-thumb {
  background: var(--rule-strong);
  border: 2px solid var(--paper-deep);
}
::-webkit-scrollbar-thumb:hover { background: var(--cinnabar); }

/* ----------  首页 CTA 与版权页脚  ---------- */
.cta-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin: 3.5rem 0 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}
.cta-btn {
  display: inline-block;
  padding: .75rem 2rem;
  font-family: var(--serif);
  font-size: .98rem;
  letter-spacing: .35em;
  text-indent: .35em;
  color: var(--ink);
  background: var(--paper-card);
  border: 1px solid var(--ink);
  border-bottom: none;
  transition: all .2s;
  position: relative;
}
.cta-btn::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid var(--rule);
  pointer-events: none;
}
.cta-btn:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  transform: translateY(-1px);
}

.colophon {
  text-align: center;
  margin: 2.5rem 0 0;
  padding: 1.2rem 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  flex-wrap: wrap;
}
.colophon-mark {
  display: inline-block;
  font-family: var(--serif);
  font-size: .82rem;
  font-weight: 700;
  color: #f8ecc9;
  background: var(--cinnabar);
  padding: .15rem .45rem;
  letter-spacing: .25em;
  text-indent: .25em;
  box-shadow: 1px 1px 0 rgba(0,0,0,.15);
}
.colophon-text {
  font-size: .8rem;
  color: var(--ink-muted);
  font-family: var(--sans);
  letter-spacing: .12em;
}

/* ----------  知识图谱图例文字化  ---------- */
.graph-legend .dot.person-dot { background: var(--azure); color: var(--azure); }
.graph-legend .dot.place-dot  { background: var(--dai);   color: var(--dai); }
.graph-legend .dot.org-dot    { background: var(--ochre); color: var(--ochre); }

/* Copyright notice */
.copyright-notice {
  text-align: center;
  font-size: 0.75rem;
  color: #999;
  margin-top: 0.5rem;
  letter-spacing: 0.05em;
}
.colophon-full .copyright-notice {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: #888;
}
