/* 一页门庭 · 源站风格主题（移动优先，白底书单 + 红色强调 + 固定底栏） */

:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #33373d;
  --ink-2: #666b73;
  --muted: #999ea6;
  --line: #f0f1f3;
  --line-2: #e6e8eb;
  --red: #ed424b;
  --red-dark: #d9363e;
  --blue: #4284ed;
  --green: #42b983;
  --paper: #f6efe0;
  --paper-ink: #3d352b;
  --sans: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Heiti SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; max-width: 100%; }
body {
  margin: 0;
  max-width: 100%;
  overflow-x: clip;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
}
body > main { flex: 1 0 auto; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.4; }
p { margin: 0; }
a { color: inherit; text-decoration: none; transition: color .15s; }
a:hover { color: var(--red); }
img { max-width: 100%; border: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, button { font-size: inherit; }
[hidden] { display: none !important; }

.yp-container { max-width: 1000px; margin: 0 auto; padding: 0 10px; }
.yp-page { padding: 10px 0 0; }
.yp-sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.yp-skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  padding: 8px 14px; background: var(--red); color: #fff; border-radius: 0 0 4px 0;
}
.yp-skip:focus { left: 0; }

.yp-icon { width: 18px; height: 18px; vertical-align: -3px; }
.yp-icon--sm { width: 14px; height: 14px; }
.yp-muted { color: var(--muted); font-size: 12px; }
.yp-dot { display: none; }

