* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: #f4f4f4; color: #333; font: 14px/1.8 "Microsoft YaHei", "PingFang SC", Arial, sans-serif; }
a { color: #333; text-decoration: none; }
a:hover { color: #c00; text-decoration: underline; }
img { display: block; max-width: 100%; }
.container, .topbar-con, .header-inner, .nav, .m-nav { max-width: 980px; margin: 0 auto; }

.topbar { height: 30px; background: #f7f7f7; border-bottom: 1px solid #ddd; color: #777; font-size: 12px; }
.topbar-con { display: flex; gap: 24px; align-items: center; height: 30px; }
.topbar-action { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: 0; }
.topbar-action:hover { color: #0871bd; text-decoration: underline; }
.site-header { background: #2f8ed8; }
.header-inner { height: 76px; display: flex; align-items: center; gap: 28px; }
.logo { width: 170px; font-size: 34px; line-height: 1; font-weight: 700; }
.logo a { color: #fff; letter-spacing: 0; }
.logo a:hover { color: inherit; text-decoration: none; }
.search-form { flex: 1; display: flex; max-width: 470px; }
.input-key { flex: 1; height: 38px; padding: 0 12px; border: 0; outline: 0; font-size: 14px; }
.btn-tosearch { width: 78px; height: 38px; border: 0; background: #f5a623; color: #fff; font-size: 15px; cursor: pointer; }
.user-links { margin-left: auto; display: flex; gap: 10px; }
.user-links a { color: #fff; padding: 5px 10px; border: 1px solid rgba(255,255,255,.5); border-radius: 2px; }

.nav { display: flex; height: 42px; background: #287dc2; overflow: hidden; }
.nav a { color: #fff; line-height: 42px; padding: 0 13px; white-space: nowrap; border-right: 1px solid rgba(255,255,255,.12); }
.nav a:hover { background: #1d6fb0; text-decoration: none; color: #fff; }
.m-nav { display: none; }
.page-main { padding: 12px 0 20px; }

.home-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 12px; }
.layout-col2, .layout-col1, .tp-box, .book-detail, .intro-box, .chapter-box, .category-box { background: #fff; border: 1px solid #ddd; }
.layout-col2 { display: grid; grid-template-columns: 1fr 1fr; padding: 12px; gap: 12px; }
.item { display: flex; min-height: 132px; overflow: hidden; }
.item .image { width: 88px; flex: 0 0 88px; margin-right: 12px; }
.item .image img { width: 88px; height: 120px; object-fit: cover; border: 1px solid #ddd; }
.item dt { height: 28px; line-height: 28px; overflow: hidden; font-weight: 700; }
.item dt span { float: right; max-width: 72px; color: #888; font-size: 12px; font-weight: 400; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.item dd { color: #555; height: 88px; overflow: hidden; font-size: 13px; }
.item dd a { color: #555; }
.layout-tit, .tp-box h2, .intro-box h2, .chapter-box h2 { height: 38px; line-height: 38px; padding: 0 12px; border-bottom: 1px solid #ddd; background: #f9f9f9; color: #287dc2; font-size: 16px; }
.txt-list, .book-links, .update-list, .chapter-list, .category-list { list-style: none; }
.txt-list li, .update-list li, .category-list li { display: flex; height: 35px; line-height: 35px; padding: 0 12px; border-bottom: 1px dashed #e5e5e5; overflow: hidden; }
.s1, .cat-type { width: 86px; color: #888; flex: 0 0 86px; }
.s2, .cat-title { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.s3 { width: 220px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.s5, .cat-author { width: 88px; color: #777; text-align: right; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cat-status { width: 70px; color: #888; text-align: right; }

.tp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.top-book { display: flex; padding: 12px; border-bottom: 1px dashed #ddd; }
.top-book .image { width: 76px; flex: 0 0 76px; margin-right: 12px; }
.top-book .image img { width: 76px; height: 104px; object-fit: cover; border: 1px solid #ddd; }
.top-book dt { font-weight: 700; height: 28px; line-height: 28px; overflow: hidden; }
.top-book dd { height: 72px; overflow: hidden; color: #555; font-size: 13px; }
.top-book dd a { color: #555; }
.book-links { padding: 7px 12px; columns: 2; }
.book-links li { height: 28px; line-height: 28px; overflow: hidden; break-inside: avoid; }

.book-detail { display: flex; padding: 18px; margin-bottom: 12px; }
.book-detail .book-cover { width: 150px; flex: 0 0 150px; margin-right: 22px; }
.book-detail .book-cover img { width: 150px; height: 200px; object-fit: cover; border: 1px solid #ccc; padding: 2px; background: #fff; }
.book-meta h1 { height: 44px; line-height: 44px; font-size: 28px; font-weight: 500; border-bottom: 1px dashed #ddd; margin-bottom: 8px; }
.book-meta p { height: 30px; line-height: 30px; color: #555; }
.book-actions { margin-top: 18px; display: flex; gap: 12px; }
.read-btn { display: inline-block; min-width: 110px; height: 36px; line-height: 36px; text-align: center; background: #287dc2; color: #fff; border-radius: 2px; }
.read-btn.light { background: #f5a623; }
.read-btn:hover { color: #fff; text-decoration: none; opacity: .9; }
.intro-box { margin-bottom: 12px; }
.intro-box p { padding: 14px 16px; color: #555; text-indent: 2em; }
.chapter-list { display: grid; grid-template-columns: repeat(3, 1fr); padding: 10px 12px; }
.chapter-list li { height: 34px; line-height: 34px; border-bottom: 1px dashed #e5e5e5; overflow: hidden; padding-right: 18px; white-space: nowrap; text-overflow: ellipsis; }
.category-box h1 { height: 42px; line-height: 42px; padding: 0 12px; font-size: 18px; color: #287dc2; border-bottom: 1px solid #ddd; background: #f9f9f9; }

.reader { background: #f6f1e7; border: 1px solid #d8cfbd; padding: 0 24px 26px; }
.crumb { height: 38px; line-height: 38px; color: #777; border-bottom: 1px solid #e4dccd; font-size: 13px; }
.reader-head { text-align: center; padding: 20px 0 10px; border-bottom: 1px dashed #d8cfbd; }
.reader-head h1 { font-size: 26px; font-weight: 500; color: #222; }
.reader-head p { color: #777; margin-top: 6px; }
.chapter-content { padding: 20px 8px; color: #222; font: 20px/2 "Microsoft YaHei", "PingFang SC", serif; }
.reader-content-title { display: none; margin: 0 0 16px; padding: 2px 0 10px; border-bottom: 1px dashed #d8cfbd; color: #222; font-size: 22px; font-weight: 700; line-height: 1.45; text-align: center; text-indent: 0; }
.chapter-content p { text-indent: 2em; margin-bottom: 14px; text-align: justify; }
.chapter-nav { display: flex; justify-content: center; gap: 12px; padding: 18px 0 0; border-top: 1px dashed #d8cfbd; }
.chapter-nav.top { padding: 14px 0; border-top: 0; border-bottom: 1px dashed #d8cfbd; }
.reader .chapter-nav.bottom { margin-bottom: 18px; }
.chapter-nav a, .chapter-nav span { min-width: 110px; height: 34px; line-height: 34px; text-align: center; background: #fff; border: 1px solid #d8cfbd; color: #555; }
.chapter-nav a:hover { background: #287dc2; color: #fff; text-decoration: none; border-color: #287dc2; }

.page-content { background: #fff; border: 1px solid #ddd; padding: 20px; }
.footer { border-top: 1px solid #ddd; background: #f7f7f7; color: #888; text-align: center; padding: 20px 0; font-size: 12px; }

@media (max-width: 768px) {
    .container, .topbar-con, .header-inner, .nav, .m-nav { width: 100%; max-width: none; }
    .topbar { display: none; }
    .site-header { padding: 10px; }
    .header-inner { height: auto; display: block; }
    .logo { width: auto; margin-bottom: 10px; font-size: 28px; text-align: center; }
    .search-form { max-width: none; }
    .user-links { display: none; }
    .nav { display: none; }
    .m-nav { display: flex; overflow-x: auto; background: #287dc2; }
    .m-nav a { color: #fff; line-height: 38px; padding: 0 14px; white-space: nowrap; }
    .page-main { padding: 8px; }
    .home-grid, .tp-row { display: block; }
    .layout-col2 { grid-template-columns: 1fr; margin-bottom: 10px; }
    .layout-col1, .tp-box { margin-bottom: 10px; }
    .s1, .s3, .s5, .cat-type, .cat-author, .cat-status { display: none; }
    .book-links { columns: 1; }
    .book-detail { display: block; text-align: center; }
    .book-detail .book-cover { margin: 0 auto 12px; }
    .book-meta h1 { height: auto; line-height: 1.4; font-size: 24px; }
    .book-actions { justify-content: center; }
    .chapter-list { grid-template-columns: 1fr; }
    .reader { padding: 0 12px 18px; }
    .reader-head h1 { font-size: 22px; }
    .chapter-content { font-size: 18px; line-height: 1.95; padding: 14px 0; }
    .reader-content-title { display: block; font-size: 18px; margin-bottom: 12px; padding-bottom: 8px; line-height: 1.45; }
    .chapter-nav { gap: 8px; }
    .chapter-nav a, .chapter-nav span { min-width: 0; flex: 1; }
}

.search-page { background: #fff; border: 1px solid #ddd; padding: 14px; }
.search-page h1 { height: 38px; line-height: 38px; font-size: 18px; color: #287dc2; border-bottom: 1px solid #ddd; margin-bottom: 14px; }
.search-inline { display: flex; max-width: 560px; margin-bottom: 12px; }
.search-inline input { flex: 1; height: 36px; padding: 0 10px; border: 1px solid #ccc; border-right: 0; outline: 0; }
.search-inline button { width: 76px; border: 0; background: #287dc2; color: #fff; cursor: pointer; }
.search-tip { color: #777; padding: 8px 0 12px; }
.search-results { list-style: none; }
.search-results li { display: flex; padding: 12px 0; border-top: 1px dashed #e5e5e5; }
.search-results li[hidden] { display: none !important; }
.search-results li.empty { display: block; color: #888; }
.result-cover { width: 72px; flex: 0 0 72px; margin-right: 12px; }
.result-cover img { width: 72px; height: 96px; object-fit: cover; border: 1px solid #ddd; }
.result-info h2 { font-size: 16px; height: 28px; line-height: 28px; overflow: hidden; }
.result-info .meta { color: #888; font-size: 13px; margin-bottom: 4px; }
.result-info .desc { color: #555; height: 48px; overflow: hidden; line-height: 1.7; }
@media (max-width: 768px) {
    .search-page { padding: 10px; }
    .search-inline { max-width: none; }
}

/* Screenshot-style desktop home layout */
body { background: #e6f8fb; color: #555; font-size: 14px; }
a { color: #4d6da8; }
.container, .topbar-con, .header-inner, .nav, .m-nav { max-width: 1160px; }
.topbar { background: #d9eef3; border-bottom: 1px solid #b8dce7; }
.topbar-con { color: #6d8f9e; }
.site-header { background: #e6f8fb; }
.header-inner { height: 82px; gap: 24px; }
.logo { width: 150px; font-size: 36px; font-family: Georgia, "Microsoft YaHei", serif; text-shadow: 2px 2px 0 #c3e3f1; }
.logo a { color: #0871bd; }
.search-form { max-width: 480px; margin-left: auto; }
.input-key { height: 36px; border: 1px solid #9bc7df; background: #fff; }
.btn-tosearch { height: 36px; background: #ddd; color: #222; }
.user-links { display: none; }
.nav { height: 44px; background: #79c2e3; padding: 0 10px; }
.nav a { line-height: 44px; padding: 0 11px; border-right: 0; color: #fff; font-weight: 700; }
.nav a:hover { background: #5eb1d8; }
.page-main { padding: 12px 0 24px; }

.rec-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 22px; padding: 14px; margin-bottom: 22px; border: 3px solid #b9dff1; background: #fffdf6; }
.rec-book { display: grid; grid-template-columns: 126px 1fr; gap: 12px; min-height: 176px; }
.rec-cover img { width: 126px; height: 170px; object-fit: cover; border: 1px solid #abc6d4; padding: 3px; background: #fff; }
.rec-info h2 { height: 28px; line-height: 28px; font-size: 15px; border-bottom: 1px dotted #c7d8e3; overflow: hidden; }
.rec-info h2 a { color: #5b6fad; font-weight: 700; }
.rec-info h2 span { float: right; color: #aaa; font-weight: 400; }
.rec-info p { padding-top: 8px; color: #555; line-height: 1.85; height: 132px; overflow: hidden; text-indent: 2em; }
.home-columns { display: grid; grid-template-columns: 1fr 335px; gap: 14px; align-items: start; }
.latest-box, .new-box { border: 3px solid #86c9e8; background: #eef6f6; }
.latest-box h2, .new-box h2 { height: 36px; line-height: 36px; padding: 0 12px; background: #9bd3e9; color: #456; font-size: 16px; }
.latest-list, .new-list { list-style: none; padding: 8px 12px; }
.latest-list li { display: grid; grid-template-columns: 95px 190px 1fr 90px 50px; gap: 8px; height: 32px; line-height: 32px; border-bottom: 1px solid #d8e2e4; overflow: hidden; }
.latest-list .type { color: #555; }
.latest-list .book, .latest-list .chapter, .latest-list .author { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.latest-list .author, .latest-list .date { color: #aaa; text-align: right; }
.new-list li { display: grid; grid-template-columns: 78px 1fr 58px; gap: 6px; height: 31px; line-height: 31px; border-bottom: 1px solid #d8e2e4; overflow: hidden; }
.new-list span { color: #555; }
.new-list a { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.new-list em { color: #666; font-style: normal; text-align: right; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pager { display: grid; grid-template-columns: 190px 1fr 190px; gap: 18px; padding: 14px 12px; }
.pager a, .pager select { height: 40px; border: 0; background: #4eadd0; color: #fff; text-align: center; border-radius: 3px; font-weight: 700; }
.pager a { line-height: 40px; }
.pager select { background: #fff; color: #222; border: 1px solid #d8e2e4; padding: 0 12px; }
.footer { background: #e6f8fb; border-top: 2px solid #72c4e8; color: #555; }

/* Desktop vs mobile are intentionally different. */
@media (max-width: 768px) {
    body { background: #e6f8fb; font-size: 14px; }
    .container, .topbar-con, .header-inner, .nav, .m-nav { width: 100%; max-width: none; }
    .topbar { display: none; }
    .site-header { padding: 10px; background: #dff5fb; }
    .header-inner { display: block; height: auto; }
    .logo { width: auto; font-size: 30px; text-align: left; margin: 0 0 10px; padding-right: 58px; }
    .search-form { max-width: none; display: flex; margin-left: 0; }
    .input-key { height: 38px; font-size: 14px; }
    .btn-tosearch { width: 72px; height: 38px; }
    .nav { display: none; }
    .m-nav { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); overflow: hidden; height: 40px; background: #79c2e3; padding: 0; }
    .m-nav a { min-width: 0; color: #fff; line-height: 40px; padding: 0 2px; text-align: center; font-weight: 700; white-space: nowrap; }
    .header-inner .m-nav { margin-bottom: 8px; }
    .page-main { padding: 8px; }
    .rec-panel { display: block; padding: 8px; margin-bottom: 10px; border-width: 2px; }
    .rec-book { display: grid; grid-template-columns: 82px 1fr; gap: 10px; min-height: 116px; padding: 8px 0; border-bottom: 1px solid #d8e2e4; }
    .rec-book:last-child { border-bottom: 0; }
    .rec-cover img { width: 82px; height: 110px; padding: 2px; }
    .rec-info h2 { height: 24px; line-height: 24px; font-size: 15px; }
    .rec-info h2 span { display: none; }
    .rec-info p { height: 78px; line-height: 1.7; padding-top: 5px; text-indent: 0; }
    .home-columns { display: block; }
    .home-update-columns { display: flex; flex-direction: column; }
    .home-update-columns .new-box { order: 1; }
    .home-update-columns .latest-box { order: 2; }
    .latest-box, .new-box { border-width: 2px; margin-bottom: 10px; }
    .latest-box h2, .new-box h2 { height: 34px; line-height: 34px; font-size: 15px; }
    .latest-list, .new-list { padding: 4px 8px; }
    .latest-list li { display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr); gap: 6px; height: 34px; min-height: 34px; line-height: 34px; padding: 0; }
    .latest-list .author, .latest-list .date { display: none; }
    .latest-list .type { display: block; width: auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #555; }
    .latest-list .book { font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .latest-list .chapter { color: #777; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .new-list li { grid-template-columns: minmax(0, 1fr) 88px; height: 34px; line-height: 34px; }
    .new-list span { display: none; }
    .pager { grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 8px; }
    .pager select { grid-column: 1 / -1; order: -1; }
    .footer { padding: 14px 8px; line-height: 1.7; }
}

.history-box { border: 3px solid #b9dff1; background: #fffdf6; }
.history-box h1 { height: 38px; line-height: 38px; padding: 0 12px; background: #dcecef; color: #444; font-size: 15px; }
.history-table-wrap { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.history-table th, .history-table td { height: 45px; padding: 0 12px; border-bottom: 1px solid #ddd7ca; text-align: left; color: #4d6da8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-table th { color: #444; background: #fffaf0; font-weight: 700; }
.history-table th:nth-child(1), .history-table td:nth-child(1) { width: 58px; }
.history-table th:nth-child(2), .history-table td:nth-child(2) { width: 220px; }
.history-table th:nth-child(4), .history-table td:nth-child(4) { width: 140px; }
.history-table th:nth-child(5), .history-table td:nth-child(5) { width: 110px; }
.history-table th:nth-child(6), .history-table td:nth-child(6) { width: 80px; color: red; }
.history-table .empty { text-align: center; color: #888; }
.history-remove { border: 0; background: transparent; color: red; cursor: pointer; }
@media (max-width: 768px) {
    .history-box { border-width: 2px; }
    .history-box h1 { height: auto; line-height: 1.5; padding: 8px; font-size: 14px; }
    .history-table-wrap { overflow-x: hidden; }
    .history-table { min-width: 0; table-layout: fixed; }
    .history-table th, .history-table td { height: 40px; padding: 0 8px; }
    .history-table th:nth-child(1),
    .history-table td:nth-child(1),
    .history-table th:nth-child(4),
    .history-table td:nth-child(4),
    .history-table th:nth-child(5),
    .history-table td:nth-child(5) { display: none; }
    .history-table th:nth-child(2),
    .history-table td:nth-child(2) { width: 34%; }
    .history-table th:nth-child(3),
    .history-table td:nth-child(3) { width: 49%; }
    .history-table th:nth-child(6),
    .history-table td:nth-child(6) { width: 17%; text-align: center; }
}

/* Desktop home v2: hero + classic sidebar + 3x2 category matrix */
.hero-layout { display: grid; grid-template-columns: 1fr 340px; gap: 0; border: 3px solid #b9dff1; background: #fffdf6; margin-bottom: 16px; }
.hero-books { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 22px; padding: 12px; }
.hero-book { display: grid; grid-template-columns: 142px 1fr; gap: 14px; min-height: 178px; }
.hero-cover img { width: 142px; height: 170px; object-fit: cover; border: 1px solid #abc6d4; padding: 3px; background: #fff; }
.hero-info h2 { height: 30px; line-height: 30px; font-size: 15px; border-bottom: 1px dotted #c7d8e3; overflow: hidden; }
.hero-info h2 a { color: #5b6fad; font-weight: 700; }
.hero-info h2 span { float: right; max-width: 78px; color: #aaa; font-weight: 400; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hero-info p { padding-top: 8px; color: #555; line-height: 1.85; height: 132px; overflow: hidden; text-indent: 2em; }
.classic-box { border-left: 3px solid #b9dff1; background: #eef6f6; }
.classic-box h2 { height: 39px; line-height: 39px; padding: 0 12px; background: #dcecef; color: #444; font-size: 16px; }
.classic-box ul { list-style: none; padding: 7px 12px; }
.classic-box li { display: grid; grid-template-columns: 78px 1fr 58px; gap: 6px; height: 31px; line-height: 31px; border-bottom: 1px solid #d8e2e4; overflow: hidden; }
.classic-box span { color: #555; }
.classic-box a { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.classic-box em { font-style: normal; color: #666; text-align: right; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.category-grid-home { display: grid; grid-template-columns: repeat(3, 1fr); border: 3px solid #86c9e8; background: #fffdf6; }
.cat-card { min-height: 318px; padding: 0 12px 9px; border-right: 1px dotted #9fc9db; border-bottom: 1px solid #b9dff1; overflow: hidden; }
.cat-card:nth-child(3n) { border-right: 0; }
.cat-card h2 { height: 34px; line-height: 34px; color: #444; font-size: 16px; border-bottom: 1px solid #c7d8e3; }
.cat-top { display: grid; grid-template-columns: 82px 1fr; gap: 12px; padding: 12px 0 8px; }
.cat-cover img { width: 82px; height: 104px; object-fit: cover; border: 1px solid #abc6d4; padding: 2px; background: #fff; }
.cat-top h3 { height: 24px; line-height: 24px; font-size: 14px; overflow: hidden; }
.cat-top h3 a { color: #4d6da8; }
.cat-top p { height: 76px; overflow: hidden; line-height: 1.7; color: #555; }
.cat-links { list-style: none; }
.cat-links li { height: 26px; line-height: 26px; border-bottom: 1px solid #d8e2e4; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 768px) {
    .hero-layout { display: block; border-width: 2px; margin-bottom: 10px; }
    .hero-books { display: block; padding: 8px; }
    .hero-book { grid-template-columns: 82px 1fr; gap: 10px; min-height: 116px; padding: 8px 0; border-bottom: 1px solid #d8e2e4; }
    .hero-book:last-child { border-bottom: 0; }
    .hero-cover img { width: 82px; height: 110px; padding: 2px; }
    .hero-info h2 { height: 24px; line-height: 24px; font-size: 15px; }
    .hero-info h2 span { display: block; float: right; max-width: 82px; margin-right: 2px; color: #999; font-size: 13px; font-weight: 400; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .hero-info p { height: 78px; line-height: 1.7; padding-top: 5px; text-indent: 0; }
    .classic-box { border-left: 0; border-top: 2px solid #b9dff1; }
    .classic-box ul { padding-right: 12px; }
    .classic-box li { grid-template-columns: minmax(0, 1fr) 82px; }
    .classic-box span { display: none; }
    .category-grid-home { display: block; border-width: 2px; }
    .cat-card { min-height: 0; border-right: 0; padding-bottom: 6px; }
    .cat-card:nth-child(n+4) { display: none; }
    .cat-top { grid-template-columns: 72px 1fr; gap: 10px; }
    .cat-cover img { width: 72px; height: 94px; }
    .cat-links li { height: 30px; line-height: 30px; }
}

.rank-page { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; padding: 12px; border: 3px solid #b9dff1; background: #fffdf6; }
.rank-book { display: grid; grid-template-columns: 126px 1fr; gap: 14px; min-height: 178px; padding-bottom: 12px; margin-bottom: 12px; overflow: hidden; }
.rank-cover img { width: 126px; height: 170px; object-fit: cover; border: 1px solid #abc6d4; padding: 3px; background: #fff; }
.rank-info h2 { height: 30px; line-height: 30px; font-size: 15px; border-bottom: 1px dotted #c7d8e3; overflow: hidden; }
.rank-info h2 a { color: #5b6fad; font-weight: 700; }
.rank-info h2 span { float: right; max-width: 82px; color: #aaa; font-weight: 400; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rank-info p { padding-top: 8px; color: #555; line-height: 1.85; height: 132px; overflow: hidden; text-indent: 2em; }
@media (max-width: 768px) {
    .rank-page { display: block; padding: 8px; border-width: 2px; }
    .rank-book { grid-template-columns: 82px 1fr; gap: 10px; min-height: 116px; padding: 8px 0; margin: 0; border-bottom: 1px solid #d8e2e4; }
    .rank-cover img { width: 82px; height: 110px; padding: 2px; }
    .rank-info h2 { height: 24px; line-height: 24px; font-size: 15px; }
    .rank-info h2 span { display: none; }
    .rank-info p { height: 78px; line-height: 1.7; padding-top: 5px; text-indent: 0; }
}

.float-tools { position: fixed; right: 18px; bottom: 26px; z-index: 50; display: grid; gap: 8px; }
.float-tools button { width: 54px; height: 34px; border: 1px solid #5eb1d8; background: #79c2e3; color: #fff; border-radius: 3px; cursor: pointer; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.float-tools button:hover { background: #4eadd0; }
body.dark-mode { background: #1e1e1e; color: #aaa; }
body.dark-mode a { color: #9eb8e8; }
body.dark-mode .topbar,
body.dark-mode .site-header,
body.dark-mode .footer { background: #252525; border-color: #3a3a3a; color: #888; }
body.dark-mode .nav,
body.dark-mode .m-nav { background: #333; }
body.dark-mode .nav a:hover,
body.dark-mode .m-nav a:hover { background: #444; }
body.dark-mode .rec-panel,
body.dark-mode .hero-layout,
body.dark-mode .category-grid-home,
body.dark-mode .rank-page,
body.dark-mode .history-box,
body.dark-mode .search-page,
body.dark-mode .book-detail,
body.dark-mode .intro-box,
body.dark-mode .chapter-box,
body.dark-mode .category-box,
body.dark-mode .latest-box,
body.dark-mode .new-box,
body.dark-mode .classic-box,
body.dark-mode .page-content { background: #2a2a2a; border-color: #444; }
body.dark-mode .reader { background: #202020; border-color: #444; }
body.dark-mode .chapter-content { color: #b8b8b8; }
body.dark-mode .layout-tit,
body.dark-mode .tp-box h2,
body.dark-mode .intro-box h2,
body.dark-mode .chapter-box h2,
body.dark-mode .latest-box h2,
body.dark-mode .new-box h2,
body.dark-mode .classic-box h2,
body.dark-mode .history-box h1,
body.dark-mode .category-box h1,
body.dark-mode .cat-card h2,
body.dark-mode .search-page h1 { background: #333; color: #ccc; border-color: #444; }
body.dark-mode .rec-info p,
body.dark-mode .hero-info p,
body.dark-mode .cat-top p,
body.dark-mode .rank-info p,
body.dark-mode .intro-box p,
body.dark-mode .book-meta p,
body.dark-mode .result-info .desc { color: #aaa; }
body.dark-mode .history-table th { background: #333; color: #ccc; }
body.dark-mode .history-table th,
body.dark-mode .history-table td,
body.dark-mode .latest-list li,
body.dark-mode .new-list li,
body.dark-mode .classic-box li,
body.dark-mode .cat-links li { border-color: #444; }
body.dark-mode .input-key,
body.dark-mode .search-inline input,
body.dark-mode .pager select { background: #222; color: #ddd; border-color: #555; }
@media (max-width: 768px) {
    .float-tools { right: 10px; bottom: 14px; }
    .float-tools button { width: 48px; height: 32px; font-size: 13px; }
}

.list-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 22px; padding: 12px; border: 3px solid #b9dff1; background: #fffdf6; margin-bottom: 18px; }
.list-hero-book { display: grid; grid-template-columns: 126px 1fr; gap: 14px; min-height: 176px; overflow: hidden; }
.list-cover img { width: 126px; height: 170px; object-fit: cover; border: 1px solid #abc6d4; padding: 3px; background: #fff; }
.list-info h2 { height: 30px; line-height: 30px; font-size: 15px; border-bottom: 1px dotted #c7d8e3; overflow: hidden; }
.list-info h2 a { color: #5b6fad; font-weight: 700; }
.list-info h2 span { float: right; max-width: 78px; color: #aaa; font-weight: 400; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.list-info p { padding-top: 8px; color: #555; line-height: 1.85; height: 132px; overflow: hidden; text-indent: 2em; }
.list-columns { display: grid; grid-template-columns: 1fr 335px; gap: 14px; align-items: start; }
.all-list-box, .all-new-box { margin-bottom: 18px; }
@media (max-width: 768px) {
    .list-hero { display: block; padding: 8px; border-width: 2px; margin-bottom: 10px; }
    .list-hero-book { grid-template-columns: 82px 1fr; gap: 10px; min-height: 116px; padding: 8px 0; border-bottom: 1px solid #d8e2e4; }
    .list-hero-book:last-child { border-bottom: 0; }
    .list-cover img { width: 82px; height: 110px; padding: 2px; }
    .list-info h2 { height: 24px; line-height: 24px; font-size: 15px; }
    .list-info h2 span { display: none; }
    .list-info p { height: 78px; line-height: 1.7; padding-top: 5px; text-indent: 0; }
    .list-columns { display: block; }
}

.home-update-columns { display: grid; grid-template-columns: 1fr 335px; gap: 14px; align-items: start; margin-top: 16px; }
@media (max-width: 768px) {
    .home-update-columns { display: flex; flex-direction: column; width: 100%; max-width: 100%; margin-top: 10px; }
    .home-update-columns .new-box { order: 1; }
    .home-update-columns .latest-box { order: 2; }
    .home-update-columns .new-box,
    .home-update-columns .latest-box { width: 100%; max-width: 100%; min-width: 0; }
}

.novel-panel { border: 3px solid #86c9e8; background: #eef6f6; margin-bottom: 22px; }
.novel-panel .crumb { height: 34px; line-height: 34px; padding: 0 12px; color: #456; border-bottom: 1px solid #b9dff1; background: #dcecef; }
.novel-head { display: grid; grid-template-columns: 160px 1fr; gap: 24px; padding: 14px 28px 18px; }
.novel-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 160px;
    min-height: 200px;
    box-sizing: border-box;
    background: rgba(0,0,0,.04);
    padding: 12px;
    overflow: hidden;
}
.novel-cover img {
    display: block;
    width: 100%;
    height: 176px;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
}
.novel-info h1 { font-size: 30px; line-height: 44px; color: #333; }
.novel-meta { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; border-bottom: 1px dashed #86aebd; padding-bottom: 6px; margin-bottom: 8px; }
.novel-meta p { height: 28px; line-height: 28px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #444; }
.novel-meta .novel-incomplete { color: #b54800; font-weight: 700; grid-column: 1 / -1; }
.novel-desc { grid-column: 2; line-height: 1.8; color: #444; }
.novel-actions { display: none; }
.novel-desc-toggle { display: none; }
.chapter-catalog { border: 3px solid #4eadd0; background: #eef6f6; margin-bottom: 30px; }
.chapter-catalog h2 { height: 38px; line-height: 38px; text-align: center; background: #9fb6bd; color: #333; font-size: 16px; border-bottom: 1px solid #9fc9db; }
.chapter-catalog .chapter-list { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 12px; list-style: none; }
.chapter-catalog .chapter-list li { height: 40px; line-height: 40px; border-bottom: 1px dashed #9fb6bd; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-right: 16px; }
.chapter-catalog .chapter-list.latest li { font-weight: 700; }
.catalog-pager { display: grid; grid-template-columns: 250px 1fr 250px; gap: 18px; padding: 16px 12px; }
.catalog-pager a, .catalog-pager span, .catalog-pager button, .catalog-pager select { height: 40px; line-height: 40px; border: 0; text-align: center; border-radius: 3px; }
.catalog-pager a, .catalog-pager span, .catalog-pager button { background: #1e6f8a; color: #fff; cursor: pointer; font: inherit; }
.catalog-pager button:disabled { cursor: default; opacity: .65; }
.catalog-pager select { background: #fff; border: 1px solid #ddd; padding: 0 12px; text-align: left; }
.hot-recommend { background: #eee; padding: 18px 14px; margin-bottom: 20px; }
.hot-recommend h2 { text-align: center; color: #777; font-size: 16px; margin-bottom: 14px; font-weight: 400; }
.hot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 45px; }
.hot-grid a { display: block; height: 38px; line-height: 38px; text-align: center; background: #e3e3e3; color: #333; border-radius: 3px; }
@media (max-width: 768px) {
    .novel-panel, .chapter-catalog { border-width: 2px; margin-bottom: 12px; }
    .novel-panel .crumb { height: auto; line-height: 1.5; padding: 8px; }
    .novel-head { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 10px; align-items: start; }
    .novel-cover { width: 96px; min-height: 126px; padding: 4px; background: rgba(255,255,255,.45); }
    .novel-cover img { width: 100%; height: 118px; object-fit: contain; object-position: center; }
    .novel-info { min-width: 0; }
    .novel-info h1 { font-size: 18px; line-height: 28px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .novel-meta { display: block; border-bottom: 0; padding-bottom: 0; margin-bottom: 6px; }
    .novel-meta p { height: 26px; line-height: 26px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .novel-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; grid-column: 1 / -1; margin: 2px 0 8px; }
    .novel-action { display: block; height: 32px; line-height: 32px; border: 0; border-radius: 4px; color: #fff; text-align: center; font-weight: 700; font-size: 14px; cursor: pointer; }
    .novel-action:hover { color: #fff; text-decoration: none; opacity: .92; }
    .novel-action.start { background: #f0305a; }
    .novel-action.shelf { background: #f1a51e; }
    .novel-action.bottom { background: #5b8cc3; }
    .novel-desc { grid-column: 1 / -1; max-height: 118px; overflow: hidden; line-height: 1.85; color: #444; }
    .novel-desc.is-expanded { max-height: none; }
    .novel-desc-toggle { display: block; grid-column: 1 / -1; justify-self: center; margin-top: -2px; border: 0; background: transparent; color: #4d6da8; font-weight: 700; font-size: 14px; cursor: pointer; }
    .chapter-catalog .chapter-list { grid-template-columns: 1fr; padding: 0 8px; }
    .chapter-catalog .chapter-list li { height: 36px; line-height: 36px; padding-right: 0; }
    .catalog-pager { grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 8px; }
    .catalog-pager select { grid-column: 1 / -1; order: -1; }
    .hot-grid { grid-template-columns: 1fr; gap: 8px; }
}

.float-tools a { width: 54px; height: 34px; line-height: 34px; border: 1px solid #5eb1d8; background: #79c2e3; color: #fff; border-radius: 3px; cursor: pointer; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.12); text-align: center; }
.float-tools a:hover { background: #4eadd0; color: #fff; text-decoration: none; }
@media (max-width: 768px) {
    .chapter-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .chapter-nav a, .chapter-nav span { width: 100%; }
    .float-tools a { width: 48px; height: 32px; line-height: 32px; font-size: 13px; }
}

@media (max-width: 768px) {
    .reader .chapter-nav { grid-template-columns: 1fr 1fr; }
    .reader .chapter-nav a:last-child,
    .reader .chapter-nav span:last-child { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
    .container, .page-main, .site-header, .header-inner, .reader, .novel-panel, .chapter-catalog { max-width: 100%; overflow-x: hidden; }
    .search-form { width: 100%; max-width: 100%; }
    .input-key { min-width: 0; }
    .btn-tosearch { flex: 0 0 68px; width: 68px; }
    .m-nav { max-width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
    .reader { padding-left: 10px; padding-right: 10px; }
    .crumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .reader-head h1 { max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
    .reader-head p { white-space: normal; overflow-wrap: anywhere; }
    .chapter-content { max-width: 100%; overflow-wrap: break-word; word-break: break-word; }
    .chapter-content p { max-width: 100%; overflow-wrap: break-word; word-break: break-word; }
    .float-tools { right: 8px; }
}

.header-bookshelf { display: none; margin-left: auto; padding: 6px 13px; color: #fff; border: 1px solid rgba(255,255,255,.65); border-radius: 3px; font-weight: 700; white-space: nowrap; }
.header-bookshelf:hover { color: #fff; background: rgba(255,255,255,.16); text-decoration: none; }
@media (max-width: 768px) {
    .header-inner { position: relative; }
    .header-bookshelf { display: inline-block; position: absolute; right: 0; top: 0; margin-left: 0; padding: 4px 9px; color: #0871bd; border-color: #79c2e3; background: rgba(255,255,255,.55); font-size: 13px; }
    .header-bookshelf:hover { color: #0871bd; background: rgba(255,255,255,.8); }
}

.mobile-reader-tools {
    display: grid;
    grid-template-columns: auto 32px 32px 32px auto 48px 48px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px dashed #d8cfbd;
}
.mobile-reader-tools.bottom { border-top: 1px dashed #d8cfbd; border-bottom: 0; margin-top: 8px; }
.mobile-reader-tools span { color: #287dc2; }
.mobile-reader-tools label { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.mobile-reader-tools select { height: 28px; border: 1px solid #83bfe0; background: #fff; }
.mobile-reader-tools button { height: 28px; border: 1px solid #1e8bd1; background: #fff; color: #006eb8; border-radius: 3px; cursor: pointer; }
.mobile-reader-tools button.active { background: #d8effc; font-weight: 700; }
@media (min-width: 1024px) {
    .reader { position: relative; }
    .reader > .crumb { padding-right: 390px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .reader > .mobile-reader-tools:not(.bottom) {
        position: absolute;
        top: 5px;
        right: 24px;
        z-index: 2;
        width: auto;
        padding: 0;
        background: transparent;
        border: 0;
    }
    .reader > .mobile-reader-tools.bottom { display: none; }
}
.chapter-hot { margin: 18px 0; padding: 18px 14px; background: #eee; }
.chapter-hot h2 { text-align: center; color: #777; font-size: 16px; font-weight: 400; margin-bottom: 14px; }
.chapter-hot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 36px; }
.chapter-hot-grid a { display: block; height: 34px; line-height: 34px; text-align: center; background: #e3e3e3; color: #333; border-radius: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
body.dark-mode .chapter-hot { background: #2a2a2a; }
body.dark-mode .chapter-hot-grid a { background: #333; color: #bbb; }
@media (max-width: 768px) {
    .mobile-reader-tools { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; padding: 8px 0; border-bottom: 1px dashed #d8cfbd; }
    .mobile-reader-tools.bottom { border-top: 1px dashed #d8cfbd; border-bottom: 0; margin-top: 8px; }
    .mobile-reader-tools button,
    .mobile-reader-tools a { height: 28px; line-height: 28px; border: 1px solid #d8cfbd; background: #fff; color: #287dc2; border-radius: 2px; text-align: center; font-size: 12px; padding: 0; }
    .mobile-reader-tools button { cursor: pointer; }
    .mobile-reader-tools a:hover { text-decoration: none; }
    body.dark-mode .mobile-reader-tools button,
    body.dark-mode .mobile-reader-tools a { background: #333; border-color: #555; color: #9eb8e8; }
    .chapter-hot { margin: 12px 0; padding: 12px 8px; }
    .chapter-hot-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .chapter-hot-grid a { height: 32px; line-height: 32px; font-size: 13px; }
}

@media (max-width: 768px) {
    .reader .chapter-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
    .reader .chapter-nav a,
    .reader .chapter-nav span { border-radius: 0; }
    .reader .chapter-nav a:last-child,
    .reader .chapter-nav span:last-child { grid-column: auto; }
}

body.reader-bg-eye .reader { background: #e9fbfb; }
body.reader-bg-paper .reader { background: #f6f1e7; }
body.reader-bg-gray .reader { background: #eeeeee; }
@media (max-width: 768px) {
    .mobile-reader-tools { grid-template-columns: auto 28px 28px 28px 1fr 42px 42px; align-items: center; gap: 4px; padding: 7px 4px; background: #fff; }
    .mobile-reader-tools span { color: #287dc2; font-size: 13px; }
    .mobile-reader-tools label { display: flex; align-items: center; gap: 3px; min-width: 0; font-size: 12px; color: #333; white-space: nowrap; }
    .mobile-reader-tools select { width: 54px; height: 25px; border: 1px solid #83bfe0; background: #fff; font-size: 12px; }
    .mobile-reader-tools button { height: 25px; line-height: 23px; border: 1px solid #1e8bd1; background: #fff; color: #006eb8; border-radius: 3px; font-size: 12px; }
    .mobile-reader-tools button.active { background: #d8effc; font-weight: 700; }
    .mobile-reader-tools a { display: none; }
    body.dark-mode .mobile-reader-tools { background: #292929; }
    body.dark-mode .mobile-reader-tools span,
    body.dark-mode .mobile-reader-tools label { color: #bbb; }
    body.dark-mode .mobile-reader-tools select,
    body.dark-mode .mobile-reader-tools button { background: #333; border-color: #666; color: #9eb8e8; }
}

body.dark-mode .logo a { color: #b8d7ef; text-shadow: 1px 1px 0 #1a3c55; }
body.dark-mode .reader { background: #242424; }
body.dark-mode .reader-head h1 { color: #ddd; }
body.dark-mode .reader-head p,
body.dark-mode .crumb { color: #aaa; }
body.dark-mode .chapter-content { color: #d2d2d2; }
body.dark-mode .chapter-content p { color: #d2d2d2; }
body.dark-mode.reader-bg-paper .reader,
body.dark-mode.reader-bg-eye .reader,
body.dark-mode.reader-bg-gray .reader { background: #242424; }
@media (max-width: 768px) {
    .mobile-reader-tools { grid-template-columns: auto 28px 28px 28px 1fr 42px; }
    body.dark-mode .mobile-reader-tools { background: #2b2b2b; border-color: #555; }
}

:root { --reader-bg-custom: #E9FAFF; }
.reader { background: var(--reader-bg-custom, #f6f1e7); }
body:not(.dark-mode) .reader { background: var(--reader-bg-custom, #E9FAFF); }
body:not(.dark-mode) .chapter-content { color: #333; }

@media (max-width: 768px) {
    .mobile-reader-tools { grid-template-columns: auto 28px 28px 28px 1fr 42px 42px; }
}

@media (max-width: 768px) {
    .reader > .crumb,
    .reader > .reader-head { display: none; }
    .reader { padding-top: 0; }
}

/* 关灯只作用于章节正文，头部、搜索、工具栏和翻页保持原样。 */
body.dark-mode { background: #e6f8fb; color: #555; }
body.dark-mode a { color: #4d6da8; }
body.dark-mode .topbar { background: #d9eef3; border-color: #b8dce7; color: #6d8f9e; }
body.dark-mode .site-header,
body.dark-mode .footer { background: #e6f8fb; border-color: #72c4e8; color: #555; }
body.dark-mode .nav,
body.dark-mode .m-nav { background: #79c2e3; }
body.dark-mode .nav a,
body.dark-mode .m-nav a { color: #fff; }
body.dark-mode .input-key,
body.dark-mode .search-inline input,
body.dark-mode .pager select { background: #fff; color: #333; border-color: #9bc7df; }
body.dark-mode .reader,
body.dark-mode.reader-bg-paper .reader,
body.dark-mode.reader-bg-eye .reader,
body.dark-mode.reader-bg-gray .reader { background: #2f3437; border-color: #444; }
body.dark-mode .reader-head h1 { color: #ddd; }
body.dark-mode .reader-head p,
body.dark-mode .crumb { color: #aaa; }
body.dark-mode .chapter-nav a,
body.dark-mode .chapter-nav span { background: #363b3f; border-color: #555; color: #c8c8c8; }
body.dark-mode .mobile-reader-tools { background: #2f3437; border-color: #555; }
body.dark-mode .mobile-reader-tools span,
body.dark-mode .mobile-reader-tools label { color: #c8c8c8; }
body.dark-mode .mobile-reader-tools select,
body.dark-mode .mobile-reader-tools button { background: #363b3f; border-color: #6b747b; color: #c8d7e8; }
body.dark-mode .chapter-content { background: transparent; color: #aaa; }
body.dark-mode .reader-content-title { border-color: #555; color: #bbb; }
body.dark-mode .chapter-content p { color: #aaa; }
body.dark-mode .logo a { color: #0871bd; text-shadow: 2px 2px 0 #c3e3f1; }
body.dark-mode .header-bookshelf { color: #0871bd; border-color: #79c2e3; background: rgba(255,255,255,.55); }
body.dark-mode .header-bookshelf:hover { color: #0871bd; background: rgba(255,255,255,.8); }
body.dark-mode .chapter-hot { background: #eee; }
body.dark-mode .chapter-hot h2 { color: #777; }
body.dark-mode .chapter-hot-grid a { background: #e3e3e3; color: #333; }
.error-page { text-align: center; padding: 54px 20px 62px; border: 3px solid #86c9e8; background: #fffdf6; }
.error-page h1 { margin-bottom: 12px; color: #287dc2; font-size: 30px; font-weight: 700; }
.error-page p { margin: 8px 0; color: #555; }
.error-home { display: inline-block; min-width: 110px; height: 34px; margin-top: 12px; line-height: 34px; background: #4eadd0; color: #fff; border-radius: 3px; }
.error-home:hover { color: #fff; text-decoration: none; background: #287dc2; }
@media (max-width: 768px) {
    body.dark-mode .site-header { background: #dff5fb; }
    .error-page { padding: 42px 12px 48px; border-width: 2px; }
    .error-page h1 { font-size: 24px; }
}

@media (max-width: 768px) {
    .mobile-reader-tools {
        align-items: center;
    }
    .mobile-reader-tools span,
    .mobile-reader-tools label,
    .mobile-reader-tools button,
    .mobile-reader-tools select {
        height: 25px;
        line-height: 25px;
        vertical-align: middle;
    }
    .mobile-reader-tools span,
    .mobile-reader-tools label {
        display: flex;
        align-items: center;
    }
    .mobile-reader-tools button {
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }
    .mobile-reader-tools select {
        padding: 0 4px;
        line-height: 25px;
    }
}

/* Home update/new panels alignment fix */
.home-update-columns .latest-box,
.home-update-columns .new-box { align-self: start; }
.home-update-columns .latest-list,
.home-update-columns .new-list { padding: 8px 10px; font-size: 13px; }
.home-update-columns .latest-list li,
.home-update-columns .new-list li { height: 31px; line-height: 31px; border-bottom: 1px solid #d8e2e4; }
.home-update-columns .latest-list li { grid-template-columns: 92px 188px minmax(0, 1fr) 78px 42px; gap: 7px; }
.home-update-columns .new-list li { grid-template-columns: 82px minmax(0, 1fr) 62px; gap: 7px; }
.home-update-columns .latest-list .type,
.home-update-columns .latest-list .book,
.home-update-columns .latest-list .chapter,
.home-update-columns .latest-list .author,
.home-update-columns .latest-list .date,
.home-update-columns .new-list span,
.home-update-columns .new-list a,
.home-update-columns .new-list em { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 768px) {
    .home-update-columns .latest-list,
    .home-update-columns .new-list { padding: 4px 8px; font-size: 14px; }
    .home-update-columns .latest-list li,
    .home-update-columns .new-list li { height: 34px; line-height: 34px; }
    .home-update-columns .latest-list li { grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
    .home-update-columns .new-list li { grid-template-columns: minmax(0, 1fr) 88px; gap: 6px; }
}

/* rank-static-layout */
.rank-page.rank-static {
    display: block !important;
    border: 2px solid #86c7e7;
    background: #fffdf6;
    padding: 10px 12px;
    margin: 12px auto 0;
    box-sizing: border-box;
}
.rank-page.rank-static .rank-list {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 18px;
}
.rank-page.rank-static .rank-book {
    float: none !important;
    width: auto !important;
    min-height: 164px;
    margin: 0 !important;
    padding: 0 0 10px;
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 12px;
    border-bottom: 1px dotted #b9ccd2;
    box-sizing: border-box;
    overflow: hidden;
}
.rank-page.rank-static .rank-cover,
.rank-page.rank-static .rank-cover img {
    display: block;
    width: 116px;
    height: 154px;
}
.rank-page.rank-static .rank-cover img {
    object-fit: cover;
    border: 1px solid #b7cbd4;
    background: #f4f4f4;
    box-sizing: border-box;
}
.rank-page.rank-static .rank-info {
    min-width: 0;
    overflow: hidden;
}
.rank-page.rank-static .rank-info h2 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 5px;
    padding: 0 0 4px;
    border-bottom: 1px dotted #b9ccd2;
    font-size: 15px;
    line-height: 22px;
    white-space: nowrap;
}
.rank-page.rank-static .rank-info h2 a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rank-page.rank-static .rank-author {
    margin-left: auto;
    max-width: 66px;
    color: #aaa;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rank-page.rank-static .rank-desc {
    margin: 0;
    color: #333;
    font-size: 13px;
    line-height: 24px;
    text-indent: 2em;
    max-height: 120px;
    overflow: hidden;
}
.rank-page.rank-static .empty-list {
    grid-column: 1 / -1;
    margin: 0;
    padding: 12px;
    color: #555;
}
@media (max-width: 720px) {
    .rank-page.rank-static {
        padding: 8px;
    }
    .rank-page.rank-static .rank-list {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .rank-page.rank-static .rank-book {
        min-height: 108px;
        grid-template-columns: 78px minmax(0, 1fr);
        gap: 8px;
        padding: 8px 0;
    }
    .rank-page.rank-static .rank-cover,
    .rank-page.rank-static .rank-cover img {
        width: 76px;
        height: 100px;
    }
    .rank-page.rank-static .rank-info h2 {
        font-size: 14px;
        line-height: 20px;
    }
    .rank-page.rank-static .rank-desc {
        font-size: 13px;
        line-height: 20px;
        max-height: 60px;
        text-indent: 0;
    }
}
/* /rank-static-layout */

/* static rank page, bqg style */
.rank-page.rank-page-bqg {
  display: block;
  border: 2px solid #8ed1ef;
  background: #fffdf6;
  padding: 12px;
}
.rank-page-bqg .rank-title-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  margin: 0 0 10px;
  min-height: 28px;
}
.rank-page-bqg .rank-title-row h2 {
  margin: 0;
  font-size: 22px;
  line-height: 28px;
  color: #444;
  font-weight: 700;
}
.rank-page-bqg .rank-title-row strong {
  grid-column: 2 / 3;
  text-align: center;
  font-size: 18px;
  line-height: 28px;
  color: #444;
}
.rank-page-bqg .rank-waterfall {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 12px;
}
.rank-page-bqg .rank-tile {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  min-height: 156px;
  overflow: hidden;
}
.rank-page-bqg .rank-tile-cover img {
  width: 110px;
  height: 148px;
  object-fit: cover;
  border: 1px solid #b7d2dd;
  background: #fff;
}
.rank-page-bqg .rank-tile-body {
  min-width: 0;
}
.rank-page-bqg .rank-tile h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  padding-bottom: 2px;
  border-bottom: 1px dotted #9fc7d6;
  font-size: 14px;
  line-height: 22px;
}
.rank-page-bqg .rank-tile h3 a {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-page-bqg .rank-tile h3 span,
.rank-page-bqg .rank-tile h3 em {
  color: #999;
  font-weight: 400;
  font-style: normal;
  white-space: nowrap;
}
.rank-page-bqg .rank-meta {
  margin: 4px 0;
  font-size: 13px;
  line-height: 22px;
  text-align: center;
}
.rank-page-bqg .rank-meta a {
  display: inline;
}
.rank-page-bqg .rank-desc {
  margin: 6px 0 0;
  color: #333;
  font-size: 13px;
  line-height: 23px;
  max-height: 92px;
  overflow: hidden;
}
@media (max-width: 720px) {
  .rank-page.rank-page-bqg {
    padding: 8px;
  }
  .rank-page-bqg .rank-title-row {
    display: flex;
    justify-content: space-between;
  }
  .rank-page-bqg .rank-title-row h2 {
    font-size: 20px;
  }
  .rank-page-bqg .rank-title-row strong {
    font-size: 16px;
  }
  .rank-page-bqg .rank-waterfall {
    grid-template-columns: 1fr;
    row-gap: 10px;
  }
  .rank-page-bqg .rank-tile {
    grid-template-columns: 86px minmax(0, 1fr);
    min-height: 116px;
  }
  .rank-page-bqg .rank-tile-cover img {
    width: 86px;
    height: 116px;
  }
  .rank-page-bqg .rank-desc {
    max-height: 66px;
  }
}

/* static category layout fix */
body { background: #e6f8fb; color: #333; font: 14px/1.8 "Microsoft YaHei", "PingFang SC", Arial, sans-serif; }
a { color: #2d65ad; }
a:hover { color: #c00; text-decoration: underline; }
.container, .topbar-con, .header-inner, .nav-inner { width: 980px; max-width: 980px; margin: 0 auto; }
.site-header { background: #e6f8fb; }
.header-inner { height: 86px; display: flex; align-items: center; gap: 28px; }
.logo { width: 180px; font-size: 34px; line-height: 1; font-family: Georgia, "Microsoft YaHei", serif; font-weight: 700; }
.logo a { color: #0871bd; text-shadow: 2px 3px 3px rgba(0, 90, 150, .28); }
.logo a:hover { text-decoration: none; color: #0871bd; }
.search-form { margin-left: auto; flex: 0 0 470px; display: flex; height: 38px; border: 1px solid #9bd5ee; background: #fff; }
.input-key { flex: 1; height: 36px; padding: 0 12px; border: 0; font-size: 14px; outline: 0; }
.btn-tosearch { width: 78px; height: 36px; border: 0; background: #ddd; color: #222; cursor: pointer; }
.nav { width: 980px; max-width: 980px; height: 42px; margin: 0 auto; background: #74c0df; display: block; overflow: hidden; }
.nav-inner { display: flex; height: 42px; width: 980px; }
.nav a { display: block; color: #fff; font-weight: 700; line-height: 42px; padding: 0 12px; white-space: nowrap; }
.nav a:hover, .nav a.active { background: #57acd2; color: #fff; text-decoration: none; }
.page-main { padding: 12px 0 20px; }

.home-featured { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 18px; border: 3px solid #9bd5ee; background: #fffdf5; padding: 10px; margin-bottom: 12px; }
.home-featured .book-card, .home-grid-cats .book-card { display: grid; grid-template-columns: 112px 1fr; gap: 12px; min-height: 150px; overflow: hidden; }
.book-cover { display: block; width: 112px; }
.book-cover img { width: 112px; height: 150px; object-fit: cover; border: 1px solid #b7d3df; background: #fff; }
.book-info { min-width: 0; }
.book-info h3 { height: 26px; line-height: 26px; margin: 0 0 6px; border-bottom: 1px dotted #b9cfd7; font-size: 15px; overflow: hidden; }
.book-info h3 a { font-weight: 700; }
.book-info h3 span { float: right; max-width: 72px; color: #aaa; font-weight: 400; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.book-info p { margin: 0; text-indent: 2em; height: 108px; overflow: hidden; color: #333; line-height: 1.85; }

.home-grid-cats { display: grid; grid-template-columns: repeat(3, 1fr); border: 3px solid #9bd5ee; background: #fffdf5; margin-bottom: 12px; }
.cat-box { min-height: 275px; padding: 8px 12px; border-right: 1px dotted #9bd5ee; border-bottom: 1px solid #ddd; overflow: hidden; }
.cat-box:nth-child(3n) { border-right: 0; }
.cat-box h2 { margin: 0 0 8px; height: 24px; line-height: 24px; border-bottom: 1px solid #cddbe0; font-size: 16px; color: #333; }
.cat-box .book-card { grid-template-columns: 86px 1fr; min-height: 116px; margin-bottom: 6px; }
.cat-box .book-cover, .cat-box .book-cover img { width: 86px; }
.cat-box .book-cover img { height: 116px; }
.cat-box .book-info h3 { font-size: 14px; height: 24px; line-height: 24px; }
.cat-box .book-info p { height: 96px; font-size: 13px; line-height: 24px; }
.mini-list, .side-list, .update-list, .category-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; height: 24px; line-height: 24px; border-top: 1px solid #ddd; overflow: hidden; }
.mini-list a { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mini-list span { width: 74px; margin-left: 6px; color: #666; text-align: right; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.home-bottom { display: grid; grid-template-columns: 1fr 300px; gap: 12px; margin-bottom: 12px; }
.latest-panel, .new-panel, .category-page { border: 3px solid #9bd5ee; background: #eefafa; }
.latest-panel h2, .new-panel h2 { height: 36px; line-height: 36px; padding: 0 12px; background: #9bd5ee; font-size: 16px; color: #333; }
.update-list li, .side-list li, .category-list li { display: grid; align-items: center; min-height: 30px; line-height: 30px; border-bottom: 1px solid #d1e3e8; overflow: hidden; }
.update-list li { grid-template-columns: 88px minmax(120px,1.15fr) minmax(180px,1.45fr) 90px 50px; column-gap: 8px; padding: 0 10px; }
.side-list li { grid-template-columns: 76px minmax(0, 1fr) 76px; column-gap: 0; padding: 0 10px; }
.side-list li.long-title { grid-template-columns: 76px minmax(0, 1fr); }
.category-list li { grid-template-columns: 90px minmax(220px,1fr) minmax(240px,1.2fr) 120px 78px; column-gap: 8px; padding: 0 12px; }
.update-list a, .side-list a, .category-list a, .cat-label, .author-name, .book-status, .update-date, .side-list em { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cat-label { color: #555; }
.author-name, .book-status, .update-date, .side-list em { color: #777; font-style: normal; text-align: right; }
.category-page { padding-bottom: 8px; }
.category-page h2 { height: 42px; line-height: 42px; padding: 0 12px; background: #fff; border-bottom: 1px solid #ddd; color: #0871bd; font-size: 18px; }
.category-list-pager { display: grid; grid-template-columns: 160px minmax(160px, 1fr) 160px; gap: 12px; padding: 12px 10px 10px; background: #eefafa; }
.category-list-pager button, .category-list-pager select { width: 100%; height: 36px; border-radius: 2px; font: inherit; }
.category-list-pager button { border: 0; background: #4badd3; color: #fff; cursor: pointer; }
.category-list-pager button:disabled { opacity: .55; cursor: default; }
.category-list-pager select { border: 1px solid #b9d7e3; background: #fff; padding: 0 10px; }
.category-new-list-pager { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); gap: 5px; width: 100%; padding: 10px 6px; box-sizing: border-box; }
.category-new-list-pager button, .category-new-list-pager select { min-width: 0; padding-left: 3px; padding-right: 3px; font-size: 13px; }
.category-paged-list > [hidden] { display: none !important; }
.empty-box { margin: 0; padding: 28px 20px; background: #fff; border: 1px solid #ddd; }
.empty-box h2 { margin: 0 0 8px; font-size: 22px; color: #555; }
.empty-box p, .empty-text { color: #555; }

.rank-page-bqg { border: 3px solid #9bd5ee; background: #fffdf5; padding: 10px; }
.rank-title-row { display: grid; grid-template-columns: 1fr 1fr; height: 38px; line-height: 38px; border-bottom: 1px solid #ddd; margin-bottom: 8px; }
.rank-title-row h2, .rank-title-row strong { font-size: 20px; color: #333; }
.rank-bqg-list { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px 18px; }
.rank-bqg-item { display: grid; grid-template-columns: 112px 1fr; gap: 12px; min-height: 164px; overflow: hidden; }
.rank-cover img { width: 112px; height: 150px; object-fit: cover; border: 1px solid #b7d3df; }
.rank-info h3 { height: 26px; line-height: 26px; border-bottom: 1px dotted #b9cfd7; font-size: 15px; overflow: hidden; }
.rank-info h3 span { float: right; max-width: 72px; color: #aaa; font-weight: 400; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rank-info h3 em { float: right; margin-left: 6px; color: #999; font-style: normal; font-weight: 400; }
.rank-meta { height: auto !important; color: #555; font-size: 13px; }
.rank-info p { padding-top: 0; height: 130px; max-height: 130px; overflow: hidden; line-height: 26px; }

.footer { border-top: 2px solid #74c0df; padding: 18px 0 24px; text-align: center; color: #444; font-size: 12px; }
.float-tools { position: fixed; right: 16px; bottom: 16px; z-index: 20; }
.float-tools button { border: 1px solid #54afd4; background: #74c0df; color: #fff; border-radius: 3px; padding: 8px 10px; cursor: pointer; }

@media (max-width: 1023px) {
  .container, .topbar-con, .header-inner, .nav, .nav-inner { width: auto; max-width: none; }
  .topbar { display: block; }
  .topbar-con { padding: 0 10px; justify-content: center; }
  .site-header { padding: 10px; }
  .header-inner { height: auto; display: block; }
  .logo { width: auto; margin-bottom: 8px; font-size: 28px; }
  .search-form { width: 100%; max-width: none; margin: 0; flex-basis: auto; }
  .nav { margin: 0 10px; height: 38px; overflow-x: auto; }
  .nav-inner { display: flex; height: 38px; min-width: max-content; }
  .nav a { line-height: 38px; padding: 0 12px; }
  .page-main { padding: 8px 10px 16px; }
  .home-featured { display: block; padding: 8px; }
  .home-featured .book-card { grid-template-columns: 86px 1fr; min-height: 116px; padding: 8px 0; border-bottom: 1px solid #ddd; }
  .home-featured .book-cover, .home-featured .book-cover img { width: 86px; }
  .home-featured .book-cover img { height: 116px; }
  .home-grid-cats { display: block; }
  .cat-box { min-height: 0; border-right: 0; }
  .home-bottom { display: flex; flex-direction: column; }
  .new-panel { order: 1; }
  .latest-panel { order: 2; }
  .update-list li { grid-template-columns: 1fr 1fr; gap: 0 10px; min-height: 28px; line-height: 28px; }
  .update-list .cat-label, .update-list .author-name, .update-list .update-date { display: none; }
  .side-list li { grid-template-columns: 1fr 72px; min-height: 28px; line-height: 28px; }
  .side-list li span { display: none; }
  .category-list li { grid-template-columns: 1fr 72px; min-height: 30px; line-height: 30px; }
  .category-list .cat-label, .category-list .chapter-name { display: none; }
  .category-list .author-name, .category-list .book-status { text-align: right; }
  .category-page h2 { height: 36px; line-height: 36px; font-size: 16px; }
  .category-list-pager { grid-template-columns: 1fr 1.25fr 1fr; gap: 8px; padding: 10px 8px; }
  .category-new-list-pager { grid-template-columns: 1fr 1.25fr 1fr; }
  .rank-bqg-list { display: block; }
  .rank-bqg-item { grid-template-columns: 86px 1fr; min-height: 116px; padding: 8px 0; border-bottom: 1px solid #ddd; }
  .rank-cover img { width: 86px; height: 116px; }
}

/* mobile category layout restore: compact bqg-style category pages */
@media (max-width: 1023px) {
  .page-main > .container {
    width: auto;
    margin-left: 8px;
    margin-right: 8px;
  }

  .category-featured {
    display: block;
    padding: 8px 10px;
    border: 2px solid #8fd1ed;
    background: #fffdf4;
    margin-bottom: 10px;
    box-sizing: border-box;
  }

  .category-featured .book-card {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    min-height: 112px;
    padding: 8px 0;
    border-bottom: 1px solid #d8d8d8;
    overflow: hidden;
    box-sizing: border-box;
  }

  .category-featured .book-card:last-child {
    border-bottom: 0;
  }

  .category-featured .book-cover,
  .category-featured .book-cover img {
    width: 82px;
  }

  .category-featured .book-cover img {
    height: 110px;
    object-fit: cover;
  }

  .category-featured .book-info {
    min-width: 0;
  }

  .category-featured .book-info h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
    margin: 0 0 4px;
    padding-bottom: 3px;
    border-bottom: 1px dotted #b7d1da;
    font-size: 14px;
    line-height: 20px;
    overflow: hidden;
  }

  .category-featured .book-info h3 a {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .category-featured .book-info h3 span {
    flex: 0 0 auto;
    max-width: 5.5em;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #999;
    font-size: 12px;
    font-weight: normal;
  }

  .category-featured .book-info p {
    margin: 0;
    font-size: 13px;
    line-height: 22px;
    max-height: 66px;
    overflow: hidden;
  }

  .category-bottom {
    display: block;
    margin-top: 10px;
  }

  .category-bottom .latest-panel,
  .category-bottom .new-panel {
    width: 100%;
    margin: 0 0 10px;
    border: 2px solid #8fd1ed;
    box-sizing: border-box;
  }

  .category-bottom .latest-panel h2,
  .category-bottom .new-panel h2 {
    padding: 8px 10px;
    font-size: 14px;
    line-height: 20px;
  }

  .category-bottom .update-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 6px;
    align-items: center;
    min-height: 32px;
    padding: 0 8px;
    box-sizing: border-box;
  }

  .category-bottom .update-list .cat-label,
  .category-bottom .update-list .book-name,
  .category-bottom .update-list .chapter-name {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
  }

  .category-bottom .update-list .cat-label {
    display: none;
  }

  .category-bottom .update-list .author-name,
  .category-bottom .update-list .update-date {
    display: none;
  }

  .category-bottom .side-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 6px;
    align-items: center;
    min-height: 32px;
    padding: 0 8px;
    box-sizing: border-box;
  }

  .category-bottom .side-list li.long-title {
    grid-template-columns: minmax(0, 1fr);
  }

  .category-bottom .side-list li > span {
    display: none;
  }

  .category-bottom .side-list span,
  .category-bottom .side-list a,
  .category-bottom .side-list em {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
  }
}

/* desktop bqg scale restore */
@media (min-width: 1024px) {
  .container,
  .topbar-con,
  .header-inner,
  .nav-inner {
    width: 1024px;
    max-width: 1024px;
  }

  .home-featured {
    gap: 14px 20px;
    padding: 10px 12px;
  }

  .home-featured .book-card {
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 14px;
    min-height: 160px;
  }

  .home-featured .book-cover,
  .home-featured .book-cover img {
    width: 120px;
  }

  .home-featured .book-cover img {
    height: 160px;
  }

  .home-featured .book-info h3,
  .home-grid-cats .book-info h3 {
    font-size: 15px;
    line-height: 23px;
  }

  .home-featured .book-info p,
  .home-grid-cats .book-info p {
    font-size: 14px;
    line-height: 24px;
  }

  .cat-box {
    padding: 10px 12px;
  }

  .cat-box .book-card {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    min-height: 124px;
  }

  .cat-box .book-cover,
  .cat-box .book-cover img {
    width: 92px;
  }

  .cat-box .book-cover img {
    height: 124px;
  }

  .mini-list li,
  .side-list li,
  .update-list li {
    font-size: 14px;
    min-height: 24px;
    line-height: 24px;
  }

  .latest-panel h2,
  .new-panel h2,
  .cat-box h2 {
    font-size: 16px;
  }
}

/* 2026-07-12: desktop home layout restore: 4 featured + classic sidebar */
@media (min-width: 1024px) {
  .container,
  .topbar-con,
  .header-inner,
  .nav-inner {
    width: 1024px;
    max-width: 1024px;
    box-sizing: border-box;
  }

  .nav-inner {
    display: flex;
    align-items: stretch;
    overflow: visible;
    height: 40px;
  }

  .nav-inner a,
  .m-nav a {
    flex: 0 0 auto;
    display: block;
    padding: 0 10px;
    font-size: 14px;
    line-height: 40px;
    white-space: nowrap;
    box-sizing: border-box;
  }

  .home-showcase {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 12px;
    border: 3px solid #9bd5ee;
    background: #fffdf5;
    padding: 10px;
    margin: 0 0 12px;
    box-sizing: border-box;
  }

  .home-showcase .home-featured {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
    border: 0;
    margin: 0;
    padding: 0;
    background: transparent;
  }

  .home-showcase .home-featured .book-card {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    min-height: 160px;
    gap: 14px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .home-showcase .home-featured .book-card:nth-child(n+5) {
    display: none;
  }

  .home-showcase .book-cover,
  .home-showcase .book-cover img {
    width: 120px;
    height: 160px;
    object-fit: cover;
  }

  .classic-panel {
    border-left: 3px solid #9bd5ee;
    background: #eefafa;
    margin: -10px -10px -10px 0;
    min-width: 0;
  }

  .classic-panel h2 {
    height: 36px;
    line-height: 36px;
    margin: 0;
    padding: 0 12px;
    background: #d9edf0;
    color: #333;
    font-size: 16px;
    font-weight: 700;
  }

  .classic-panel ul {
    list-style: none;
    margin: 0;
    padding: 6px 10px;
  }

  .classic-panel li {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 68px;
    gap: 6px;
    height: 28px;
    line-height: 28px;
    border-bottom: 1px solid #d3e1e4;
    overflow: hidden;
  }

  .classic-panel li span,
  .classic-panel li a,
  .classic-panel li em {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-style: normal;
    font-size: 13px;
  }

  .classic-panel li a {
    color: #3366aa;
  }

  .classic-panel li em {
    color: #666;
    text-align: right;
  }
}

@media (max-width: 1023px) {
  .home-showcase {
    display: block;
    border: 2px solid #8fd1ed;
    background: #fffdf4;
    padding: 8px;
    margin-bottom: 10px;
  }

  .home-showcase .home-featured {
    display: block;
    border: 0;
    margin: 0;
    padding: 0;
    background: transparent;
  }

  .classic-panel {
    margin-top: 8px;
    border: 2px solid #8fd1ed;
    background: #eefafa;
  }

  .classic-panel h2 {
    height: 34px;
    line-height: 34px;
    margin: 0;
    padding: 0 10px;
    background: #d9edf0;
    font-size: 15px;
  }

  .classic-panel ul {
    list-style: none;
    margin: 0;
    padding: 4px 8px;
  }

  .classic-panel li {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 58px;
    gap: 4px;
    height: 30px;
    line-height: 30px;
    border-bottom: 1px solid #d3e1e4;
    overflow: hidden;
  }

  .classic-panel li span,
  .classic-panel li a,
  .classic-panel li em {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-style: normal;
    font-size: 13px;
  }

  .classic-panel li em {
    text-align: right;
  }
}

/* 2026-07-12: force desktop nav/header width to 1024px */
@media (min-width: 1024px) {
  .topbar-con,
  .header-inner,
  .nav-inner,
  .container {
    width: 1024px !important;
    max-width: 1024px !important;
    box-sizing: border-box;
  }

  .nav,
  .m-nav {
    width: 1024px !important;
    max-width: 1024px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
  }

  .nav-inner {
    display: flex !important;
    align-items: stretch !important;
    overflow: visible !important;
  }
}

/* 2026-07-12: remove current-menu selection mark, keep nav visually flat */
.nav a.active,
.nav a[aria-current="page"],
.m-nav a.active,
.m-nav a[aria-current="page"],
.nav-inner a.active,
.nav-inner a[aria-current="page"] {
  background: transparent !important;
  color: #fff !important;
  text-decoration: none !important;
}

.nav a:hover,
.m-nav a:hover,
.nav-inner a:hover {
  background: #57acd2 !important;
  color: #fff !important;
  text-decoration: none !important;
}

/* 2026-07-12: desktop starts at 1024px; below 1024 uses mobile adaptive layout */
@media (min-width: 1024px) {
  .topbar-con,
  .header-inner,
  .nav-inner,
  .container,
  .nav,
  .m-nav {
    width: 1024px !important;
    max-width: 1024px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  .nav,
  .m-nav {
    overflow: hidden !important;
  }
}

@media (max-width: 1023px) {
  .topbar-con,
  .header-inner,
  .nav-inner,
  .container,
  .nav,
  .m-nav {
    width: auto !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }

  .container,
  .header-inner,
  .topbar-con {
    margin-left: 10px !important;
    margin-right: 10px !important;
  }

  .nav,
  .m-nav {
    margin-left: 10px !important;
    margin-right: 10px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .nav-inner {
    min-width: max-content !important;
    display: flex !important;
  }
}

/* nav-hover-disabled: 导航条不保留 hover / focus / active 印记 */
.site-header nav a:hover,
.site-header nav a:focus,
.site-header nav a.active,
.site-header nav .active,
.header-inner nav a:hover,
.header-inner nav a:focus,
.header-inner nav a.active,
.header-inner nav .active,
.nav a:hover,
.nav a:focus,
.nav a.active,
.nav .active,
.m-nav a:hover,
.m-nav a:focus,
.m-nav a.active,
.m-nav .active {
    background: transparent !important;
    color: #fff !important;
    text-decoration: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

/* responsive-1024-fix:start */
/* 桌面版：传统站宽度固定 1024，导航与主体保持同宽 */
@media (min-width: 1024px) {
    .topbar-con,
    .site-header .header-inner,
    .header-inner,
    .container,
    .page-main,
    .main,
    .wrap,
    .footer-inner,
    .nav,
    .m-nav {
        width: 1024px !important;
        max-width: 1024px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
    }
}

/* 小于等于 1024：立即切到移动自适应，不再保留桌面定宽 */
@media (max-width: 1023px) {
    html,
    body {
        width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
    }

    body {
        margin: 0 !important;
    }

    .topbar,
    .site-header,
    .page-main,
    .footer,
    .topbar-con,
    .site-header .header-inner,
    .header-inner,
    .container,
    .footer-inner,
    .main,
    .wrap,
    .content,
    .nav,
    .m-nav {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }

    .topbar-con,
    .site-header .header-inner,
    .header-inner,
    .container,
    .main,
    .wrap,
    .page-main {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .site-header .header-inner,
    .header-inner {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .logo,
    .site-header h1,
    .site-header .logo {
        flex: 0 0 auto !important;
        width: auto !important;
        margin: 0 !important;
        text-align: left !important;
    }

    .header-bookshelf {
        margin-left: auto !important;
    }

    .search-form {
        order: 3 !important;
        flex: 0 0 100% !important;
        display: flex !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }

    .search-form .input-key,
    .search-form input[type="text"] {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
    }

    .search-form .btn-tosearch,
    .search-form button,
    .search-form input[type="submit"] {
        flex: 0 0 82px !important;
        width: 82px !important;
    }

    .nav,
    .m-nav {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 0 !important;
    }

    .nav a,
    .m-nav a {
        flex: 0 0 auto !important;
        padding: 0 12px !important;
        text-align: center !important;
    }

    .rank-page,
    .rank-grid,
    .rank-list,
    .ranking,
    .ranking-grid,
    .category-page .book-list,
    .category-list,
    .book-list,
    .list-page,
    .list-panel,
    .novel-list,
    .novel-panel {
        display: block !important;
        grid-template-columns: none !important;
        columns: auto !important;
        width: 100% !important;
    }

    .rank-item,
    .ranking-item,
    .book-list .book-item,
    .category-list .book-item,
    .list-page .book-item,
    .list-panel .book-item,
    .novel-list .book-item,
    .book-row,
    .item {
        display: grid !important;
        grid-template-columns: 88px minmax(0, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
        min-height: 118px !important;
        margin: 0 0 12px !important;
        padding-bottom: 10px !important;
        border-bottom: 1px dotted #98c9d9 !important;
        box-sizing: border-box !important;
        break-inside: avoid !important;
    }

    .rank-item img,
    .ranking-item img,
    .rank-cover img,
    .book-list .book-item img,
    .category-list .book-item img,
    .list-page .book-item img,
    .list-panel .book-item img,
    .novel-list .book-item img,
    .book-row img,
    .item img {
        width: 88px !important;
        height: 118px !important;
        object-fit: cover !important;
    }

    .rank-info,
    .ranking-info,
    .book-info,
    .book-meta,
    .item dl,
    .item .info {
        min-width: 0 !important;
    }

    .home-category-grid,
    .category-grid,
    .home-grid,
    .blocks-grid {
        display: block !important;
        grid-template-columns: none !important;
        width: 100% !important;
    }

    .home-category-grid > *,
    .category-grid > *,
    .home-grid > *,
    .blocks-grid > * {
        width: 100% !important;
        margin-bottom: 10px !important;
        box-sizing: border-box !important;
    }
}

/* 导航条不保留 hover/focus/active 视觉印记 */
.nav a:hover,
.nav a:focus,
.nav a:active,
.nav a.active,
.nav .active,
.m-nav a:hover,
.m-nav a:focus,
.m-nav a:active,
.m-nav a.active,
.m-nav .active,
.site-header nav a:hover,
.site-header nav a:focus,
.site-header nav a:active,
.site-header nav a.active,
.header-inner nav a:hover,
.header-inner nav a:focus,
.header-inner nav a:active,
.header-inner nav a.active {
    background: transparent !important;
    color: #fff !important;
    text-decoration: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}
/* responsive-1024-fix:end */
/* Homepage featured descriptions: clip at exactly five complete lines. */
@media (min-width: 1024px) {
  .home-showcase .book-info p,
  .category-featured .book-info p {
    height: 130px;
    line-height: 26px;
  }
}

/* Compact desktop header while preserving independent mobile layout. */
@media (min-width: 1024px) {
  .topbar,
  .topbar-con {
    height: 28px;
  }

  .header-inner {
    height: 68px;
  }

  .nav,
  .nav-inner {
    height: 38px;
  }

  .nav a,
  .nav-inner a {
    line-height: 38px;
  }

  .page-main {
    padding-top: 8px;
  }
}

/* Target-site adaptive header: up to 1023px mobile; 1024px and above desktop. */
.mobile-header-actions,
.mobile-category-nav {
  display: none;
}

@media (max-width: 1023px) {
  .topbar {
    display: none !important;
  }

  .site-header {
    padding: 0 !important;
    background: #e6f8fb !important;
  }

  .site-header .header-inner,
  .header-inner {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 0 !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    background: #e6f8fb !important;
  }

  .site-header .logo,
  .site-header h1 {
    height: 52px !important;
    line-height: 52px !important;
    padding-left: 12px !important;
    margin: 0 !important;
    color: #0871bd !important;
    font-size: 27px !important;
    text-shadow: 2px 3px 3px rgba(0, 90, 150, .28) !important;
  }

  .site-header .logo a {
    color: #0871bd !important;
    text-shadow: 2px 3px 3px rgba(0, 90, 150, .28) !important;
  }

  .mobile-header-actions {
    display: flex !important;
    gap: 8px !important;
    padding-right: 10px !important;
  }

  .mobile-header-actions a {
    display: block !important;
    min-width: 48px !important;
    height: 30px !important;
    line-height: 30px !important;
    padding: 0 8px !important;
    border-radius: 3px !important;
    background: #74c0df !important;
    color: #fff !important;
    text-align: center !important;
    font-size: 13px !important;
  }

  .mobile-category-nav {
    display: grid !important;
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    grid-column: 1 / -1 !important;
    width: 100% !important;
    height: 42px !important;
    background: #74c0df !important;
    border-top: 0 !important;
  }

  .mobile-category-nav a {
    min-width: 0 !important;
    height: 42px !important;
    line-height: 42px !important;
    padding: 0 !important;
    color: #fff !important;
    text-align: center !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
  }

  .site-header .search-form,
  .header-inner .search-form {
    display: flex !important;
    grid-column: 1 / -1 !important;
    order: initial !important;
    width: auto !important;
    height: 52px !important;
    margin: 0 !important;
    padding: 9px 10px !important;
    border: 0 !important;
    background: #e6f8fb !important;
    box-sizing: border-box !important;
  }

  .site-header .search-form .input-key,
  .site-header .search-form input[type="text"] {
    height: 34px !important;
    border: 1px solid #8dcde7 !important;
    border-right: 0 !important;
  }

  .site-header .search-form .btn-tosearch,
  .site-header .search-form button {
    flex: 0 0 82px !important;
    width: 82px !important;
    height: 34px !important;
    border: 1px solid #8dcde7 !important;
    background: #ddd !important;
    color: #222 !important;
  }

  body > .nav,
  body > nav.nav {
    display: none !important;
  }

  .page-main {
    padding-top: 0 !important;
  }

  .home-showcase {
    margin-top: 0 !important;
  }

  /* Book detail: keep metadata beside the cover, but move actions/intro full width. */
  .novel-head {
    display: grid !important;
    grid-template-columns: 96px minmax(0, 1fr) !important;
    gap: 8px 10px !important;
    padding: 10px !important;
    align-items: start !important;
  }

  .novel-head .novel-cover {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 96px !important;
    min-height: 126px !important;
    padding: 4px !important;
  }

  .novel-head .novel-cover img {
    width: 100% !important;
    height: 118px !important;
    object-fit: contain !important;
    object-position: center !important;
  }

  .novel-head .novel-info {
    display: contents !important;
  }

  .novel-head .novel-info h1 {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    height: auto !important;
    line-height: 27px !important;
    font-size: 18px !important;
    white-space: normal !important;
  }

  .novel-head .novel-meta {
    grid-column: 2 !important;
    grid-row: 2 !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .novel-head .novel-meta p {
    height: 25px !important;
    line-height: 25px !important;
  }

  .novel-head .novel-actions {
    grid-column: 1 / -1 !important;
    grid-row: 5 !important;
    margin: 2px 0 0 !important;
  }

  .novel-head .novel-desc {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    width: 100% !important;
    max-height: 112px !important;
    padding-top: 2px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .novel-head .novel-desc.is-expanded {
    max-height: none !important;
  }

  .novel-head .novel-desc-toggle {
    grid-column: 1 / -1 !important;
    grid-row: 4 !important;
  }

  .chapter-catalog .chapter-list {
    grid-template-columns: 1fr !important;
  }

  .reader .hot-recommend {
    margin: 14px 0 0 !important;
    padding: 14px 10px 16px !important;
    background: #fff !important;
  }

  .reader .hot-recommend h2 {
    margin-bottom: 12px !important;
    color: #888 !important;
    font-weight: 400 !important;
  }

  .reader .hot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px 14px !important;
  }

  .reader .hot-grid a {
    min-width: 0 !important;
    padding: 0 8px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }

  .page-main .container > .hot-recommend {
    margin: 0 0 14px !important;
    padding: 14px 10px 16px !important;
    background: #fff !important;
  }

  .page-main .container > .hot-recommend .hot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px 14px !important;
  }

  .page-main .container > .hot-recommend .hot-grid a {
    min-width: 0 !important;
    padding: 0 8px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }
}

/* 分类页桌面双栏等高：左侧 42×35px，右侧 49×30px。 */
@media (min-width: 1024px) {
  .category-bottom .update-list li {
    height: 35px;
    min-height: 35px;
    line-height: 35px;
  }

  .category-bottom .side-list li,
  .category-bottom .side-list li.long-title {
    height: 30px;
    min-height: 30px;
    line-height: 30px;
  }

  /* 数据不足49条时，左右条数相同，统一使用35px行高。 */
  .category-bottom.category-bottom-sparse .side-list li,
  .category-bottom.category-bottom-sparse .side-list li.long-title {
    height: 35px;
    min-height: 35px;
    line-height: 35px;
  }
}

/* Category footer controls: keep the three paging controls on one row and
   pin the right-column entry to the bottom of the equally tall panel. */
.category-bottom { align-items: stretch; }
.category-bottom .latest-panel,
.category-bottom .new-panel { min-width: 0; }
.category-bottom .new-panel { display: flex; flex-direction: column; }
.category-bottom .new-panel .side-list { flex: 0 0 auto; }
.category-bottom .server-pager {
  display: grid;
  grid-template-columns: minmax(90px, 160px) minmax(120px, 1fr) minmax(90px, 160px);
  gap: 10px;
  align-items: center;
  padding: 12px 10px 10px;
  box-sizing: border-box;
}
.category-bottom .server-pager > a,
.category-bottom .server-pager > span,
.category-bottom .server-pager > select {
  width: 100%;
  height: 36px;
  min-width: 0;
  margin: 0;
  box-sizing: border-box;
}
.category-bottom .server-pager > a,
.category-bottom .server-pager > span {
  display: flex;
  align-items: center;
  justify-content: center;
}
.category-bottom .server-pager > select {
  border: 1px solid #b9d7e3;
  background: #fff;
  padding: 0 10px;
}
.category-bottom .panel-more {
  margin: auto 0 0;
  padding: 12px 10px 10px;
  border-top: 1px solid #cbdde3;
  box-sizing: border-box;
}
.category-bottom .panel-more a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 36px;
  background: #4badd3;
  color: #fff;
  box-sizing: border-box;
}
@media (max-width: 1023px) {
  .category-bottom .server-pager {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 5px;
    padding: 10px 6px;
  }
}

/* Mobile reader width: avoid stacking page/container/reader side gutters. */
@media (max-width: 1023px) {
  .page-main.reader-page {
    width: 100% !important;
    max-width: none !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
    box-sizing: border-box !important;
  }

  .page-main.reader-page > .container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  .page-main.reader-page .reader {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding-left: clamp(6px, 2vw, 16px) !important;
    padding-right: clamp(6px, 2vw, 16px) !important;
    box-sizing: border-box !important;
  }

  .page-main.reader-page .chapter-content {
    width: 100% !important;
    max-width: none !important;
    padding-left: clamp(2px, 1.2vw, 10px) !important;
    padding-right: clamp(2px, 1.2vw, 10px) !important;
    box-sizing: border-box !important;
  }

  .page-main.reader-page .mobile-reader-tools,
  .page-main.reader-page .chapter-nav {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }
}
