/* shu 站样式：纸页书卷风（Bootstrap 5.3.8 之上的一层轻主题） */
:root {
  --bg: #f4efe4;
  --paper: #fffdf7;
  --ink: #2b2620;
  --muted: #7a7164;
  --rule: #e3dac8;
  --accent: #8a5a2b;
  --fs: 19px;
  --lh: 2;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, Georgia, serif;
  font-size: 16px;
  line-height: 1.7;
}
body.night {
  --bg: #14110d;
  --paper: #1c1813;
  --ink: #ddd3c4;
  --muted: #9a8f7f;
  --rule: #2c2620;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.shell { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

/* 报头 */
.masthead { background: var(--paper); border-bottom: 1px solid var(--rule); }
.masthead-inner {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 22px;
  padding-top: 22px; padding-bottom: 18px;
}
.mast-brand {
  font-size: 30px; letter-spacing: .18em; color: var(--ink);
  font-weight: 600; line-height: 1.2;
}
.mast-brand:hover { text-decoration: none; color: var(--accent); }
.mast-slogan { color: var(--muted); font-size: 13px; letter-spacing: .08em; }
.mast-nav { margin-left: auto; display: flex; gap: 20px; font-size: 15px; }
.mast-nav a { color: var(--muted); padding-bottom: 2px; border-bottom: 1px solid transparent; }
.mast-nav a.on, .mast-nav a:hover { color: var(--ink); border-bottom-color: var(--accent); text-decoration: none; }
.mast-search { display: flex; gap: 0; }
.mast-search input {
  width: 168px; border: 1px solid var(--rule); border-right: 0; background: transparent;
  padding: 6px 10px; font-size: 14px; color: var(--ink); border-radius: 2px 0 0 2px;
}
.mast-search input:focus { outline: 1px solid var(--accent); outline-offset: -1px; }
.mast-search button {
  border: 1px solid var(--rule); background: var(--accent); color: #fff;
  padding: 6px 12px; font-size: 14px; cursor: pointer; border-radius: 0 2px 2px 0;
}
.notice {
  margin: 14px auto 0; padding: 8px 12px; border-left: 3px solid var(--accent);
  background: var(--paper); color: var(--muted); font-size: 14px;
}
.main { padding-top: 34px; padding-bottom: 56px; }

/* 首页 */
.lead { text-align: center; padding: 26px 0 34px; border-bottom: 1px solid var(--rule); margin-bottom: 34px; }
.lead-title { font-size: 40px; letter-spacing: .28em; margin: 0 0 10px; font-weight: 600; text-indent: .28em; }
.lead-slogan { margin: 0 0 8px; color: var(--muted); font-size: 16px; letter-spacing: .05em; }
.lead-meta { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.lead-meta strong { color: var(--accent); font-weight: 600; }
.lead-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-line {
  display: inline-block; padding: 7px 20px; border: 1px solid var(--accent);
  color: var(--accent); font-size: 14px; letter-spacing: .08em; border-radius: 2px;
}
.btn-line:hover { background: var(--accent); color: #fff; text-decoration: none; }
.btn-line.ghost { border-color: var(--rule); color: var(--muted); }
.btn-line.ghost:hover { border-color: var(--accent); background: transparent; color: var(--accent); }

.cols { display: grid; grid-template-columns: 1fr 320px; gap: 48px; }
.sec-title {
  font-size: 15px; letter-spacing: .16em; color: var(--muted); font-weight: 600;
  margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--rule);
}

/* 目录条目（点线引导） */
.entries { list-style: none; margin: 0; padding: 0; }
.entry { display: flex; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 1px dotted var(--rule); }
.entry-idx { color: var(--muted); font-size: 12px; min-width: 32px; font-variant-numeric: tabular-nums; }
.entry-name { color: var(--ink); font-size: 17px; }
.entry-name:hover { color: var(--accent); text-decoration: none; }
.entry-name.muted { color: var(--muted); }
.entry-dots { flex: 1; border-bottom: 1px dotted transparent; }
.entry-date, .entry-tag { color: var(--muted); font-size: 12px; white-space: nowrap; }
.more { margin: 18px 0 0; text-align: right; font-size: 14px; }

/* 榜单 */
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dotted var(--rule); }
.rank-num {
  font-size: 22px; line-height: 1.2; color: var(--accent); width: 30px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.rank-body { display: flex; flex-direction: column; min-width: 0; }
.rank-body a { color: var(--ink); font-size: 16px; line-height: 1.4; }
.rank-body a:hover { color: var(--accent); text-decoration: none; }
.rank-body small { color: var(--muted); font-size: 12px; }
.rank-list.wide .rank-num { font-size: 26px; width: 44px; }

.random { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--rule); }
.random-list { margin: 0; line-height: 2.2; }
.random-list a { margin-right: 18px; font-size: 15px; }

/* 页头区 */
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumb span { margin: 0 6px; }
.head-row { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.page-title { font-size: 26px; margin: 0; letter-spacing: .1em; font-weight: 600; }
.page-meta { margin: 0; color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); font-size: 15px; padding: 24px 0; }

/* 搜索 */
.search-head { margin-bottom: 26px; }
.search-form { display: flex; margin-top: 16px; max-width: 560px; }
.search-form input {
  flex: 1; border: 1px solid var(--rule); background: var(--paper); padding: 10px 14px;
  font-size: 16px; color: var(--ink); border-radius: 2px 0 0 2px; font-family: inherit;
}
.search-form input:focus { outline: 1px solid var(--accent); outline-offset: -1px; }
.search-form button {
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  padding: 0 22px; font-size: 15px; cursor: pointer; font-family: inherit; border-radius: 0 2px 2px 0;
}

/* 阅读页 */
.reader { max-width: 720px; margin: 0 auto; }
.reader.wide { max-width: 780px; }
.reader-head { padding-bottom: 18px; border-bottom: 1px solid var(--rule); margin-bottom: 28px; }
.book-title { font-size: 28px; margin: 6px 0 6px; line-height: 1.35; font-weight: 600; }
.book-meta { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.reader-tools { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.reader-tools button, .reader-tools a {
  border: 1px solid var(--rule); background: transparent; color: var(--muted);
  padding: 4px 10px; cursor: pointer; font-family: inherit; font-size: 13px; border-radius: 2px;
}
.reader-tools button:hover, .reader-tools a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.progress { margin-top: 14px; height: 3px; background: var(--rule); }
.progress span { display: block; height: 3px; background: var(--accent); }
.paper {
  background: var(--paper); padding: 38px 42px; font-size: var(--fs); line-height: var(--lh);
  color: var(--ink); border: 1px solid var(--rule);
  box-shadow: 0 1px 0 var(--rule), 0 8px 24px rgba(80, 60, 30, .05);
  overflow-wrap: break-word;
}
.paper p { margin: 0 0 .85em; text-indent: 2em; }
.paper p:last-child { margin-bottom: 0; }
.reader-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 26px 0 0; padding-top: 16px; border-top: 1px solid var(--rule); flex-wrap: wrap;
}
.reader-nav .btn { border-radius: 2px; font-family: inherit; }
.reader-nav .page-input { width: 72px; font-family: inherit; }
.reading-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px 18px; background: var(--paper); border-bottom: 1px solid var(--rule); font-size: 13px;
}
.reading-title { color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reading-exit { white-space: nowrap; }
body.reading .main { padding-top: 20px; }
body.reading .paper { border-left: 0; border-right: 0; box-shadow: none; padding-left: 0; padding-right: 0; background: transparent; }

/* 空页 */
.blank { max-width: 560px; margin: 40px auto; text-align: center; }
.blank .page-title { font-size: 24px; margin-bottom: 12px; }
.blank-links { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }

/* 分页（Bootstrap 覆盖成纸页风） */
.pager-wrap { margin-top: 30px; }
.pagination { --bs-pagination-color: var(--muted); --bs-pagination-bg: transparent; --bs-pagination-border-color: var(--rule); --bs-pagination-active-bg: var(--accent); --bs-pagination-active-border-color: var(--accent); --bs-pagination-hover-bg: var(--paper); --bs-pagination-hover-color: var(--accent); --bs-pagination-disabled-color: var(--rule); }
.pagination .page-link { border-radius: 0; font-family: inherit; font-size: 13px; }

/* 页脚 */
.foot { border-top: 1px solid var(--rule); background: var(--paper); padding: 24px 0 30px; margin-top: 20px; }
.foot-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.foot-meta, .foot-links { margin: 0; display: flex; gap: 14px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--accent); }

/* 夜间 */
body.night .paper { box-shadow: none; }
body.night .mast-search button, body.night .search-form button { background: var(--accent); border-color: var(--accent); }

/* 响应式 */
@media (max-width: 860px) {
  .cols { grid-template-columns: 1fr; gap: 34px; }
  .col-narrow { border-top: 1px solid var(--rule); padding-top: 22px; }
  .mast-nav { margin-left: 0; }
  .mast-search { width: 100%; }
  .mast-search input { flex: 1; width: auto; }
  .lead-title { font-size: 32px; letter-spacing: .18em; }
  .paper { padding: 26px 20px; font-size: 17px; }
  .book-title { font-size: 22px; }
  body.reading .paper { padding-left: 4px; padding-right: 4px; }
}