/* ---------- 按钮 / 标签 ---------- */
.yp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 40px; padding: 8px 20px;
  background: var(--red); border: 1px solid var(--red); border-radius: 4px;
  color: #fff; font-size: 15px; line-height: 1.4;
}
.yp-btn:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.yp-btn--ghost { background: #fff; color: var(--red); border-color: #f0c8ca; }
.yp-btn--ghost:hover { background: #fff6f6; color: var(--red); border-color: #e8b2b5; }
.yp-btn--soft { background: #f5f6f8; border-color: #e6e8eb; color: var(--ink-2); }
.yp-btn--soft:hover { background: #eef0f3; color: var(--ink); }
.yp-btn--sm { min-height: 30px; padding: 4px 12px; font-size: 12px; }
.yp-link-btn { font-size: 13px; color: var(--muted); }
.yp-link-btn:hover { color: var(--red); }

.yp-tag {
  display: inline-block; padding: 0 4px;
  font-size: 11px; line-height: 16px; color: var(--muted);
  background: #fff; border: 1px solid #e2e4e8; border-radius: 2px;
  white-space: nowrap;
}
.yp-tag--accent { color: var(--red); border-color: #f0c9cb; }
.yp-tag--green { color: var(--green); border-color: #cde8db; }

.yp-cover {
  display: block; position: relative; overflow: hidden; flex: none;
  width: 62px; aspect-ratio: 3 / 4; height: auto;
  object-fit: cover; object-position: center;
  background: #e9ebee; border-radius: 3px;
}
.yp-cover--lg { width: 84px; }
.yp-cover--md { width: 62px; }
.yp-cover--empty {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #cfd8e6, #b9c6da);
  color: #fff; font-weight: 700; font-size: 14px; user-select: none;
}
.yp-cover--empty::before { content: attr(data-char); font-size: 2em; line-height: 1; opacity: .92; }

/* ---------- 页头 ---------- */
.yp-header { background: #fff; position: relative; z-index: 30; }
.yp-header__inner {
  max-width: 1000px; margin: 0 auto; padding: 0 12px;
  height: 48px; display: flex; align-items: center; gap: 8px;
}
.yp-brand { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.yp-brand__mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex: none; color: #4a8df8;
}
.yp-brand__mark .yp-icon { width: 26px; height: 26px; }
.yp-brand__text strong { display: block; font-size: 20px; line-height: 1.2; color: #3b6fe0; letter-spacing: 0; }
.yp-brand__text small { display: none; }
.yp-back {
  display: inline-flex; align-items: center; gap: 1px;
  font-size: 17px; color: var(--ink);
}
.yp-back .yp-icon { width: 20px; height: 20px; }
.yp-header__ops { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.yp-icon-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 40px; padding: 0; border: 0; background: none; color: #666;
}
.yp-icon-link:hover { color: var(--red); }

.yp-quick-search {
  display: flex; align-items: center;
  margin: 0 0 10px; height: 36px;
  background: #f2f3f5; border-radius: 6px; overflow: hidden;
}
.yp-quick-search:focus-within { background: #eef0f3; }
.yp-quick-search input {
  flex: 1; min-width: 0; height: 100%; padding: 0 12px;
  border: 0; outline: none; background: transparent; color: var(--ink);
  font-size: 14px;
}
.yp-quick-search input::placeholder { color: #a8adb5; }
.yp-quick-search button {
  width: 44px; height: 100%; padding: 0; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: #8a8f98;
}
.yp-quick-search button:hover { color: var(--red); }
/* 搜索页顶部搜索框（页头搜索框已移除，搜索入口集中在此） */
.yp-search-box { background: #fff; padding: 12px; margin: 0 0 10px; }
.yp-search-box .yp-quick-search { margin: 0; }

/* 首页五宫格 */
.yp-home-nav {
  display: flex; align-items: stretch;
  max-width: 1000px; margin: 0 auto; padding: 6px 0 8px;
  background: #fff;
}
.yp-home-nav a,
.yp-home-nav button {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: #666; font-size: 11px;
}
.yp-home-nav__btn { padding: 0; border: 0; background: none; line-height: 1.6; }
.yp-home-nav a.is-active,
.yp-home-nav button.is-active,
.yp-home-nav button.is-open { color: var(--red); }
.yp-home-nav .yp-icon { width: 22px; height: 22px; }
.yp-home-nav > :nth-child(1) .yp-icon { color: #e54d42; }
.yp-home-nav > :nth-child(2) .yp-icon { color: #4a8df8; }
.yp-home-nav > :nth-child(3) .yp-icon { color: #8b5cf6; }
.yp-home-nav > :nth-child(4) .yp-icon { color: #f0803c; }
.yp-home-nav > :nth-child(5) .yp-icon { color: #e54d42; }

/* 分类行：自动换行，全部栏目直接可见 */
.yp-cat-nav {
  background: #fff; border-top: 1px solid var(--line);
  padding: 6px 0 10px;
}
.yp-cat-nav .yp-container { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.yp-cat-nav a {
  padding: 5px 13px;
  border-radius: 999px; background: #f4f5f7;
  font-size: 13px; line-height: 1.7; color: #555;
}
.yp-cat-nav a.is-active { color: #fff; background: var(--red); }

/* ---------- 区块 ---------- */
.yp-section { background: #fff; margin: 0 0 10px; }
.yp-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 44px; padding: 0 12px; border-bottom: 1px solid #f5f6f7;
}
.yp-section-head > div { min-width: 0; }
.yp-section-head h2 {
  position: relative; padding-left: 9px;
  font-size: 17px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.yp-section-head h2::before {
  content: ''; position: absolute; left: 0; top: 3px; bottom: 3px;
  width: 3px; background: var(--red);
}
.yp-section-head p { display: none; }
.yp-section-head__more {
  flex: none; font-size: 12px; color: var(--muted);
  padding: 0; border: 0; background: none;
}
.yp-section-head__more:hover { color: var(--red); }
.yp-eyebrow { display: none; }
.yp-crumb { display: none; }

/* ---------- 首页 Banner ---------- */
.yp-banner-section { background: transparent; margin-bottom: 10px; }
.yp-banner-section .yp-section-head { display: none; }
.yp-feature {
  position: relative; display: flex; align-items: flex-end;
  min-height: 178px; padding: 16px 14px; overflow: hidden;
  color: #fff; background: #3d4654;
}
.yp-feature::before {
  content: ''; position: absolute; inset: -10px;
  background-image: linear-gradient(180deg, rgba(0,0,0,.08) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,.82) 100%), var(--cover, none);
  background-size: cover; background-position: center;
  filter: blur(1px); transform: scale(1.03);
}
.yp-feature > .yp-cover { display: none; }
.yp-feature__body { position: relative; z-index: 1; width: 100%; min-width: 0; }
.yp-feature__label { display: block; font-size: 11px; color: #ffd2d5; }
.yp-feature__title {
  margin: 3px 0 2px; font-size: 21px; line-height: 1.35; color: #fff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}
.yp-feature__title a { color: #fff; }
.yp-feature__author { font-size: 12px; color: rgba(255,255,255,.82); }
.yp-feature__intro {
  margin: 5px 0 10px; font-size: 12px; line-height: 1.6; color: rgba(255,255,255,.9);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.yp-feature__foot { display: flex; align-items: center; gap: 12px; }
.yp-feature__foot .yp-btn { min-height: 32px; padding: 4px 18px; font-size: 13px; }
.yp-feature__foot .yp-link-btn { color: #fff; font-size: 12px; opacity: .88; }

/* ---------- 书单行 ---------- */
.yp-book-grid { display: block; }
.yp-book-card {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px; background: #fff; border-bottom: 1px solid #f5f6f7;
  height: auto;
}
.yp-book-card:last-child { border-bottom: 0; }
.yp-book-card .yp-cover { width: 62px; height: 83px; }
.yp-book-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.yp-book-card__title {
  font-size: 16px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}
.yp-book-card__title a:hover { color: var(--red); }
.yp-book-card__intro {
  margin-top: 3px; font-size: 13px; line-height: 1.6; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.yp-book-card__meta {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  margin-top: auto; padding-top: 6px; min-width: 0;
  font-size: 12px; color: var(--muted);
}
.yp-book-card__meta > span:first-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.yp-book-card__tags { display: inline-flex; align-items: center; gap: 4px; flex: none; margin-left: auto; }
.yp-book-card__date { font-size: 11px; color: var(--blue); }
.yp-section-head h2 .yp-muted { margin-left: 4px; font-size: 12px; font-weight: 400; color: var(--muted); }

/* 最近在读 */
.yp-history { display: block; }
.yp-history__item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-bottom: 1px solid #f5f6f7;
}
.yp-history__item:last-child { border-bottom: 0; }
.yp-history__main { flex: 1; min-width: 0; }
.yp-history__book {
  display: block; font-size: 15px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.yp-history__meta {
  margin-top: 2px; font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.yp-history__item .yp-btn { flex: none; min-height: 28px; padding: 3px 10px; font-size: 12px; }

/* 简洁榜单行 */
.yp-list { background: #fff; }
.yp-rank {
  flex: none; width: 18px; text-align: center;
  font-size: 12px; font-weight: 700; color: #c3c7cd;
}
.yp-rank.is-top { color: var(--red); }

/* ---------- 列表页 ---------- */
.yp-list-head { background: #fff; padding: 12px; margin-bottom: 10px; }
.yp-list-head .yp-eyebrow { display: none; }
.yp-list-head h1 { font-size: 18px; color: var(--ink); }
.yp-list-head > p { margin-top: 3px; font-size: 12px; color: var(--muted); }

.yp-filters {
  display: flex; flex-direction: column; gap: 4px;
  background: #fff; padding: 7px 12px; margin-bottom: 10px;
}
.yp-filter { display: flex; align-items: center; gap: 8px; min-width: 0; }
.yp-filter__label { flex: none; font-size: 12px; color: var(--muted); }
.yp-chips { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.yp-chip {
  padding: 1px 10px; font-size: 12px; line-height: 20px;
  color: #666; background: #fff; border: 1px solid var(--line-2); border-radius: 2px;
}
.yp-chip:hover { color: var(--red); border-color: #f0c8ca; }
.yp-chip.is-active { color: #fff; background: var(--red); border-color: var(--red); }

.yp-sort-list { background: #fff; }
.yp-sort-item {
  display: flex; gap: 10px; align-items: stretch;
  padding: 12px; background: #fff; border-bottom: 1px solid #f5f6f7;
}
.yp-sort-item:last-child { border-bottom: 0; }
.yp-sort-item:hover { background: #fff; }
.yp-sort-item__cover { position: relative; flex: none; align-self: flex-start; }
.yp-sort-item .yp-cover { width: 62px; height: 83px; }
.yp-sort-item .yp-rank { display: none; }
/* 排行榜序号 */
.yp-board-no {
  flex: none; width: 26px; align-self: center; text-align: center;
  font-size: 17px; font-weight: 700; font-style: italic; color: #c3c7cd;
}
.yp-board-no.is-top { color: var(--red); }
.yp-sort-item__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.yp-sort-item__title { font-size: 16px; line-height: 1.45; }
.yp-sort-item__title a {
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.yp-sort-item__title a:hover { color: var(--red); }
.yp-sort-item__desc {
  margin-top: 3px; font-size: 13px; line-height: 1.6; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.yp-sort-item__meta {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  margin-top: auto; padding-top: 6px; min-width: 0;
  font-size: 12px; color: var(--muted); flex-wrap: nowrap;
}
.yp-sort-item__meta-l {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  overflow: hidden; white-space: nowrap;
}
.yp-sort-item__latest { display: none; }
.yp-sort-item__visits { display: none; }
.yp-sort-item__date { flex: none; color: var(--blue); }
.yp-sort-item__date time { color: var(--blue); }
.yp-sort-item__tags { display: inline-flex; gap: 4px; flex: none; margin-left: auto; }
.yp-sort-item__meta a:hover { color: var(--red); }

/* 分页 */
.yp-pager {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  background: #fff; padding: 10px 12px; margin: 0 0 10px;
  border-top: 1px solid #f5f6f7; flex-wrap: wrap;
}
.yp-pager a, .yp-pager span {
  min-width: 30px; height: 30px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--ink-2); border: 0; background: none;
}
.yp-pager a:hover { color: var(--red); }
.yp-pager .is-current { color: var(--red); font-weight: 700; }
.yp-pager .is-disabled { color: #c8ccd2; }

/* 空态 */
.yp-empty {
  background: #fff; padding: 48px 20px; text-align: center;
  border: 0; border-radius: 0;
}
.yp-empty__mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; margin-bottom: 10px;
  font-size: 20px; color: var(--red); background: #fff3f3; border-radius: 50%;
}
.yp-empty h3 { margin-bottom: 4px; font-size: 17px; }
.yp-empty p { margin-bottom: 12px; font-size: 13px; color: var(--muted); }

/* 异常页（404 / 500） */
.yp-error { display: flex; align-items: center; min-height: calc(100vh - 120px); }
.yp-error .yp-container { width: 100%; }
.yp-error__card { max-width: 460px; margin: 0 auto; padding: 56px 24px; }
.yp-error__card h1 { margin-bottom: 6px; font-size: 18px; }
.yp-error__card p { margin-bottom: 18px; line-height: 1.7; }
.yp-error__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.yp-error__actions .yp-btn { flex: 0 1 auto; min-width: 112px; }

/* ---------- 详情页 ---------- */
.yp-detail-hero {
  position: relative; display: flex; align-items: stretch; gap: 12px;
  padding: 16px 12px; margin: 0 0 10px; overflow: hidden;
  background: #fff; border: 0; box-shadow: none; border-radius: 0;
}
.yp-detail-hero::before {
  content: ''; position: absolute; inset: -14px;
  background-image: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.9)), var(--cover, none);
  background-size: cover; background-position: center;
  filter: blur(14px); transform: scale(1.08);
}
.yp-detail-hero > * { position: relative; z-index: 1; }
.yp-detail-hero .yp-cover--lg {
  width: 84px; height: 112px; border-radius: 4px;
  box-shadow: 0 2px 10px rgba(31,35,41,.18);
}
.yp-detail-hero__body { flex: 1; min-width: 0; }
.yp-detail-title {
  font-size: 18px; line-height: 1.4; color: var(--ink);
  overflow-wrap: anywhere;
}
.yp-detail-sub {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  margin-top: 5px; font-size: 12px; color: var(--muted);
}
.yp-detail-sub .yp-tag { font-size: 11px; }
.yp-detail-stats {
  display: flex; flex-direction: row; align-items: baseline;
  justify-content: space-between; gap: 0 8px;
  margin-top: 7px; padding: 0; border: 0;
}
.yp-detail-stats div { font-size: 12px; color: var(--muted); white-space: nowrap; }
.yp-detail-stats strong {
  display: inline; margin-right: 3px; font-size: 12px; color: var(--ink-2); font-weight: 400;
}
.yp-detail-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 9px;
}
.yp-detail-actions .yp-btn { flex: 1 1 40%; min-height: 34px; padding: 5px 8px; font-size: 14px; }
.yp-detail-actions .yp-link-btn { display: none; }
.yp-detail-actions #ypResumeMount { display: none; }

.yp-detail-layout { display: block; }
.yp-detail-main { min-width: 0; }
.yp-detail-side { display: none; }
.yp-detail-section {
  background: #fff; margin: 0 0 10px; padding: 12px 12px 4px;
}
.yp-detail-section h2 {
  position: relative; margin-bottom: 8px; padding-left: 9px;
  font-size: 16px; color: var(--ink); display: flex; align-items: baseline; gap: 6px;
}
.yp-detail-section h2::before {
  content: ''; position: absolute; left: 0; top: 3px; bottom: 3px;
  width: 3px; background: var(--red);
}
.yp-detail-section h2 .yp-muted { font-size: 12px; font-weight: 400; }
.yp-chapter-all { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--muted); }
.yp-chapter-all:hover { color: var(--red); }
.yp-detail-section h2 { display: flex; align-items: baseline; }
.yp-intro { font-size: 15px; line-height: 1.9; color: var(--ink-2); max-width: none; }

.yp-chapter-grid { display: block; background: #fff; border: 0; padding: 0; }
.yp-chapter-grid a {
  display: block; padding: 11px 0; font-size: 15px; color: var(--ink);
  background: #fff; border-bottom: 1px solid #f5f6f7; border-radius: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.yp-chapter-grid a:last-child { border-bottom: 0; }
.yp-chapter-grid a:hover { color: var(--red); background: #fff; }

/* ---------- 目录页 ---------- */
.yp-toc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #fff; padding: 12px; margin-bottom: 0;
}
.yp-toc-head h1 {
  position: relative; padding-left: 9px;
  font-size: 16px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.yp-toc-head h1::before {
  content: ''; position: absolute; left: 0; top: 3px; bottom: 3px;
  width: 3px; background: var(--red);
}
.yp-toc-head p { margin-top: 3px; font-size: 12px; color: var(--muted); }
.yp-toc-head__actions { display: none; }
.yp-chapter-links { background: #fff; margin-bottom: 10px; }
.yp-chapter-links a {
  display: block; padding: 12px; font-size: 15px; color: var(--ink);
  border-bottom: 1px solid #f5f6f7;
}
.yp-chapter-links a:last-child { border-bottom: 0; }
.yp-chapter-links a span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yp-chapter-links a:hover { color: var(--red); }

/* ---------- 搜索页 ---------- */
.yp-hotwords { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.yp-hotwords > span { font-size: 12px; color: var(--muted); }
.yp-hotwords .yp-chip { padding: 0 8px; line-height: 22px; }

.yp-search-sorts { background: #fff; padding-bottom: 6px; margin-bottom: 10px; }
.yp-search-sorts .yp-section-head { min-height: 42px; }
.yp-sort-grid { display: grid; grid-template-columns: 1fr 1fr; }
.yp-sort-card {
  padding: 12px; background: #fff; border: 0; border-bottom: 1px solid #f5f6f7;
  border-radius: 0; box-shadow: none;
}
.yp-sort-card:nth-child(2n) { border-right: 0; }
.yp-sort-card:nth-child(2n+1) { border-right: 1px solid #f5f6f7; }
.yp-sort-card:hover { box-shadow: none; transform: none; border-color: #f5f6f7; }
.yp-sort-card__top h3 { font-size: 15px; }
.yp-sort-card p { margin-top: 2px; font-size: 12px; color: var(--muted); }

.yp-search-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #fff; padding: 10px 12px; border-bottom: 1px solid #f5f6f7;
}
.yp-search-meta h1,
.yp-search-meta h2 {
  position: relative; padding-left: 9px; font-size: 15px; color: var(--ink);
}
.yp-search-meta h1::before,
.yp-search-meta h2::before {
  content: ''; position: absolute; left: 0; top: 3px; bottom: 3px;
  width: 3px; background: var(--red);
}
.yp-search-meta span { font-size: 12px; color: var(--muted); }
.yp-search-list { background: #fff; margin-bottom: 10px; }
.yp-search-item {
  display: flex; gap: 10px; padding: 12px; border-bottom: 1px solid #f5f6f7;
}
.yp-search-item:last-child { border-bottom: 0; }
.yp-search-item .yp-cover { width: 62px; height: 83px; }
.yp-search-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.yp-search-item__title { font-size: 16px; line-height: 1.45; color: var(--ink); }
.yp-search-item__title font, .yp-search-item__title em { color: var(--red); font-style: normal; }
.yp-search-item__title a:hover { color: var(--red); }
.yp-search-item__meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 3px; font-size: 12px; color: var(--muted);
}
.yp-search-item__desc {
  margin-top: 4px; font-size: 13px; line-height: 1.6; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- 阅读页 ---------- */
.yp-body--reader {
  background: var(--paper);
  color: var(--paper-ink);
  padding-bottom: 0;
}
.yp-progress { display: none; }
.yp-reader-top {
  position: sticky; top: 0; z-index: 40;
  background: rgba(246, 239, 224, .96);
  border-bottom: 1px solid rgba(210, 196, 165, .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.yp-reader-top__inner {
  max-width: 760px; margin: 0 auto; padding: 0 14px;
  height: 40px; display: flex; align-items: center; gap: 8px;
}
.yp-icon-btn {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 6px 2px; border: 0; background: none; color: #7c715e; font-size: 12px;
}
.yp-icon-btn:hover { color: #5c4b2e; }
.yp-icon-btn .yp-icon { width: 18px; height: 18px; }
.yp-reader-top__title {
  flex: 1; min-width: 0; text-align: center;
  font-size: 12px; color: #9a8f78;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.yp-reader-top__tools { display: flex; align-items: center; gap: 2px; }
.yp-reader-top__tools .yp-icon-btn span { display: none; }

.yp-reader {
  width: 100%; max-width: 760px; margin: 0 auto;
  padding: 0 16px 26px;
}
.yp-reader__paper {
  background: transparent; border: 0; box-shadow: none;
  padding: 14px 0 0; margin: 0;
}
.yp-reader__head { text-align: center; margin-bottom: 14px; }
.yp-reader__book { display: none; }
.yp-reader__head h1 {
  font-size: 18px; line-height: 1.6; font-weight: 600; color: var(--paper-ink);
}
.yp-reader__meta { margin-top: 2px; font-size: 11px; color: #a89b82; }
.yp-reader__body {
  font-size: var(--reader-size, 17px);
  line-height: var(--reader-lead, 2.05);
  color: var(--paper-ink);
  overflow-wrap: anywhere;
  text-align: justify;
}
.yp-reader__body p {
  margin: 0 0 .9em;
  text-indent: 2em;
}
.yp-reader__body p:last-child { margin-bottom: 0; }

.yp-reader__nav {
  display: grid; grid-template-columns: 1fr 48px 1fr; gap: 8px;
  margin: 26px 0 8px;
}
.yp-reader-nav-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 0; min-height: 44px; padding: 5px 10px;
  background: #efe1bd; border: 1px solid #e4d3a8; border-radius: 5px;
  color: #5c4b2e; text-align: center;
}
.yp-reader-nav-btn:hover { background: #ead9ae; color: #4d3d22; }
.yp-reader-nav-btn small { font-size: 10px; color: #8e7d5d; }
.yp-reader-nav-btn span {
  display: block; width: 100%; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.yp-reader-nav-btn--toc { padding: 0; }
.yp-reader-nav-btn--toc .yp-icon { width: 20px; height: 20px; }
.yp-reader-nav-btn.is-disabled { opacity: .5; }
.yp-reader__more { display: none; }

/* 阅读设置 */
.yp-reader-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  width: 310px; max-width: 88vw; padding: 16px;
  background: #fff; color: var(--ink);
  box-shadow: -6px 0 24px rgba(0,0,0,.12);
  transform: translateX(102%); transition: transform .22s ease;
  overflow-y: auto;
}
.yp-reader-panel.is-open { transform: translateX(0); }
.yp-reader-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.yp-reader-panel__head h3 { font-size: 16px; }
.yp-reader-panel__group { padding: 14px 0; border-bottom: 1px solid var(--line); }
.yp-reader-panel__label {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; font-size: 13px; color: var(--ink-2);
}
.yp-reader-panel__label b { font-weight: 400; color: var(--muted); }
.yp-font-adjust { display: flex; align-items: center; gap: 8px; }
.yp-font-adjust button {
  flex: none; min-width: 52px; height: 34px;
  border: 1px solid var(--line-2); border-radius: 4px; background: #fff;
  color: var(--ink-2); font-size: 13px;
}
.yp-font-preview {
  flex: 1; min-width: 0; text-align: center;
  font-size: 14px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.yp-theme-switch { display: flex; gap: 8px; }
.yp-theme-item {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 36px; border: 1px solid var(--line-2); border-radius: 4px;
  background: #fff; color: var(--ink-2); font-size: 12px;
}
.yp-theme-item.is-active { border-color: var(--red); color: var(--red); }
.yp-theme-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #f6efe0; border: 1px solid #d8c9a8;
}
.yp-theme-dot--sage { background: #e8f0e8; border-color: #b9cdbb; }
.yp-theme-dot--dusk { background: #2a2a2a; border-color: #555; }
.yp-seg { display: flex; gap: 6px; }
.yp-seg button {
  flex: 1; height: 32px;
  border: 1px solid var(--line-2); border-radius: 4px; background: #fff;
  color: var(--ink-2); font-size: 12px;
}
.yp-seg button.is-active { border-color: var(--red); color: var(--red); }
.yp-reader-panel__hint { margin-top: 12px; font-size: 11px; color: var(--muted); line-height: 1.7; }

/* 阅读主题 */
body[data-reader-theme="paper"] { background-color: var(--paper); color: var(--paper-ink); }
body[data-reader-theme="sage"] { background-color: #e8f0e8; background-image: none; color: #2f3a32; }
body[data-reader-theme="sage"] .yp-reader-top { background: rgba(232,240,232,.96); border-bottom-color: #cbdccd; }
body[data-reader-theme="sage"] .yp-reader__body,
body[data-reader-theme="sage"] .yp-reader__head h1 { color: #2f3a32; }
body[data-reader-theme="sage"] .yp-reader__book { color: #7d8f7f; }
body[data-reader-theme="dusk"] { background-color: #1e1e1e; background-image: none; color: #b9b9b9; }
body[data-reader-theme="dusk"] .yp-reader-top { background: rgba(30,30,30,.96); border-bottom-color: #333; }
body[data-reader-theme="dusk"] .yp-reader__book,
body[data-reader-theme="dusk"] .yp-reader__head h1,
body[data-reader-theme="dusk"] .yp-reader__body { color: #b9b9b9; }
body[data-reader-theme="dusk"] .yp-reader-nav-btn { background: #2b2b2b; border-color: #3a3a3a; color: #d0d0d0; }
body[data-reader-theme="dusk"] .yp-icon-btn { color: #999; }

/* ---------- 页脚 / 固定底栏 ---------- */
.yp-footer {
  background: var(--bg); padding: 16px 12px 14px;
  text-align: center; color: var(--muted); font-size: 12px; line-height: 1.9;
}
.yp-footer__links a { color: #777; }
.yp-footer__links a:hover { color: var(--red); }
.yp-footer__slogan { color: #a3a8b0; }
.yp-footer__copy { color: #b7bbc2; font-size: 11px; }

/* ---------- 桌面微调 ---------- */
@media (max-width: 759px) {
  .yp-search-meta span { display: none; }
}
@media (min-width: 760px) {
  .yp-sort-item__visits { display: inline; }
  .yp-feature { min-height: 230px; padding: 24px; }
  .yp-feature__title { font-size: 26px; }
  .yp-feature__intro { max-width: 560px; font-size: 13px; }
  .yp-book-card, .yp-sort-item, .yp-search-item { padding: 14px 16px; }
  .yp-book-card .yp-cover, .yp-sort-item .yp-cover, .yp-search-item .yp-cover { width: 72px; height: 96px; }
  .yp-detail-hero { padding: 22px; gap: 20px; }
  .yp-detail-hero .yp-cover--lg { width: 120px; height: 160px; }
  .yp-detail-title { font-size: 24px; }
  .yp-detail-actions .yp-btn { flex: 0 1 180px; }
  .yp-toc-head h1 { font-size: 19px; }
  .yp-chapter-links { display: grid; grid-template-columns: 1fr 1fr; }
  .yp-chapter-links a { border-right: 1px solid #f5f6f7; }
  .yp-chapter-links a:nth-child(2n) { border-right: 0; }
  .yp-reader { padding: 0 24px 36px; }
  .yp-reader__head h1 { font-size: 21px; }
}
