/* ==========================================================================
 * lulu · 小说专页（对照 NovelPage / NovelCard / NovelDetailPage）
 * 去掉 data-v-*；本页自带 vv-section / vv-collection / vv-page / vv-image / vv-pagination
 * 与 vv-ad-slot 最小复刻。不改 tokens.css / lulu-chrome.css。
 * ========================================================================== */

.novel-page,
.novel-detail-page,
.novel-inner-page,
.novel-reader-page,
.lulu-novel-compact {
  --site-accent: var(--k-primary, #ff5d79);
  --site-accent-strong: var(--k-primary-strong, #e64166);
  --site-accent-soft: var(--k-accent-soft, rgb(255 93 121 / 14%));
  --site-accent-shadow: var(--k-accent-shadow, rgb(255 93 121 / 32%));
  --site-accent-gradient: var(--k-accent-gradient, linear-gradient(135deg, #ff8a67, #ff4d83 58%, #9c55ff));
  --site-border: var(--k-border, rgb(24 28 42 / 10%));
  --site-surface: var(--k-surface, #ffffff);
  --site-surface-muted: var(--k-surface-muted, var(--k-surface-1, rgb(24 28 42 / 5%)));
  --site-muted: var(--k-text-muted, #6b7280);
  --site-page-max-width: var(--k-page-max, 1180px);
  --vv-color-muted: var(--site-muted, #6b7280);
  --vv-color-text: var(--k-text, #1a1d28);
  --vv-color-border: var(--site-border);
  --vv-color-surface: var(--site-surface);
  --vv-color-primary: var(--site-accent);
  --site-bottom-nav-space: var(--k-bottom-chrome-h, 64px);
}

.novel-page,
.novel-detail-page {
  --vv-page-layout-max-width: var(--site-page-max-width);
  --novel-card-min-width: 132px;
  --novel-card-gap: 10px;
  box-sizing: border-box;
  width: min(100%, var(--vv-page-layout-max-width, 1180px));
  margin-inline: auto;
  padding-inline: var(--vv-page-layout-gutter, 12px);
  padding-block: var(--vv-page-layout-block-start, 14px) var(--vv-page-layout-block-end, 40px);
  color: var(--vv-color-text);
}

/* ---- 本页最小 vv-page / section / collection / image ---- */
.vv-page-layout.novel-page,
.vv-page-layout.novel-detail-page {
  display: block;
  min-width: 0;
}

.vv-page-layout.novel-detail-page {
  padding-bottom: calc(var(--site-bottom-nav-space, 64px) + 88px);
}

.vv-section-layout {
  display: grid;
  min-width: 0;
  gap: var(--vv-section-layout-gap, 10px);
}
.vv-section-layout__header {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--vv-section-layout-gap, 10px);
}
.vv-section-layout__heading {
  display: grid;
  min-width: 0;
  gap: var(--vv-section-layout-header-gap, 3px);
}
.vv-section-layout__eyebrow {
  color: var(--vv-color-muted);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.vv-section-layout__title {
  margin: 0;
  color: var(--vv-color-text);
  font: inherit;
  font-size: var(--vv-section-layout-title-size, clamp(1.25rem, 2vw, 1.75rem));
  font-weight: 700;
}
.vv-section-layout__actions { flex: 0 0 auto; }
.vv-section-layout__content,
.vv-section-layout__footer { min-width: 0; }
@media (max-width: 640px) {
  .vv-section-layout__header { align-items: stretch; flex-direction: column; }
}

.vv-collection-layout--grid {
  display: grid;
  gap: var(--vv-collection-layout-gap, var(--novel-card-gap));
  padding: var(--vv-collection-layout-padding, 0);
  grid-template-columns: var(--vv-collection-layout-grid-template, repeat(auto-fit, minmax(min(100%, var(--novel-card-min-width)), 1fr)));
}
.vv-collection-layout__item { min-width: 0; }

.vv-image {
  display: block;
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
}
.vv-image__element {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- NovelPage ---- */
.novel-page__intro {
  display: grid;
  margin-bottom: clamp(18px, 3vw, 30px);
  gap: 4px;
}
.novel-page__intro span {
  color: var(--site-accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
}
.novel-page__intro h1,
.novel-page__intro p { margin: 0; }
.novel-page__intro h1 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.25;
}
.novel-page__intro p {
  color: var(--vv-color-muted);
  font-size: .88rem;
}
.novel-page__groups,
.novel-page__type-group,
.novel-page__sections { display: grid; }
.novel-page__groups { gap: clamp(28px, 5vw, 48px); }
.novel-page__type-group { gap: 14px; }
.novel-page__sections { gap: clamp(22px, 4vw, 38px); }
.novel-page__section { min-width: 0; }
.novel-page__section .vv-section-layout__header {
  align-items: end;
  flex-direction: row;
}
.novel-page__section .vv-section-layout__eyebrow {
  color: var(--site-accent);
  font-size: .68rem;
  letter-spacing: .1em;
}
.novel-page__section .vv-section-layout__title {
  font-size: clamp(1rem, 2vw, 1.25rem);
}
.novel-page__more {
  color: var(--site-accent-strong);
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
}
.novel-page__pagination { margin-top: clamp(22px, 4vw, 36px); }

.novel-page__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 clamp(16px, 3vw, 24px);
}
.novel-page__chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid var(--site-border);
  border-radius: 999px;
  background: var(--site-surface);
  color: var(--vv-color-text);
  font-size: .78rem;
  font-weight: 650;
  text-decoration: none;
}
.novel-page__chip:hover,
.novel-page__chip:focus-visible {
  border-color: color-mix(in srgb, var(--site-accent) 42%, var(--site-border));
  color: var(--site-accent-strong);
}
/* 选中态对照源站 10-novels.html site-header__novel-switch a.is-selected：accent-soft 底 + accent-strong 字 */
.novel-page__chip.is-active,
.novel-page__chip[aria-current="page"] {
  border-color: color-mix(in srgb, var(--site-accent) 42%, var(--site-border));
  background: var(--site-accent-soft, rgb(255 93 121 / 14%));
  color: var(--site-accent-strong, #e64166);
}

.novel-page__empty {
  display: grid;
  gap: 6px;
  padding: 28px 18px;
  border-radius: 14px;
  background: var(--site-surface-muted);
  color: var(--vv-color-muted);
  text-align: center;
}
.novel-page__empty strong {
  color: var(--vv-color-text);
  font-size: .95rem;
}

/* 页内横幅广告行 */
.novel-page__inline-ad { margin-bottom: clamp(14px, 3vw, 22px); }
.novel-page__ad-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.novel-page__ad-card {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--site-border);
  border-radius: 12px;
  background: var(--site-surface-muted);
  text-decoration: none;
}
.novel-page__ad-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.novel-page__ad-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgb(0 0 0 / 55%);
  color: #fff;
  font-size: .64rem;
  font-weight: 700;
}

@media (min-width: 760px) {
  .novel-page { --novel-card-min-width: 150px; --novel-card-gap: 14px; }
}
@media (min-width: 1200px) {
  .novel-page { --novel-card-min-width: 168px; --novel-card-gap: 16px; }
}

/* ---- NovelCard ---- */
.novel-card {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--site-border);
  border-radius: 13px;
  background: var(--site-surface);
  box-shadow: 0 6px 18px #14121e0f;
  color: inherit;
  font: inherit;
  outline: none;
  text-align: left;
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.novel-card__cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--site-surface-muted);
}
.novel-card__cover .vv-image,
.novel-card__cover .vv-image__element {
  width: 100%;
  height: 100%;
}
.novel-card__cover .vv-image__element {
  transition: transform .18s ease;
}
.novel-card__status {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #121018b3;
  color: #fff;
  font-size: .64rem;
  font-weight: 700;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.novel-card__body {
  display: grid;
  padding: 9px;
  gap: 5px;
}
.novel-card__body strong {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  font-size: .82rem;
  line-height: 1.45;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.novel-card__meta,
.novel-card__chapter {
  margin: 0;
  color: var(--vv-color-muted);
  font-size: .68rem;
}
.novel-card__meta {
  display: flex;
  min-width: 0;
  gap: 6px;
}
.novel-card__meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.novel-card__chapter {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.novel-card:focus-visible {
  border-color: color-mix(in srgb, var(--site-accent) 45%, var(--site-border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--site-accent) 18%, transparent), 0 12px 28px #14121e1c;
}
@media (hover: hover) {
  .novel-card:hover {
    border-color: color-mix(in srgb, var(--site-accent) 38%, var(--site-border));
    box-shadow: 0 12px 28px #14121e1c;
    transform: translateY(-2px);
  }
  .novel-card:hover .novel-card__cover .vv-image__element {
    transform: scale(1.035);
  }
}
@media (min-width: 760px) {
  .novel-card__body { padding: 11px; }
  .novel-card__body strong { font-size: .88rem; }
}
@media (prefers-reduced-motion: reduce) {
  .novel-card,
  .novel-card__cover .vv-image__element { transition: none; }
}

/* ---- Pagination（本页最小） ---- */
.vv-pagination {
  --vv-pagination-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.vv-pagination__button,
.vv-pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--vv-pagination-height);
  border: 1px solid var(--vv-color-border);
  border-radius: 10px;
  background: var(--vv-color-surface);
  color: var(--vv-color-text);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}
.vv-pagination__button {
  min-width: 76px;
  padding-inline: 14px;
  font-weight: 650;
}
.vv-pagination__page {
  gap: 6px;
  width: 92px;
  color: var(--vv-color-primary);
  font-weight: 700;
}
.vv-pagination__page--static { cursor: default; }
.vv-pagination__button.is-disabled,
.vv-pagination__button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .46;
  pointer-events: none;
}
.vv-pagination__button:hover:not(.is-disabled),
.vv-pagination__button:focus-visible {
  border-color: var(--vv-color-primary);
  background: color-mix(in srgb, var(--vv-color-primary) 7%, var(--vv-color-surface));
  color: var(--vv-color-primary);
}

/* ---- NovelDetail ---- */
.novel-detail-page__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(30px, 5vw, 54px);
}
.novel-detail-page__hero {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(22px, 4vw, 48px);
}
.novel-detail-page__cover {
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--site-border);
  border-radius: clamp(16px, 2vw, 24px);
  background: var(--site-surface-muted);
  box-shadow: 0 20px 50px #14121e26;
}
.novel-detail-page__cover .vv-image,
.novel-detail-page__cover .vv-image__element {
  width: 100%;
  height: 100%;
}
.novel-detail-page__summary {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 15px;
}
.novel-detail-page__eyebrow,
.novel-detail-page__summary h1,
.novel-detail-page__intro { margin: 0; }
.novel-detail-page__eyebrow {
  color: var(--site-accent);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .15em;
}
.novel-detail-page__summary h1 {
  font-size: clamp(1.65rem, 4vw, 2.8rem);
  line-height: 1.18;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.novel-detail-page__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.novel-detail-page__badges span {
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--site-accent-soft);
  color: var(--site-accent-strong);
  font-size: .72rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.novel-detail-page__metadata {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  gap: 9px 18px;
}
.novel-detail-page__metadata div {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.novel-detail-page__metadata dt {
  color: var(--vv-color-muted);
  font-size: .68rem;
  white-space: nowrap;
}
.novel-detail-page__metadata dd {
  overflow: hidden;
  min-width: 0;
  margin: 0;
  font-size: .82rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.novel-detail-page__intro {
  max-width: 68ch;
  color: var(--vv-color-muted);
  font-size: .9rem;
  line-height: 1.85;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.novel-detail-page__intro.is-empty { font-style: italic; }
.novel-detail-page__primary-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-width: 130px;
  min-height: 44px;
  padding: 10px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--site-accent-gradient);
  box-shadow: 0 12px 28px var(--site-accent-shadow);
  color: #fff;
  font-size: .88rem;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}
.novel-detail-page__primary-action.is-disabled {
  background: var(--site-surface-muted);
  box-shadow: none;
  color: var(--vv-color-muted);
  cursor: not-allowed;
}
.novel-detail-page__chapter-count {
  color: var(--vv-color-muted);
  font-size: .76rem;
}
.novel-detail-page__chapters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.novel-detail-page__chapter {
  appearance: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--site-border);
  border-radius: 11px;
  background: var(--site-surface);
  color: inherit;
  cursor: pointer;
  font: inherit;
  gap: 9px;
  text-align: left;
  text-decoration: none;
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}
.novel-detail-page__chapter > span {
  color: var(--site-accent);
  font-size: .64rem;
  font-weight: 800;
}
.novel-detail-page__chapter strong {
  overflow: hidden;
  font-size: .78rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.novel-detail-page__empty-directory {
  margin: 0;
  padding: 32px 20px;
  border-radius: 14px;
  background: var(--site-surface-muted);
  color: var(--vv-color-muted);
  text-align: center;
}
@media (hover: hover) {
  .novel-detail-page__chapter:hover,
  .novel-detail-page__chapter:focus-visible {
    border-color: color-mix(in srgb, var(--site-accent) 42%, var(--site-border));
    outline: none;
    background: var(--site-accent-soft);
    transform: translateY(-1px);
  }
}
@media (max-width: 900px) {
  .novel-detail-page__chapters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .novel-detail-page__hero {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 14px;
  }
  .novel-detail-page__cover { border-radius: 13px; }
  .novel-detail-page__summary { gap: 9px; }
  .novel-detail-page__eyebrow { font-size: .62rem; }
  .novel-detail-page__summary h1 { font-size: 1.22rem; }
  .novel-detail-page__metadata {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }
  .novel-detail-page__metadata div {
    grid-template-columns: 4em minmax(0, 1fr);
    align-items: baseline;
    font-size: .68rem;
    gap: 8px;
  }
  .novel-detail-page__metadata div:nth-child(n+3) { display: none; }
  .novel-detail-page__intro {
    grid-column: 1 / -1;
    font-size: .82rem;
    line-height: 1.7;
  }
  .novel-detail-page__primary-action {
    grid-column: 1 / -1;
    justify-self: stretch;
    min-height: 42px;
  }
  .novel-detail-page__chapters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .novel-detail-page__chapter { transition: none; }
}

/* ---- 专页弹窗广告（只作用 [data-k-novel-popup-ad]；不改壳层/底栏/tokens） ----
   无素材：twig 出 hidden 空槽；有素材：可关弹层，遮罩止于底栏上方且 z < #k-tabbar(75)。
   卡片背景透明 + 不锁 aspect，避免浅色「下半白」大破图。 */
body:has(.novel-page) .lulu-ad-slot--popup,
body:has(.novel-detail-page) .lulu-ad-slot--popup {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}
[data-k-novel-popup-ad] {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  /* 遮罩不铺进底栏区域；再以 z-index 70 < tabbar 75 双保险 */
  bottom: var(--k-bottom-chrome-h, var(--site-bottom-nav-space, 64px));
  z-index: 70;
  place-items: center;
  padding: 24px 24px 16px;
  box-sizing: border-box;
  background: rgb(8 10 18 / 62%);
  pointer-events: none;
}
[data-k-novel-popup-ad].is-visible,
[data-k-novel-popup-ad]:has(.vv-ad-slot__card) {
  display: grid;
  pointer-events: auto;
}
[data-k-novel-popup-ad][hidden] {
  display: none !important;
  pointer-events: none !important;
}
[data-k-novel-popup-ad] .vv-ad-slot__card {
  position: relative;
  width: min(78vw, 320px);
  max-width: 100%;
  max-height: min(70vh, calc(100% - 32px));
  overflow: hidden;
  border-radius: 16px;
  background: transparent; /* 对齐源站 vv-ad-popup__card；避免浅色表面露出「下半白」 */
  box-shadow: 0 24px 60px #00000066;
  pointer-events: auto;
}
[data-k-novel-popup-ad] .vv-ad-slot__card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(70vh, calc(100% - 32px));
  object-fit: contain;
  vertical-align: top;
  background: transparent;
}
[data-k-novel-popup-ad] .vv-ad-slot__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  background: rgb(16 18 24 / 72%);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}


/* 浅色主题：封面 muted 对齐源站 rgb(24 28 42 / 5%)；避免 --k-surface-1=#fff 导致封面空白 */
html.light .novel-page,
html.light .novel-detail-page,
html.light .novel-inner-page,
html.light .novel-reader-page,
html.light .lulu-novel-compact {
  --site-surface-muted: var(--k-surface-muted, rgb(24 28 42 / 5%));
}


/* ---- 内页紧凑顶栏 / 阅读壳（不改 tokens / lulu-chrome / top_nav） ---- */
/* 详情/阅读：顶栏与内容列同一 --k-page-max / 安全区。不改列表页 .novel-page 沟槽。 */
.novel-inner-page,
.novel-reader-page,
.novel-inner-page .novel-detail-page {
  --vv-page-layout-gutter: clamp(16px, 4vw, 32px);
  --site-page-max-width: var(--k-page-max, 1180px);
  --vv-page-layout-max-width: var(--site-page-max-width);
}
.lulu-novel-compact {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  background: var(--k-surface, #151823);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom: 0;
  color: var(--vv-color-text, var(--k-text, #1a1d28));
}
html.light .lulu-novel-compact:not(.lulu-novel-compact--reader) {
  background: #fff;
}
.lulu-novel-compact__inner {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--k-page-max, 1180px);
  margin-inline: auto;
  padding-inline: var(--vv-page-layout-gutter, clamp(16px, 4vw, 32px));
}
.lulu-novel-compact__bar {
  display: grid;
  min-height: 56px;
  align-items: center;
  grid-template-columns: 84px minmax(0, 1fr) 84px;
}
.lulu-novel-compact--reader .lulu-novel-compact__bar {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  min-height: 56px;
  column-gap: 2px;
}
.lulu-novel-compact--reader {
  background: var(--lulu-paper-chrome, #e6e1d7);
  border-bottom: 1px solid var(--lulu-paper-border, rgb(47 42 34 / 10%));
  color: var(--lulu-paper-text, #2f2a22);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.lulu-novel-compact__titles {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 8px 4px 8px 0;
  gap: 1px;
  grid-row: 1;
  grid-column: 2;
}
.lulu-novel-compact__book {
  overflow: hidden;
  color: var(--lulu-paper-muted, #8a8478);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lulu-novel-compact__chapter {
  overflow: hidden;
  color: var(--lulu-paper-text, #2f2a22);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lulu-novel-compact--reader .lulu-novel-compact__progress {
  color: var(--lulu-paper-muted, #8a8478);
  font-size: 12px;
  font-weight: 500;
}
.lulu-novel-compact__title {
  grid-row: 1;
  grid-column: 2;
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--vv-color-text, var(--k-text, #1a1d28));
}
.lulu-novel-compact__actions {
  display: flex;
  justify-self: end;
  gap: 6px;
  grid-row: 1;
  grid-column: 3;
}
.lulu-novel-compact__progress {
  grid-row: 1;
  grid-column: 3;
  justify-self: end;
  padding-left: 8px;
  color: var(--vv-color-muted, var(--k-text-muted, #6b7280));
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.lulu-novel-compact__btn {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--vv-color-text, #1a1d28) 8%, transparent);
  color: inherit;
  cursor: pointer;
  font-size: 19px;
  text-decoration: none;
}
.lulu-novel-compact__btn.is-back {
  justify-self: start;
  grid-row: 1;
  grid-column: 1;
  background: transparent;
}
.lulu-novel-compact__btn.is-back svg { width: 22px; height: 22px; }
.lulu-novel-compact__btn:not(.is-back) svg { width: 20px; height: 20px; }
.lulu-novel-compact__btn svg {
  display: block;
  flex: 0 0 auto;
  opacity: 1;
}
.lulu-novel-compact__btn:hover,
.lulu-novel-compact__btn:focus-visible {
  background: var(--site-accent-soft, rgb(255 93 121 / 14%));
  outline: none;
  color: var(--site-accent, #ff5d79);
}
@media (max-width: 640px) {
  .lulu-novel-compact__bar {
    min-height: 48px;
    grid-template-columns: 72px minmax(0, 1fr) 72px;
  }
  .lulu-novel-compact--reader .lulu-novel-compact__bar {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    min-height: 56px;
  }
}

.novel-reader-page {
  --lulu-paper-bg: #f7f3e6;
  --lulu-paper-chrome: #e6e1d7;
  --lulu-paper-text: #2f2a22;
  --lulu-paper-muted: #8a8478;
  --lulu-paper-border: rgb(47 42 34 / 10%);
  --lulu-reader-font: 18px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  color: var(--lulu-paper-text);
  background: var(--lulu-paper-bg);
}
.novel-reader-page[data-lulu-reader-theme="day"] {
  --lulu-paper-bg: #f5f6fa;
  --lulu-paper-chrome: #eceef3;
  --lulu-paper-text: #1a1d28;
  --lulu-paper-muted: #6b7280;
  --lulu-paper-border: rgb(24 28 42 / 10%);
}
.novel-reader-page[data-lulu-reader-theme="green"] {
  --lulu-paper-bg: #e7f0dc;
  --lulu-paper-chrome: #d9e4cc;
  --lulu-paper-text: #2a3320;
  --lulu-paper-muted: #6b7560;
  --lulu-paper-border: rgb(42 51 32 / 12%);
}
.novel-reader-page[data-lulu-reader-theme="night"] {
  --lulu-paper-bg: #1a1814;
  --lulu-paper-chrome: #241f1a;
  --lulu-paper-text: #e8e4d9;
  --lulu-paper-muted: #a39e90;
  --lulu-paper-border: rgb(255 255 255 / 10%);
  --vv-color-text: #e8e4d9;
  --vv-color-muted: #a39e90;
  --k-bg: #1a1814;
  --k-text: #e8e4d9;
  --site-border: rgb(255 255 255 / 10%);
  --site-surface: #24211b;
  color-scheme: dark;
}
.novel-reader-page__body {
  box-sizing: border-box;
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  padding: 16px 28px 20px;
}
.novel-reader-page__title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.novel-reader-page__content {
  font-size: var(--lulu-reader-font, 18px);
  line-height: 1.75;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}
.novel-reader-page__content p { margin: 0 0 1.05em; }
.novel-reader-page__note {
  margin: 16px 0 0;
  color: var(--vv-color-muted, var(--k-text-muted, #6b7280));
  font-size: 0.9rem;
}
.novel-reader-page__pages {
  display: grid;
  gap: 0;
}
.novel-reader-page__img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--site-surface-muted, rgb(24 28 42 / 5%));
}

.lulu-novel-reader__bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  min-height: 52px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--lulu-paper-border, rgb(47 42 34 / 10%));
  background: var(--lulu-paper-chrome, #e6e1d7);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: var(--lulu-paper-text, #2f2a22);
}
.lulu-novel-reader__bar-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 48px;
  padding: 0 2px;
  border: 0;
  background: none;
  color: color-mix(in srgb, var(--lulu-paper-text, #2f2a22) 78%, var(--lulu-paper-muted, #8a8478));
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
}
.lulu-novel-reader__bar-item.is-disabled,
.lulu-novel-reader__bar-item[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}
.lulu-novel-reader__bar-item[aria-pressed="true"] {
  color: var(--site-accent, #ff5d79);
}

/* 顶栏背景铺满视口；内层与下方专页同一 --k-page-max 对齐。不改 chrome/shell。
   详情不再给底栏留空；阅读底栏 fixed 自行占位。 */
#app-main:has(> .novel-inner-page),
#app-main:has(> .novel-reader-page),
#app-main:has(> .novel-detail-page) {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
  padding-bottom: calc(16px + var(--k-safe-bottom, 0px));
}
#app-main:has(> .novel-reader-page) {
  padding-bottom: 0;
}

body:has(.novel-inner-page) .lulu-ad-slot--popup,
body:has(.novel-reader-page) .lulu-ad-slot--popup {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

/* 阅读专页自持底部 chrome：保留底飘，但广告/遮罩须在操作栏上方。
   壳层只识别 #k-tabbar；hide_tabbar 时会把广告放回 bottom:0。
   单处 #app-main 占位，勿叠正文/页面根 padding。离开阅读页自动失效。 */
html:has(.novel-reader-page) {
  --lulu-reader-safe-bottom: env(safe-area-inset-bottom, 0px);
  --lulu-reader-bar-h: calc(52px + var(--lulu-reader-safe-bottom));
  --lulu-reader-ad-h: 0px;
  scroll-padding-bottom: calc(var(--lulu-reader-bar-h) + var(--lulu-reader-ad-h));
}
html:has(.novel-reader-page):has(#bottom_ads:not([hidden])) {
  --lulu-reader-ad-h: var(--k-bottom-ads-h, 120px);
}
html:has(.novel-reader-page) #bottom_ads,
html:has(.novel-reader-page) body::after {
  bottom: var(--lulu-reader-bar-h) !important;
}
html:has(.novel-reader-page) .lulu-novel-reader__bar {
  box-sizing: border-box;
  height: var(--lulu-reader-bar-h);
  padding-bottom: var(--lulu-reader-safe-bottom);
}
html:has(#app-main > .novel-reader-page) #app-main {
  padding-bottom: calc(var(--lulu-reader-bar-h) + var(--lulu-reader-ad-h)) !important;
}
html:has(.novel-reader-page) .novel-reader-page__body {
  padding-bottom: 20px;
}

/* 阅读工具图标只占现有按钮内部空间，不增加底部 chrome 高度。 */
.novel-reader-page .lulu-novel-reader__bar-item { gap: 5px; }
.novel-reader-page [data-lulu-reader-icon] { display: inline-flex; }
.novel-reader-page [data-lulu-reader-icon][hidden] { display: none; }

/* 纸张/夜间状态挂在阅读 root；广告/页脚是其兄弟，须按 :has 覆盖外层表面。
   不修改全站主题变量，不对广告图片/素材施加滤镜或反色。 */
html:has(.novel-reader-page[data-lulu-reader-theme="paper"]) {
  --lulu-paper-bg: #f7f3e6;
  --lulu-paper-chrome: #e6e1d7;
  --lulu-paper-text: #2f2a22;
  --lulu-paper-muted: #8a8478;
  --lulu-paper-border: rgb(47 42 34 / 10%);
}
html:has(.novel-reader-page[data-lulu-reader-theme="paper"]),
html:has(.novel-reader-page[data-lulu-reader-theme="paper"]) :is(body, #k-shell, #k-main, #app-main, .k-ads-all, .k-ads-all__inner, #bottom_ads, .site-footer) {
  background-color: #f7f3e6;
  border-color: rgb(47 42 34 / 10%);
  color: #2f2a22;
}
html:has(#app-main > .novel-reader-page[data-lulu-reader-theme="paper"]) body::after {
  background-color: #f7f3e6;
}
html:has(.novel-reader-page[data-lulu-reader-theme="day"]) {
  --lulu-paper-bg: #f5f6fa;
  --lulu-paper-chrome: #eceef3;
  --lulu-paper-text: #1a1d28;
  --lulu-paper-muted: #6b7280;
  --lulu-paper-border: rgb(24 28 42 / 10%);
}
html:has(.novel-reader-page[data-lulu-reader-theme="day"]),
html:has(.novel-reader-page[data-lulu-reader-theme="day"]) :is(body, #k-shell, #k-main, #app-main, .k-ads-all, .k-ads-all__inner, #bottom_ads, .site-footer) {
  background-color: #f5f6fa;
  border-color: rgb(24 28 42 / 10%);
  color: #1a1d28;
}
html:has(#app-main > .novel-reader-page[data-lulu-reader-theme="day"]) body::after {
  background-color: #f5f6fa;
}
html:has(.novel-reader-page[data-lulu-reader-theme="green"]) {
  --lulu-paper-bg: #e7f0dc;
  --lulu-paper-chrome: #d9e4cc;
  --lulu-paper-text: #2a3320;
  --lulu-paper-muted: #6b7560;
  --lulu-paper-border: rgb(42 51 32 / 12%);
}
html:has(.novel-reader-page[data-lulu-reader-theme="green"]),
html:has(.novel-reader-page[data-lulu-reader-theme="green"]) :is(body, #k-shell, #k-main, #app-main, .k-ads-all, .k-ads-all__inner, #bottom_ads, .site-footer) {
  background-color: #e7f0dc;
  border-color: rgb(42 51 32 / 12%);
  color: #2a3320;
}
html:has(#app-main > .novel-reader-page[data-lulu-reader-theme="green"]) body::after {
  background-color: #e7f0dc;
}
html:has(.novel-reader-page[data-lulu-reader-theme="night"]) {
  --lulu-paper-bg: #1a1814;
  --lulu-paper-chrome: #241f1a;
  --lulu-paper-text: #e8e4d9;
  --lulu-paper-muted: #a39e90;
  --lulu-paper-border: rgb(255 255 255 / 10%);
}
html:has(.novel-reader-page[data-lulu-reader-theme="night"]),
html:has(.novel-reader-page[data-lulu-reader-theme="night"]) :is(body, #k-shell, #k-main, #app-main, .k-ads-all, .k-ads-all__inner, #bottom_ads, .site-footer) {
  background-color: #1a1814;
  border-color: rgb(255 255 255 / 10%);
  color: #e8e4d9;
}
html:has(#app-main > .novel-reader-page[data-lulu-reader-theme="night"]) body::after {
  background-color: #1a1814;
}
html:has(.novel-reader-page[data-lulu-reader-theme]) :is(.k-ads-all, #bottom_ads) :is(a, picture) {
  background-color: transparent;
}

/* 章节目录 / 纸张：掩层 + 自底部滑出，不上全屏、不居中切正文。配色跟随当前纸张。 */
.lulu-reader-toc,
.lulu-reader-paper {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
}
.lulu-reader-toc.is-open,
.lulu-reader-paper.is-open { pointer-events: auto; }
.lulu-reader-toc[hidden],
.lulu-reader-paper[hidden] { display: none; }
.lulu-reader-toc.is-open[hidden],
.lulu-reader-paper.is-open[hidden] { display: block; }
.lulu-reader-toc__mask,
.lulu-reader-paper__mask {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: rgb(20 16 14 / 45%);
  opacity: 0;
  cursor: pointer;
  transition: opacity .28s ease;
}
.lulu-reader-toc.is-open .lulu-reader-toc__mask,
.lulu-reader-paper.is-open .lulu-reader-paper__mask { opacity: 1; }
.novel-reader-page[data-lulu-reader-theme="night"] .lulu-reader-toc__mask,
.novel-reader-page[data-lulu-reader-theme="night"] .lulu-reader-paper__mask {
  background: rgb(0 0 0 / 55%);
}
html:has(.novel-reader-page[data-lulu-reader-theme="night"]) :is(.lulu-reader-toc__mask, .lulu-reader-paper__mask) {
  background: rgb(0 0 0 / 55%);
}

.lulu-reader-toc__sheet,
.lulu-reader-paper__sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  max-height: min(68vh, calc(100dvh - 88px));
  background: var(--lulu-paper-chrome, #e6e1d7);
  color: var(--lulu-paper-text, #2f2a22);
  border-top: 1px solid var(--lulu-paper-border, rgb(47 42 34 / 10%));
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -8px 32px rgb(20 16 14 / 18%);
  transform: translateY(100%);
  transition: transform .28s ease;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.lulu-reader-toc.is-open .lulu-reader-toc__sheet,
.lulu-reader-paper.is-open .lulu-reader-paper__sheet { transform: translateY(0); }
.lulu-reader-toc__head,
.lulu-reader-paper__head {
  display: flex;
  flex-shrink: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--lulu-paper-border, rgb(47 42 34 / 10%));
}
.lulu-reader-toc__heading { min-width: 0; }
.lulu-reader-toc__eyebrow {
  margin: 0;
  color: var(--lulu-paper-muted, #8a8478);
  font-size: .62rem;
  font-weight: 650;
  letter-spacing: .08em;
}
.lulu-reader-toc__title,
.lulu-reader-paper__title {
  margin: 2px 0 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}
.lulu-reader-toc__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin: 6px 0 0;
  color: var(--lulu-paper-muted, #8a8478);
  font-size: .75rem;
}
.lulu-reader-toc__work {
  overflow: hidden;
  max-width: 100%;
  color: var(--lulu-paper-text, #2f2a22);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lulu-reader-toc__close,
.lulu-reader-paper__close {
  flex-shrink: 0;
  margin: 0;
  padding: 6px 4px;
  border: 0;
  background: none;
  color: var(--site-accent, #ff5d79);
  cursor: pointer;
  font: inherit;
  font-size: .88rem;
  font-weight: 650;
}
.lulu-reader-toc__list {
  overflow: auto;
  min-height: 0;
  padding: 4px 8px 16px;
  -webkit-overflow-scrolling: touch;
}
.lulu-reader-toc__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 13px 8px;
  border-bottom: 1px solid var(--lulu-paper-border, rgb(47 42 34 / 10%));
  color: inherit;
  text-decoration: none;
}
.lulu-reader-toc__index {
  color: var(--site-accent, #ff5d79);
  font-size: .72rem;
  font-weight: 800;
}
.lulu-reader-toc__name {
  overflow: hidden;
  font-size: .92rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lulu-reader-toc__item.is-current,
.lulu-reader-toc__item.is-current .lulu-reader-toc__name,
.lulu-reader-toc__item.is-current .lulu-reader-toc__index {
  color: var(--site-accent, #ff5d79);
}
.lulu-reader-toc__empty {
  margin: 0;
  padding: 28px 16px;
  color: var(--lulu-paper-muted, #8a8478);
  text-align: center;
}
.lulu-reader-paper__options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 16px 20px;
}
.lulu-reader-paper__option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
}
.lulu-reader-paper__swatch {
  box-sizing: border-box;
  width: 48px;
  height: 48px;
  border: 2px solid var(--lulu-paper-border, rgb(47 42 34 / 16%));
  border-radius: 50%;
}
.lulu-reader-paper__swatch[data-paper="day"] { background: #f5f6fa; }
.lulu-reader-paper__swatch[data-paper="paper"] { background: #f7f3e6; }
.lulu-reader-paper__swatch[data-paper="green"] { background: #e7f0dc; }
.lulu-reader-paper__swatch[data-paper="night"] { background: #1a1814; }
.lulu-reader-paper__option.is-active .lulu-reader-paper__swatch {
  border-color: var(--site-accent, #ff5d79);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--site-accent, #ff5d79) 28%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  .lulu-reader-toc__mask,
  .lulu-reader-paper__mask,
  .lulu-reader-toc__sheet,
  .lulu-reader-paper__sheet { transition: none; }
}


/* 频道首页 + 分页列表：写死 2/3/4/6 列，避开 auto-fit 末行留空。
   条数按 12 的倍数取（热门 12 / 最新 24 / 分类 12 / per_page 24）整除。封面竖版 3:4。 */
.novel-page .novel-page__card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--novel-card-gap, 10px);
}

@media (min-width: 521px) {
  .novel-page .novel-page__card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 700px) {
  .novel-page .novel-page__card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .novel-page .novel-page__card-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
