@font-face {
  font-family: "ShortSite UI";
  src: local("Noto Sans SC"), local("Microsoft YaHei UI"), local("Microsoft YaHei");
  font-display: swap;
}

:root {
  --brand: #e96363;
  --brand-active: #d94242;
  --brand-soft: #ef8f8f;
  --brand-pale: #ffd9d9;
  --page-bg: #fff6f6;
  --surface: #ffffff;
  --text: #222222;
  --text-secondary: #555555;
  --text-muted: #888888;
  --border: #dddddd;
  --border-soft: #efefef;
  --success: #2eb82e;
  --complete: #3377ff;
  --reader-paper: #fff9f7;
  --reader-moss: #e5eadf;
  --reader-night: #171918;
  --shadow-card: 0 0 6px rgb(0 0 0 / 15%);
  --shadow-header: 0 2px 4px rgb(0 0 0 / 10%);
  --sans: "ShortSite UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, SimSun, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--page-bg);
  font-family: var(--sans);
  line-height: 1.55;
}
body:not(.reader-page) { padding-bottom: 0; }
main { min-height: calc(100vh - 152px); padding-top: 84px; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
:focus-visible { outline: 3px solid rgb(227 54 54 / 40%); outline-offset: 3px; }
.shell { width: 1200px; margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.text-link { color: var(--brand-active); font-weight: 700; }
[hidden] { display: none !important; }

.site-header {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto;
  height: 64px;
  background: var(--surface);
  box-shadow: var(--shadow-header);
}
.masthead { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; position: relative; z-index: 2; background: var(--surface); }
.brand { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 9px; min-width: 152px; }
.brand-mark { position: relative; width: 36px; height: 36px; transform: rotate(-9deg); }
.brand-mark i { position: absolute; left: 14px; top: 2px; width: 10px; height: 16px; border-radius: 80% 20% 70% 30%; background: linear-gradient(150deg, #f8b8c0, var(--brand)); transform-origin: 5px 16px; }
.brand-mark i:nth-child(2) { transform: rotate(72deg); }
.brand-mark i:nth-child(3) { transform: rotate(144deg); }
.brand-mark i:nth-child(4) { transform: rotate(216deg); }
.brand-mark i:nth-child(5) { transform: rotate(288deg); }
.brand-mark::after { content: ""; position: absolute; left: 14px; top: 14px; width: 9px; height: 9px; border-radius: 50%; background: #fff5c7; box-shadow: 0 0 0 2px rgb(233 99 99 / 22%); }
.brand-copy { display: grid; line-height: 1.1; }
.brand-copy strong { color: #674346; font: 800 1.24rem/1.1 var(--serif); letter-spacing: .06em; white-space: nowrap; }
.brand-copy small { max-width: 150px; margin-top: 4px; overflow: hidden; color: var(--text-muted); font-size: .56rem; white-space: nowrap; text-overflow: ellipsis; }
.desktop-nav { display: flex; align-self: stretch; align-items: center; gap: 2px; margin-right: auto; }
.desktop-nav a { position: relative; height: 64px; display: grid; place-items: center; padding: 0 14px; color: var(--text); font-size: .9rem; text-shadow: 0 0 5px rgb(0 0 0 / 10%); transition: color .18s ease; }
.desktop-nav a:hover, .desktop-nav a.active { color: var(--brand); }
.desktop-nav a.active { font-size: 1rem; }
.desktop-nav a.active::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 12px; height: 3px; border-radius: 2px; background: var(--brand); transform: translateX(-50%); }
.header-search { flex: 0 0 170px; height: 40px; display: flex; align-items: center; border: 1px solid #d9d9d9; border-radius: 20px; background: var(--surface); transition: border-color .18s ease; }
.header-search:focus-within, .header-search:hover { border-color: var(--brand); }
.header-search input { min-width: 0; width: 126px; height: 100%; border: 0; padding: 0 4px 0 15px; color: var(--text); background: transparent; outline: 0; font-size: .82rem; }
.header-search button { flex: 0 0 38px; height: 38px; border: 0; padding: 7px; border-radius: 50%; background: url("../images/theme-model-2/search.png") center / 24px no-repeat; cursor: pointer; }
.quick-nav { position: absolute; z-index: 1; top: 54px; left: 50%; width: 1200px; border: 2px solid var(--brand-pale); background: var(--surface); box-shadow: var(--shadow-header); opacity: 0; visibility: hidden; transform: translate(-50%, -12px); transition: opacity .18s ease, transform .18s ease, visibility .18s; }
.site-header:hover .quick-nav, .site-header:focus-within .quick-nav { opacity: 1; visibility: visible; transform: translate(-50%, 10px); }
.quick-nav-track { width: auto; display: flex; align-items: center; padding: 8px; }
.quick-nav a { padding: 7px 16px; color: var(--text-secondary); font-size: .82rem; }
.quick-nav a:hover { color: var(--brand); text-decoration: underline; }

.mobile-nav { display: none; }
.site-footer { margin-top: 20px; border-bottom: 1px solid #d8d8d8; background: #f7f7f7; }
.footer-grid { min-height: 102px; display: flex; align-items: center; justify-content: center; padding: 20px 16px; }
.footer-grid nav { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 16px 28px; }
.footer-grid a { color: #111; font: 400 1.05rem/1.5 var(--serif); }
.footer-grid a:hover { color: var(--brand); }

.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 6px; padding: 8px 16px; cursor: pointer; font-weight: 700; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; border-color: var(--brand); background: var(--brand); }
.button.primary:hover { border-color: var(--brand-active); background: var(--brand-active); }
.button.secondary { color: var(--brand); border-color: var(--brand); background: var(--surface); }
.button.secondary:hover, .button.secondary[data-active="true"] { color: #fff; background: var(--brand); }

.section-heading { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.section-heading h1, .section-heading h2 { position: relative; min-height: 38px; display: flex; align-items: center; margin: 0; border: 2px solid #fff; border-radius: 20px; padding: 7px 16px 7px 46px; color: var(--brand); background: var(--surface) url("../images/theme-model-2/icon1.png") left center / 38px no-repeat; box-shadow: var(--shadow-card); font-size: 1.1rem; line-height: 1; font-weight: 700; }
.section-heading a { position: relative; padding: 8px 14px 8px 8px; font-size: .82rem; }
.section-heading a::after { content: ""; position: absolute; right: 2px; top: 12px; width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }
.section-heading a:hover { color: var(--brand); }
.section-heading.compact { justify-content: flex-start; }

.featured-section { --slide-width: 248px; width: 1200px; padding-top: 0; }
.featured-carousel { position: relative; overflow: hidden; border: 1px solid var(--border-soft); border-radius: 8px; background: radial-gradient(ellipse at 50% 4%, #fff 0, transparent 60%), linear-gradient(110deg, #fbe9e9, #fff9f7 48%, #f8e6e4); box-shadow: var(--shadow-card); }
.featured-viewport { overflow: hidden; padding: 28px 0 60px; }
.featured-track.is-resetting { transition: none; }
.featured-track { display: flex; gap: 76px; align-items: stretch; padding-inline: calc((100% - var(--slide-width)) / 2); will-change: transform; transition: transform .55s ease; }
.featured-slide { flex: 0 0 var(--slide-width); min-width: 0; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 5px; background: var(--surface); box-shadow: 0 14px 28px rgb(85 42 42 / 17%); transition: transform .45s ease, opacity .45s ease, box-shadow .45s ease; }
.featured-slide:not(.is-active) { transform: scale(.9); opacity: .8; box-shadow: 0 8px 18px rgb(85 42 42 / 12%); }
.featured-cover, .featured-cover img { display: block; width: 100%; height: 100%; }
.featured-cover img { object-fit: cover; }
.featured-controls { position: absolute; inset: 0; pointer-events: none; }
.featured-controls > button { position: absolute; z-index: 3; top: 45%; width: 46px; height: 46px; transform: translateY(-50%); border: 1px solid rgb(233 99 99 / 14%); border-radius: 50%; color: var(--brand-active); background: #fff; box-shadow: 0 5px 16px rgb(85 42 42 / 12%); font-size: 1.8rem; line-height: 1; cursor: pointer; pointer-events: auto; }
.featured-controls > button:hover { color: #fff; background: var(--brand-active); }
.featured-controls > button[data-carousel-previous] { left: 30px; }
.featured-controls > button[data-carousel-next] { right: 30px; }
.featured-dots { position: absolute; bottom: 20px; left: 50%; display: flex; gap: 7px; align-items: center; transform: translateX(-50%); pointer-events: auto; }
.featured-dots button { width: 7px; height: 7px; border: 0; border-radius: 10px; padding: 0; background: #d2d7de; cursor: pointer; transition: width .18s ease, background .18s ease; }
.featured-dots button[aria-pressed="true"] { width: 25px; background: var(--brand); }
[data-slide-count="1"] .featured-controls { display: none; }

.continue-strip { min-height: 76px; display: grid; grid-template-columns: 42px 1fr auto; gap: 16px; align-items: center; margin-top: 20px; padding: 12px 20px; border: 1px solid var(--border-soft); border-left: 4px solid var(--brand); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-card); }
.continue-badge { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--brand); font-weight: 800; }
.continue-strip small, .continue-strip p { margin: 0; color: var(--text-muted); font-size: .72rem; }
.continue-strip h2 { margin: 1px 0 0; font-size: 1rem; }

.category-panel, .book-section { margin-top: 20px; }
.category-panel { padding: 16px; border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-card); }
.category-panel .section-heading { margin-bottom: 8px; }
.category-panel .section-heading h2 { border: 0; padding: 4px 0; background: none; box-shadow: none; font-size: .96rem; }
.category-links { display: flex; flex-wrap: wrap; gap: 8px; }
.category-links a { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; border-radius: 4px; padding: 6px 12px; color: var(--text-secondary); background: var(--border-soft); font-size: .78rem; }
.category-links a:hover { color: #fff; background: var(--brand); }
.category-links small { opacity: .68; }

.book-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.book-card { min-width: 0; height: 176px; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; padding: 10px; border: 1px solid var(--border-soft); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-card); transition: border-color .18s ease, transform .18s ease; }
.book-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.book-cover-link { position: relative; min-width: 0; overflow: hidden; border-radius: 4px; }
.book-cover { width: 112px; height: 148px; object-fit: cover; background: #f3eeee; transition: transform .25s ease; }
.book-card:hover .book-cover { transform: scale(1.035); }
.status-stamp { position: absolute; left: 0; bottom: 0; padding: 5px 7px; color: #fff; font-size: .66rem; line-height: 1; }
.status-stamp.serial, .detail-cover .serial { background: var(--success); }
.status-stamp.finished, .detail-cover .finished { background: var(--complete); }
.book-card-copy { min-width: 0; display: flex; flex-direction: column; }
.book-card h3 { margin: 0 0 4px; overflow: hidden; font: 800 .94rem/1.35 var(--serif); white-space: nowrap; text-overflow: ellipsis; }
.book-card h3 a:hover { color: var(--brand); }
.book-author { margin: 0 0 5px; overflow: hidden; color: var(--text-muted); font-size: .7rem; white-space: nowrap; text-overflow: ellipsis; }
.book-intro { margin: 0; overflow: hidden; color: var(--text-secondary); font-size: .72rem; line-height: 1.55; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.book-card-meta { display: flex; flex-wrap: wrap; gap: 5px 9px; margin: auto 0 0; color: var(--brand); font-size: .65rem; }
.book-card-meta span:not(:first-child) { color: var(--text-secondary); }
.update-section { margin-bottom: 20px; }

.page-heading { min-height: 72px; display: flex; align-items: center; margin-bottom: 20px; padding: 14px 20px; border-radius: 6px; background: var(--surface) url("../images/theme-model-2/wenshi2.png") right center / 230px auto no-repeat; box-shadow: var(--shadow-card); }
.page-heading h1 { margin: 0 0 3px; color: var(--brand); font: 800 1.45rem/1.2 var(--serif); }
.page-heading p { margin: 0; color: var(--text-muted); font-size: .76rem; }

.library-layout { display: grid; grid-template-columns: 344px minmax(0, 1fr); gap: 18px; align-items: start; }
.filter-rail { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow-y: auto; border-radius: 6px; padding: 22px 20px 26px; background: var(--surface); box-shadow: var(--shadow-card); scrollbar-color: var(--brand-soft) transparent; scrollbar-width: thin; }
.filter-rail::after { content: ""; position: absolute; top: 0; right: 0; width: 4px; height: 100%; border-radius: 4px; background: var(--brand-soft); }
.filter-group + .filter-group { margin-top: 28px; }
.filter-group h2 { position: relative; width: max-content; margin: 0 0 12px; padding-bottom: 7px; color: var(--brand); font-size: .98rem; font-weight: 700; }
.filter-group h2::after { content: ""; position: absolute; left: 8px; bottom: 0; width: 24px; height: 2px; background: var(--brand); }
.filter-options { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-options a { display: inline-flex; align-items: center; min-height: 32px; border-radius: 5px; padding: 5px 11px; color: var(--text); background: #eceef0; font-size: .84rem; line-height: 1.3; white-space: nowrap; }
.filter-options a:hover, .filter-options a.active { color: #fff; background: var(--brand); }
.library-results .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 0; margin: 20px 0 0; }
.pager a { min-width: 38px; min-height: 38px; display: grid; place-items: center; border: 1px solid var(--border-soft); border-left: 0; padding: 6px 10px; color: var(--text-secondary); background: var(--surface); font-size: .76rem; box-shadow: 0 4px 5px rgb(0 0 0 / 5%); }
.pager a:first-child { border-left: 1px solid var(--border-soft); border-radius: 6px 0 0 6px; }
.pager a:last-child { border-radius: 0 6px 6px 0; }
.pager a.current { color: #fff; border-color: var(--brand); background: var(--brand); }

.search-heading { margin-bottom: 20px; padding: 16px 20px 20px; border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-card); }
.search-heading .section-heading { min-height: 38px; margin-bottom: 12px; }
.large-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.large-search input { min-width: 0; height: 42px; border: 1px solid var(--border); border-radius: 21px; padding: 0 18px; outline: 0; }
.large-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(233 99 99 / 12%); }
.search-results { min-height: 360px; }
.search-results .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.result-count { margin: 0 0 14px; color: var(--text-muted); font-size: .76rem; }
.empty-state { min-height: 220px; display: grid; place-content: center; justify-items: center; border: 1px solid var(--border-soft); border-radius: 6px; padding: 30px; text-align: center; background: var(--surface) url("../images/theme-model-2/wenshi2.png") right bottom / 240px auto no-repeat; box-shadow: var(--shadow-card); }
.empty-state h1, .empty-state h2 { margin: 0 0 8px; color: var(--brand); font-family: var(--serif); }
.empty-state p { margin: 0 0 14px; color: var(--text-muted); }

.detail-card { overflow: hidden; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-card); }
.book-detail { min-height: 220px; display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 18px; padding: 20px; background: linear-gradient(90deg, rgb(255 246 246 / 96%), rgb(255 246 246 / 76%)), url("../images/theme-model-2/wenshi2.png") right center / 48% auto no-repeat; }
.detail-cover { position: relative; width: 136px; height: 181px; overflow: hidden; border: 2px solid var(--brand-soft); border-radius: 4px; box-shadow: 0 6px 14px rgb(0 0 0 / 18%); }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-cover span { position: absolute; left: 0; bottom: 0; padding: 5px 8px; color: #fff; font-size: .68rem; }
.detail-main { min-width: 0; padding-top: 2px; }
.detail-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.detail-main h1 { margin: 0; color: #3e2b2d; font: 800 1.55rem/1.25 var(--serif); }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-list span { padding: 3px 7px; border-radius: 2px; color: #714d52; background: #f2c4ce; font-size: .65rem; }
.tag-list span:nth-child(3n+2) { background: #c9e7f6; }
.tag-list span:nth-child(3n) { background: #d7efcb; }
.detail-author, .detail-meta { margin: 10px 0 0; color: var(--text-secondary); font-size: .75rem; }
.detail-meta { color: var(--brand); }
.detail-intro { max-width: 92ch; margin: 10px 0 0; color: var(--text-secondary); font-size: .82rem; line-height: 1.65; }
.detail-actions { min-height: 74px; display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border-soft); background: var(--surface); }
.detail-actions .text-link { margin-left: auto; font-size: .78rem; }
.latest-chapter { min-height: 68px; display: grid; grid-template-columns: 28px auto minmax(0, 1fr) auto 18px; gap: 10px; align-items: center; margin-top: 20px; padding: 12px 20px; border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-card); }
.latest-chapter-badge { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 4px; color: #fff; background: var(--brand); font-size: .68rem; font-weight: 800; }
.latest-chapter > span:nth-of-type(2) { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.latest-chapter time { color: var(--text-muted); font-size: .72rem; }
.latest-chapter i { color: var(--brand); font-size: 1.5rem; font-style: normal; }
.catalog-preview { margin-top: 20px; }
.catalog-heading { margin-bottom: 14px; padding: 16px 20px; border-radius: 6px; background: var(--surface) url("../images/theme-model-2/wenshi2.png") right center / 220px auto no-repeat; box-shadow: var(--shadow-card); }
.catalog-heading .section-heading { margin-bottom: 4px; }
.catalog-heading h2 { margin: 8px 0 0; font-size: 1rem; }
.catalog-heading > p { margin: 3px 0 0; color: var(--text-muted); font-size: .72rem; }
.catalog-page { padding-bottom: 20px; }
.chapter-grid { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 16px; border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-card); }
.chapter-grid li { min-width: 0; }
.chapter-grid a { min-height: 42px; display: grid; grid-template-columns: 28px minmax(0, 1fr) 14px; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 3px; background: var(--border-soft); font-size: .76rem; }
.chapter-grid a:hover { color: #fff; background: var(--brand); }
.chapter-grid a > span { color: var(--brand); font-weight: 700; }
.chapter-grid a:hover > span { color: #fff; }
.chapter-grid a > i { color: var(--brand); font-size: 1rem; font-style: normal; }
.chapter-grid a:hover > i { color: #fff; }
.chapter-grid li.is-current a { color: #fff; background: var(--brand); }
.chapter-grid li.is-current span, .chapter-grid li.is-current i { color: #fff; }

.ad-slot { width: min(970px, calc(100% - 24px)); min-height: 90px; position: relative; display: grid; align-items: center; margin: 20px auto; border: 1px dashed var(--border); background: rgb(255 255 255 / 70%); }
.ad-slot-reader { min-height: 120px; margin-block: 48px 20px; }
.ad-label { position: absolute; top: 4px; right: 8px; color: var(--text-muted); font-size: .62rem; }

.reader-page { --reader-bg: var(--reader-paper); --reader-ink: #2a2222; background: var(--reader-bg); }
.reader-page[data-reader-theme="moss"] { --reader-bg: var(--reader-moss); --reader-ink: #273027; }
.reader-page[data-reader-theme="night"] { --reader-bg: var(--reader-night); --reader-ink: #ddd6d2; }
.reader-page .site-header, .reader-page .site-footer, .reader-page .mobile-nav { display: none; }
.reader-page main { min-height: 100vh; padding-top: 0; }
.reader-shell { width: min(var(--reader-width, 760px), calc(100% - 40px)); margin: 0 auto; padding: 64px 0 110px; color: var(--reader-ink); }
.reader-heading { padding-bottom: 30px; border-bottom: 1px solid color-mix(in srgb, var(--reader-ink) 20%, transparent); text-align: center; }
.reader-heading > a { color: var(--brand); font-size: .78rem; font-weight: 700; }
.reader-heading h1 { margin: 15px 0 8px; font: 800 clamp(1.8rem, 5vw, 2.8rem)/1.25 var(--serif); }
.reader-heading p { margin: 0; opacity: .58; font-size: .72rem; }
.reader-content { padding-block: 42px; font: var(--reader-font-size, 19px)/var(--reader-line-height, 1.95) var(--serif); letter-spacing: .02em; }
.reader-content p { margin: 0 0 1.2em; text-indent: 2em; }
.reader-chapter-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; border-top: 1px solid color-mix(in srgb, var(--reader-ink) 20%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--reader-ink) 20%, transparent); }
.reader-chapter-nav > * { min-width: 0; overflow: hidden; padding: 15px 8px; text-align: center; white-space: nowrap; text-overflow: ellipsis; }
.reader-chapter-nav > *:first-child { text-align: left; }
.reader-chapter-nav > *:last-child { text-align: right; }
.reader-chapter-nav span { opacity: .45; }
.reader-chapter-nav button { border: 0; color: inherit; background: transparent; cursor: pointer; }
.reader-chapter-nav button:hover { color: var(--brand); }
.reader-toolbar { position: fixed; z-index: 60; left: 50%; bottom: 18px; display: flex; gap: 2px; border: 1px solid var(--brand-pale); border-radius: 8px; padding: 5px; background: rgb(255 255 255 / 94%); box-shadow: 0 8px 28px rgb(104 44 49 / 22%); backdrop-filter: blur(12px); transform: translateX(-50%); }
.reader-toolbar a, .reader-toolbar button { border: 0; border-radius: 4px; padding: 8px 11px; color: #6a3f43; background: transparent; cursor: pointer; white-space: nowrap; }
.reader-toolbar a:hover, .reader-toolbar button:hover { color: #fff; background: var(--brand); }
.reader-toolbar .reader-toolbar-home { border-right: 1px solid var(--brand-pale); }
.reader-theme-control { position: relative; min-width: 0; }
.reader-theme-control > button { width: 100%; height: 100%; }
.reader-theme-menu { position: absolute; left: 50%; bottom: calc(100% + 13px); width: 218px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 8px; border: 1px solid var(--brand-pale); border-radius: 6px; background: rgb(255 255 255 / 98%); box-shadow: 0 10px 26px rgb(104 44 49 / 20%); transform: translateX(-50%); }
.reader-theme-menu::after { content: ""; position: absolute; top: 100%; left: 50%; border: 7px solid transparent; border-top-color: #fff; transform: translateX(-50%); }
.reader-toolbar .reader-theme-menu button { display: grid; justify-items: center; gap: 5px; min-width: 0; padding: 7px 5px; color: #6a3f43; font-size: .7rem; }
.reader-toolbar .reader-theme-menu button[aria-pressed="true"] { color: #fff; background: var(--brand); }
.reader-theme-swatch { width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 50%; }
.reader-theme-swatch.paper { background: var(--reader-paper); }
.reader-theme-swatch.moss { background: var(--reader-moss); }
.reader-theme-swatch.night { background: var(--reader-night); }

.reader-catalog-open { overflow: hidden; }
.reader-catalog-overlay { position: fixed; z-index: 90; inset: 0; display: flex; justify-content: flex-end; background: rgb(24 18 20 / 58%); }
.reader-catalog { width: min(440px, 100%); height: 100%; display: flex; flex-direction: column; color: var(--reader-ink); background: var(--reader-bg); box-shadow: -12px 0 36px rgb(0 0 0 / 20%); }
.reader-catalog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 26px 28px 20px; border-bottom: 1px solid color-mix(in srgb, var(--reader-ink) 18%, transparent); }
.reader-catalog-heading small { color: var(--brand); font-size: .76rem; font-weight: 700; }
.reader-catalog-heading h2 { margin: 5px 0 2px; font: 800 1.4rem/1.3 var(--serif); }
.reader-catalog-heading p { margin: 0; opacity: .65; font-size: .78rem; }
.reader-catalog-heading button { width: 36px; height: 36px; flex: 0 0 auto; border: 1px solid color-mix(in srgb, var(--reader-ink) 20%, transparent); border-radius: 50%; color: inherit; background: transparent; cursor: pointer; font-size: 1.4rem; line-height: 1; }
.reader-catalog-heading button:hover { color: #fff; border-color: var(--brand); background: var(--brand); }
.reader-catalog-list { flex: 1; min-height: 0; margin: 0; overflow-y: auto; overscroll-behavior: contain; list-style: none; padding: 14px 20px calc(24px + env(safe-area-inset-bottom)); }
.reader-catalog-list li { border-bottom: 1px solid color-mix(in srgb, var(--reader-ink) 10%, transparent); }
.reader-catalog-list a { min-height: 52px; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 12px; border-radius: 5px; font-size: .85rem; }
.reader-catalog-list a span:first-child { color: var(--brand); font-size: .74rem; font-weight: 700; }
.reader-catalog-list a span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.reader-catalog-list a:hover { background: color-mix(in srgb, var(--brand) 12%, var(--reader-bg)); }
.reader-catalog-list a[aria-current="location"] { color: #fff; background: var(--brand); font-weight: 700; }
.local-library { min-height: 360px; padding-bottom: 20px; }
.local-actions { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.local-actions .button { min-height: 34px; padding: 6px 12px; font-size: .74rem; }
.local-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.local-item { position: relative; min-width: 0; display: grid; grid-template-columns: 86px minmax(0, 1fr); grid-template-rows: auto auto; gap: 8px 14px; align-items: center; padding: 12px; border: 1px solid var(--border-soft); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-card); }
.local-item img { grid-row: 1 / 3; width: 86px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 3px; }
.local-item h2 { margin: 0 0 5px; overflow: hidden; font: 800 .96rem var(--serif); white-space: nowrap; text-overflow: ellipsis; }
.local-item p { margin: 0; color: var(--text-muted); font-size: .72rem; }
.local-item-actions { display: flex; align-items: center; gap: 8px; }
.local-item-actions a { min-height: 32px; display: inline-flex; align-items: center; border-radius: 4px; padding: 5px 12px; color: #fff; background: var(--brand); font-size: .72rem; }
.local-item-actions button { min-height: 32px; border: 0; padding: 5px 8px; color: var(--text-muted); background: transparent; cursor: pointer; font-size: .72rem; }
.local-item-actions button:hover { color: var(--brand); }
.local-library > .empty-state { min-height: 300px; }

.prose-page { max-width: 860px; min-height: 420px; border-radius: 8px; padding: 42px 54px; background: var(--surface) url("../images/theme-model-2/wenshi2.png") right top / 260px auto no-repeat; box-shadow: var(--shadow-card); }
.prose-page > .eyebrow { margin: 0; color: var(--brand); font-weight: 700; }
.prose-page h1 { margin: 6px 0 24px; color: #4f3336; font-family: var(--serif); }
.prose-page h2 { margin-top: 28px; color: var(--brand); font-size: 1rem; }
.prose-page p { color: var(--text-secondary); }
.prose-page a { color: var(--brand-active); text-underline-offset: 3px; }
.error-page { min-height: 480px; display: grid; place-content: center; justify-items: center; border-radius: 8px; padding: 40px; text-align: center; background: var(--surface) url("../images/theme-model-2/wenshi.png") left top / 270px auto no-repeat; box-shadow: var(--shadow-card); }
.error-page > span { color: var(--brand-pale); font: 900 6rem/1 var(--serif); }
.error-page .eyebrow { margin: 10px 0 0; color: var(--brand); font-size: .74rem; font-weight: 700; }
.error-page h1 { margin: 8px 0; font-family: var(--serif); }
.error-page p { color: var(--text-muted); }
.error-page > div { display: flex; gap: 10px; }

@media (max-width: 1200px) {
  body:not(.reader-page) { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }
  main { padding-top: 90px; }
  .shell { width: 100%; }
  .site-header { height: 90px; box-shadow: none; }
  .masthead { width: 100%; height: 52px; padding: 0 12px; }
  .brand { min-width: 0; gap: 6px; }
  .brand-mark { width: 28px; height: 30px; transform: scale(.78) rotate(-9deg); transform-origin: center; }
  .brand-copy strong { font-size: 1.03rem; }
  .brand-copy small { display: none; }
  .desktop-nav { display: none; }
  .header-search { flex: 1 1 auto; max-width: 180px; height: 36px; border: 2px solid var(--brand-soft); }
  .header-search input { width: calc(100% - 36px); padding-left: 10px; font-size: .72rem; }
  .header-search button { height: 32px; background-size: 20px; }
  .quick-nav, .site-header:hover .quick-nav, .site-header:focus-within .quick-nav { position: relative; top: 0; left: 0; width: 100%; height: 38px; overflow-x: auto; border: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--border-soft); box-shadow: none; opacity: 1; visibility: visible; transform: none; scrollbar-width: none; }
  .quick-nav::-webkit-scrollbar { display: none; }
  .quick-nav-track { width: max-content; min-width: 100%; height: 37px; padding: 0; }
  .quick-nav a { flex: 0 0 auto; padding: 9px 16px; color: var(--text); font-size: .78rem; line-height: 18px; white-space: nowrap; }
  .mobile-nav { position: fixed; z-index: 55; left: 0; right: 0; bottom: 0; min-height: 52px; display: flex; align-items: stretch; border-top: 1px solid var(--border-soft); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); }
  .mobile-nav a { position: relative; flex: 1; display: grid; place-items: center; margin: 2px; border-radius: 6px; font-size: .78rem; }
  .mobile-nav a.active { color: #fff; background: var(--brand) url("../images/theme-model-2/wenshi.png") left bottom / 95% auto no-repeat; font-size: .9rem; }
  .mobile-nav a.active::after { content: ""; position: absolute; inset: 3px; border: 1px solid #fff; border-radius: 4px; pointer-events: none; }
  .site-footer { margin-top: 12px; }
  .footer-grid { min-height: 126px; padding: 20px 12px 72px; }
  .footer-grid nav { gap: 8px 20px; }
  .footer-grid a { font-size: .9rem; }

  .section-heading { min-height: 38px; margin-bottom: 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); padding: 0 12px; background: var(--surface); }
  .section-heading h1, .section-heading h2 { min-height: 38px; border: 0; border-radius: 0; padding: 9px 0; background: none; box-shadow: none; font-size: .92rem; font-family: var(--sans); }
  .section-heading a { color: var(--brand); }
  .featured-section { --slide-width: min(62vw, 230px); width: 100%; }
  .featured-track { gap: 12px; }
  .featured-slide { border-radius: 8px; }
  .featured-viewport { padding: 18px 0 48px; }
  .featured-dots { bottom: 16px; }
  .featured-controls > button { display: none; }
  .continue-strip { width: calc(100% - 24px); min-height: 66px; grid-template-columns: 34px 1fr auto; gap: 10px; margin: 12px; padding: 9px 10px; }
  .continue-badge { width: 30px; height: 30px; font-size: .75rem; }
  .continue-strip h2 { max-width: 38vw; overflow: hidden; font-size: .86rem; white-space: nowrap; text-overflow: ellipsis; }
  .continue-strip .button { min-height: 34px; padding: 6px 10px; font-size: .7rem; }
  .category-panel, .book-section { margin-top: 12px; }
  .category-panel { border-radius: 0; padding: 0; box-shadow: none; }
  .category-panel .section-heading { margin: 0; }
  .category-links { flex-wrap: nowrap; overflow-x: auto; padding: 10px 12px; background: var(--surface); scrollbar-width: none; }
  .category-links::-webkit-scrollbar { display: none; }
  .category-links a { flex: 0 0 auto; }
  .book-grid, .library-results .book-grid, .search-results .book-grid { grid-template-columns: 1fr; gap: 0; }
  .book-card { width: 100%; height: 176px; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; border: 0; border-top: 1px solid var(--border-soft); border-radius: 0; padding: 12px; box-shadow: none; }
  .book-card:last-child { border-bottom: 1px solid var(--border-soft); }
  .book-card:hover { border-color: var(--border-soft); transform: none; }
  .book-cover { width: 112px; height: 150px; }
  .book-card h3 { font-size: .93rem; }
  .book-author, .book-intro { font-size: .72rem; }
  .ad-slot { margin-block: 12px; }
  .page-heading { min-height: 66px; margin: 0; border-radius: 0; padding: 12px; box-shadow: none; }
  .page-heading h1 { font-size: 1.2rem; }
  .library-layout { display: block; }
  .filter-rail { position: relative; top: 0; max-height: min(42vh, 360px); overflow-y: auto; border-radius: 0; padding: 16px 12px 20px; box-shadow: none; }
  .filter-rail::after { display: none; }
  .filter-group + .filter-group { margin-top: 18px; }
  .filter-options a { min-height: 34px; font-size: .8rem; }
  .pager { margin: 12px 0; }
  .pager a { min-width: 40px; min-height: 40px; }
  .search-heading { margin: 0; border-radius: 0; padding: 0 12px 12px; box-shadow: none; }
  .search-heading .section-heading { margin: 0 -12px 12px; }
  .large-search { grid-template-columns: minmax(0, 1fr) 72px; }
  .search-results { min-height: 320px; padding-top: 12px; }
  .result-count { margin: 0; padding: 0 12px 10px; }
  .empty-state { margin: 12px; border-radius: 0; box-shadow: none; }

  .detail-card { border: 0; border-radius: 0; box-shadow: none; }
  .book-detail { min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 20px 12px 12px; background-size: cover; }
  .detail-cover { width: 136px; height: 181px; margin: 0 auto; }
  .detail-title-row { display: block; }
  .detail-main h1 { margin-top: 0; font-size: 1.22rem; text-align: left; }
  .tag-list { margin-top: 7px; }
  .detail-author, .detail-meta { margin-top: 8px; }
  .detail-intro { font-size: .78rem; line-height: 1.6; }
  .detail-actions { flex-wrap: wrap; padding: 12px; }
  .detail-actions .text-link { width: 100%; margin: 2px 0 0; text-align: center; }
  .latest-chapter { width: 100%; min-height: 54px; grid-template-columns: auto minmax(0, 1fr) auto 14px; gap: 7px; margin-top: 12px; border-radius: 0; padding: 9px 12px; box-shadow: none; }
  .latest-chapter-badge { display: none; }
  .latest-chapter strong { font-size: .72rem; }
  .latest-chapter > span:nth-of-type(2) { font-size: .78rem; }
  .catalog-preview { margin-top: 12px; }
  .catalog-heading { margin: 0; border-radius: 0; padding: 0 12px 12px; box-shadow: none; }
  .catalog-heading .section-heading { margin: 0 -12px 10px; }
  .chapter-grid { grid-template-columns: 1fr; gap: 1px; border-radius: 0; padding: 0; box-shadow: none; background: var(--border-soft); }
  .chapter-grid a { min-height: 44px; border-radius: 0; background: var(--surface); }
  .catalog-page { padding-bottom: 12px; }

  .local-library { min-height: 320px; padding: 12px; }
  .local-list { grid-template-columns: 1fr; gap: 10px; }
  .local-item { grid-template-columns: 76px minmax(0, 1fr); border-radius: 4px; padding: 10px; box-shadow: none; }
  .local-item img { width: 76px; }
  .prose-page { width: calc(100% - 24px); min-height: 0; margin: 12px; border-radius: 4px; padding: 28px 22px; box-shadow: none; }
  .error-page { width: calc(100% - 24px); min-height: 430px; margin: 12px; border-radius: 4px; box-shadow: none; }
}

@media (max-width: 520px) {
  .brand-copy strong { max-width: 108px; overflow: hidden; text-overflow: ellipsis; }
  .header-search { max-width: 132px; }
  .reader-shell { width: calc(100% - 28px); padding-top: 36px; }
  .reader-heading h1 { font-size: 1.55rem; }
  .reader-content { padding-block: 32px; }
  .reader-toolbar { bottom: calc(8px + env(safe-area-inset-bottom)); width: calc(100% - 16px); justify-content: center; overflow-x: auto; }
  .reader-toolbar a, .reader-toolbar button { padding: 8px 7px; font-size: .72rem; }
  .reader-theme-menu { left: auto; right: 0; transform: none; }
  .reader-theme-menu::after { left: auto; right: 18px; transform: none; }
  .reader-chapter-nav { grid-template-columns: 1fr auto 1fr; font-size: .72rem; }
  .latest-chapter time { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
