:root {
    --bg: #f5f0e6;
    --bg-warm: #efe6d8;
    --paper: #fffdf8;
    --paper-strong: #ffffff;
    --line: #d9c8b7;
    --line-soft: #eadfd1;
    --text: #4c3f39;
    --muted: #89766e;
    --brand: #8f6a66;
    --brand-deep: #75524e;
    --brand-soft: #f0e3e1;
    --accent: #b57156;
    --accent-soft: #f7ebe5;
    --gold: #c8a76a;
    --shadow: 0 14px 34px rgba(92, 68, 60, 0.08);
    --radius: 18px;
    --radius-sm: 12px;
    --container: 1200px;
    --reader-bg: #f0d8d8;
    --reader-text: #5a4747;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--text);
    background:
        radial-gradient(circle at 12px 12px, rgba(201, 173, 144, 0.16) 0 1px, transparent 1.5px),
        radial-gradient(circle at 32px 28px, rgba(233, 216, 198, 0.3) 0 1px, transparent 1.5px),
        linear-gradient(180deg, var(--bg) 0%, #f8f3ea 55%, var(--bg-warm) 100%);
    background-size: 44px 44px, 56px 56px, auto;
    font: 14px/1.8 "Microsoft YaHei", "PingFang SC", sans-serif;
}

body.menu-open,
body.modal-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

ul,
ol,
p,
h1,
h2,
h3,
h4 {
    margin: 0;
}

ul,
ol {
    padding: 0;
    list-style: none;
}

table {
    width: 100%;
    border-collapse: collapse;
}

.site-shell {
    min-height: 100vh;
}

.container {
    width: min(calc(100% - 24px), var(--container));
    margin: 0 auto;
}

.topbar {
    background: rgba(255, 255, 255, 0.66);
    border-bottom: 1px solid rgba(117, 82, 78, 0.08);
    color: var(--muted);
    font-size: 12px;
}

.topbar-inner,
.header-main,
.header-tools,
.utility-links,
.section-head,
.book-actions,
.reader-toolbar,
.reader-footer-nav,
.footer-top,
.footer-bottom,
.meta-pills,
.action-row,
.toolbar-inline,
.intro-meta,
.book-summary-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-inner,
.footer-top,
.footer-bottom,
.section-head {
    justify-content: space-between;
}

.topbar-inner {
    min-height: 36px;
}

.utility-links {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.utility-links a {
    color: var(--muted);
}

.utility-links a:hover,
.section-more:hover,
.muted-link:hover {
    color: var(--brand-deep);
}

.site-header {
    padding-top: 14px;
}

.header-main {
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    display: grid;
    gap: 4px;
}

.brand a {
    display: inline-grid;
    gap: 2px;
    color: var(--brand-deep);
}

.brand strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(30px, 3.4vw, 52px);
    line-height: 1;
    letter-spacing: 1px;
}

.brand span {
    font-size: 24px;
    line-height: 1;
    letter-spacing: 0.5px;
    text-transform: lowercase;
}

.brand p {
    color: var(--muted);
    max-width: 520px;
}

.header-tools {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.search-form {
    min-width: min(100%, 420px);
}

.search-shell {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    min-height: 44px;
    border: 1px solid var(--brand);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    overflow: hidden;
}

.search-shell input {
    width: 100%;
    height: 100%;
    padding: 0 16px;
    border: 0;
    background: transparent;
    color: var(--text);
    outline: 0;
}

.search-shell button,
.search-button,
.primary-btn,
.secondary-btn,
.ghost-btn,
.tool-btn,
.chip-link,
.clear-btn,
.page-number,
.floating-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--brand);
    transition: 0.2s ease;
    white-space: nowrap;
}

.search-shell button,
.primary-btn,
.page-number.active,
.tool-btn.theme,
.floating-link.theme {
    background: linear-gradient(180deg, #9d7874, var(--brand-deep));
    color: #fff;
}

.search-shell button:hover,
.primary-btn:hover,
.page-number.active:hover,
.tool-btn.theme:hover,
.floating-link.theme:hover {
    background: linear-gradient(180deg, #a7807b, #6d4b47);
}

.secondary-btn,
.ghost-btn,
.tool-btn,
.chip-link,
.clear-btn,
.page-number,
.floating-link {
    background: rgba(255, 255, 255, 0.9);
    color: var(--brand-deep);
}

.secondary-btn:hover,
.ghost-btn:hover,
.tool-btn:hover,
.chip-link:hover,
.clear-btn:hover,
.page-number:hover,
.floating-link:hover {
    background: var(--brand-soft);
}

.lang-switch {
    display: inline-flex;
    gap: 8px;
}

.lang-switch a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.8);
}

.lang-switch a.active,
.lang-switch a:hover {
    border-color: var(--brand);
    color: var(--brand-deep);
    background: var(--brand-soft);
}

.menu-toggle {
    display: none;
    min-width: 46px;
    min-height: 42px;
    border: 1px solid var(--brand);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--brand-deep);
}

.nav-bar {
    margin-top: 12px;
}

.nav-scroll {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: linear-gradient(180deg, #9c7773, #7d5a56);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.nav-scroll::-webkit-scrollbar {
    display: none;
}

.nav-item {
    flex: 0 0 auto;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.94);
    border-radius: 8px;
    white-space: nowrap;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.14);
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 30;
    width: min(84vw, 340px);
    height: 100vh;
    padding: 24px;
    background: var(--paper);
    box-shadow: -18px 0 40px rgba(77, 54, 49, 0.18);
    transform: translateX(105%);
    transition: transform 0.28s ease;
    overflow-y: auto;
}

.mobile-drawer.open {
    transform: translateX(0);
}

.drawer-close,
.reader-close {
    width: 38px;
    height: 38px;
    margin-left: auto;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--brand-deep);
}

.drawer-title,
.reader-settings h3 {
    margin-top: 8px;
    font-size: 24px;
    color: var(--brand-deep);
}

.drawer-nav,
.drawer-section {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.drawer-nav a,
.drawer-section a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: #fff;
}

.drawer-backdrop,
.reader-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(62, 43, 38, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.drawer-backdrop.show,
.reader-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.page-main {
    padding: 24px 0 56px;
}

.page-stack,
.panel-stack,
.hero-copy,
.book-copy,
.reader-meta,
.shelf-body,
.rank-top-copy {
    display: grid;
    gap: 16px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 13px;
}

.breadcrumb strong {
    color: var(--brand-deep);
}

.panel-paper {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 245, 0.96));
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel-paper::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(143, 106, 102, 0.1);
    border-radius: calc(var(--radius) - 6px);
    pointer-events: none;
}

.panel-body {
    position: relative;
    padding: 22px;
}

.section-head {
    margin-bottom: 18px;
    flex-wrap: nowrap;
}

.section-head > :first-child {
    min-width: 0;
    flex: 1 1 auto;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--brand);
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.section-label::before,
.section-label::after {
    content: "";
    width: 16px;
    height: 1px;
    background: var(--gold);
}

.section-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(24px, 2.7vw, 34px);
    line-height: 1.2;
    color: var(--brand-deep);
}

.section-desc,
.panel-note,
.muted-text {
    color: var(--muted);
}

.section-more,
.muted-link {
    color: var(--brand);
    white-space: nowrap;
}

.section-more {
    flex: 0 0 auto;
}

.hero-grid,
.book-overview,
.dual-layout,
.content-with-sidebar {
    display: grid;
    gap: 18px;
}

.hero-grid {
    grid-template-columns: 290px minmax(0, 1fr) 320px;
}

.book-overview {
    grid-template-columns: 260px minmax(0, 1fr) 300px;
}

.dual-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
}

.content-with-sidebar {
    grid-template-columns: minmax(0, 1fr) 280px;
}

.poster-frame,
.card-cover,
.book-cover,
.rank-cover,
.history-cover,
.catalog-cover,
.shelf-cover,
.mini-cover,
.feature-cover {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 14px;
    background: #efe7df;
    border: 1px solid rgba(143, 106, 102, 0.16);
    box-shadow: 0 10px 24px rgba(92, 68, 60, 0.1);
}

.poster-frame img,
.card-cover img,
.book-cover img,
.rank-cover img,
.history-cover img,
.catalog-cover img,
.shelf-cover img,
.mini-cover img,
.feature-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poster-caption,
.rank-top-copy h3,
.book-heading h1,
.reader-title,
.book-card h3,
.shelf-body h3,
.history-card h3,
.author-card h3,
.search-card h3 {
    font-family: Georgia, "Times New Roman", serif;
    color: var(--brand-deep);
}

.hero-feature {
    display: grid;
    gap: 16px;
}

.poster-caption small,
.rank-top-copy p,
.summary-text,
.book-summary,
.intro-box,
.book-card p,
.shelf-body p,
.search-card p,
.author-card p {
    color: var(--muted);
}

.hero-copy {
    align-content: start;
}

.hero-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.summary-box,
.stat-box,
.outline-card,
.list-panel,
.reader-note,
.intro-box,
.history-summary {
    padding: 14px 16px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
}

.summary-box strong,
.stat-box strong,
.outline-card strong,
.reader-note strong {
    color: var(--brand-deep);
}

.meta-pills {
    flex-wrap: wrap;
}

.tag-pill,
.meta-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--brand-deep);
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-grid,
.book-grid,
.result-grid,
.rank-grid,
.cover-grid,
.recommend-grid,
.history-grid-list {
    display: grid;
    gap: 18px;
}

.mini-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cover-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rank-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.result-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.recommend-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mini-card,
.book-card,
.search-card,
.author-card,
.recommend-card,
.history-card,
.rank-detail-card {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.mini-card,
.book-card,
.search-card,
.author-card,
.recommend-card,
.history-card,
.rank-detail-card,
.rank-board-top,
.poster-caption,
.hero-copy,
.book-copy,
.rank-top-copy,
.panel-stack,
.page-stack {
    min-width: 0;
}

.poster-caption h2,
.mini-card strong,
.book-card h3,
.search-card h3,
.author-card h3,
.recommend-card h3,
.history-card h3,
.rank-top-copy h3,
.book-heading h1,
.catalog-summary h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.poster-caption h2 a,
.mini-card strong a,
.book-card h3 a,
.search-card h3 a,
.author-card h3 a,
.recommend-card h3 a,
.history-card h3 a,
.rank-top-copy h3 a,
.book-heading h1 a,
.catalog-summary h1 a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.poster-caption small,
.book-card p,
.search-card p,
.author-card p,
.recommend-card p,
.rank-detail-card p,
.rank-top-copy p,
.intro-box,
.summary-text {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

.poster-caption small,
.summary-text {
    -webkit-line-clamp: 2;
}

.book-card p,
.search-card p,
.author-card p,
.recommend-card p,
.rank-detail-card p {
    -webkit-line-clamp: 3;
}

.rank-top-copy p {
    -webkit-line-clamp: 6;
}

.intro-box {
    -webkit-line-clamp: 5;
    word-break: break-word;
}

.book-page .intro-box,
.read-page .intro-box {
    display: block;
    overflow: hidden;
}

.book-page .book-intro-text,
.read-page .catalog-book-intro {
    line-height: 1.9;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    max-height: calc(1.9em * 4);
    word-break: break-word;
}

.book-page .book-intro-text p,
.book-page .book-intro-text div,
.book-page .book-intro-text span,
.read-page .catalog-book-intro p,
.read-page .catalog-book-intro div,
.read-page .catalog-book-intro span {
    display: inline;
    margin: 0;
    padding: 0;
}

.book-page .book-intro-text br,
.read-page .catalog-book-intro br {
    display: none;
}

.mini-card strong,
.recommend-card strong {
    color: var(--brand-deep);
}

.board-list,
.simple-list,
.latest-list,
.rank-list {
    display: grid;
    gap: 10px;
}

.board-list li,
.simple-list li,
.latest-list li,
.rank-list li,
.chapter-list li,
.chapter-grid li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.board-list a,
.simple-list a,
.latest-list a,
.rank-list a,
.chapter-list a,
.chapter-grid a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
}

.board-list a .ellipsis,
.simple-list a .ellipsis,
.latest-list a .ellipsis,
.rank-list a .ellipsis {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.board-list li > span:last-child,
.simple-list li > span:last-child,
.latest-list li > span:last-child,
.rank-list li > span:last-child,
.chapter-date,
.update-table td:last-child,
.update-table th:last-child {
    color: var(--muted);
    white-space: nowrap;
}

.board-list li > span:last-child,
.simple-list li > span:last-child,
.latest-list li > span:last-child,
.rank-list li > span:last-child {
    max-width: 14em;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.num-badge,
.rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    min-width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
}

.board-list li:nth-child(-n+3) .num-badge,
.simple-list li:nth-child(-n+3) .num-badge,
.latest-list li:nth-child(-n+3) .num-badge,
.rank-list li:nth-child(-n+3) .num-badge,
.page-number.active {
    background: linear-gradient(180deg, #d7b67d, #b38647);
    color: #fff;
    border-color: #b38647;
}

.rank-board {
    height: 100%;
    min-width: 0;
}

.rank-board .section-head {
    align-items: flex-start;
    gap: 10px;
}

.rank-board .section-title {
    font-size: clamp(20px, 2vw, 28px);
}

.rank-board-top {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px dashed var(--line);
}

.rank-cover {
    width: 90px;
    min-width: 90px;
    height: 120px;
    min-height: 120px;
    border-radius: 10px;
}

.rank-list-page .rank-board-top {
    grid-template-columns: 1fr;
}

.rank-list-page .rank-cover {
    display: none;
}

.update-table-wrap {
    overflow: auto;
}

.update-table {
    width: 100%;
    table-layout: auto;
}

.update-table th,
.update-table td {
    padding: 12px 10px;
    border-bottom: 1px dashed var(--line-soft);
    text-align: left;
}

.update-table th:last-child,
.update-table td:last-child {
    width: 1%;
    text-align: right;
    padding-right: 0;
}

.update-table td a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.update-table th {
    color: var(--brand-deep);
    font-weight: 700;
}

.update-table tbody tr:hover {
    background: rgba(240, 227, 225, 0.32);
}

.channel-filter,
.category-tabs,
.toolbar-inline,
.page-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-chip,
.category-tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--brand);
}

.filter-chip.active,
.filter-chip:hover,
.category-tabs a.active,
.category-tabs a:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-deep);
}

.book-card,
.search-card,
.author-card,
.rank-detail-card,
.recommend-card,
.history-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: start;
    height: 100%;
}

.book-card .panel-stack,
.search-card .panel-stack,
.author-card .panel-stack,
.rank-detail-card .panel-stack,
.recommend-card .panel-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    height: 100%;
    min-width: 0;
    overflow: hidden;
}

.book-card .card-cover,
.search-card .card-cover,
.author-card .card-cover,
.rank-detail-card .card-cover,
.recommend-card .card-cover,
.history-card .history-cover {
    border-radius: 12px;
}

.history-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 12px;
    align-items: stretch;
    width: 100%;
    max-width: 420px;
    justify-self: start;
}

.history-actions .primary-btn,
.history-actions .secondary-btn {
    width: 100%;
    min-height: 46px;
    padding: 0 16px;
}

.history-card .panel-stack {
    min-width: 0;
    align-content: start;
}

.history-progress {
    display: flex;
    align-items: baseline;
    gap: 6px;
    width: 100%;
    min-width: 0;
    color: var(--muted);
    overflow: hidden;
}

.history-progress-label {
    flex: 0 0 auto;
}

.history-progress-link {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-card h3,
.search-card h3,
.author-card h3,
.rank-detail-card h3,
.recommend-card h3 {
    min-width: 0;
}

.book-card h3 a,
.search-card h3 a,
.author-card h3 a,
.rank-detail-card h3 a,
.recommend-card h3 a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-card .meta-pills,
.search-card .meta-pills,
.author-card .meta-pills,
.rank-detail-card .meta-pills,
.recommend-card .meta-pills {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
    gap: 8px;
    overflow: hidden;
}

.book-card .tag-pill,
.search-card .tag-pill,
.author-card .tag-pill,
.rank-detail-card .tag-pill,
.recommend-card .tag-pill {
    flex: 0 1 auto;
    max-width: calc((100% - 16px) / 3);
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.book-card .tag-pill a,
.search-card .tag-pill a,
.author-card .tag-pill a,
.rank-detail-card .tag-pill a,
.recommend-card .tag-pill a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-page .recommend-card .meta-pills,
.chapter-page .recommend-card .meta-pills {
    overflow: visible;
}

.book-page .recommend-card .tag-pill,
.chapter-page .recommend-card .tag-pill {
    flex: 0 1 100%;
    max-width: 100%;
}

.book-card p,
.search-card p,
.author-card p,
.rank-detail-card p,
.recommend-card p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-height: 1.8;
    min-height: calc(1.8em * 3);
    max-height: calc(1.8em * 3);
    word-break: break-word;
    overflow: hidden;
}

.book-card .action-row,
.search-card .action-row,
.author-card .action-row,
.rank-detail-card .action-row,
.recommend-card .action-row {
    margin-top: auto;
    width: 100%;
}

.book-summary-meta {
    min-width: 0;
    flex-wrap: wrap;
}

.book-summary-meta span {
    min-width: 0;
}

.book-summary-meta span:first-child {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex: 1 1 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-summary-meta span:first-child a {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
}

.summary-box {
    min-width: 0;
}

.summary-box span {
    min-width: 0;
    overflow: hidden;
}

.summary-box a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-heading {
    display: grid;
    gap: 14px;
}

.book-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.book-highlight,
.catalog-summary {
    display: grid;
    gap: 16px;
}

.book-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.chapter-grid,
.chapter-list {
    display: grid;
    gap: 8px 18px;
}

.chapter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.latest-chapter-list {
    grid-template-columns: 1fr;
}

.latest-chapter-list a {
    display: flex;
    width: 100%;
}

.latest-chapter-list a span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.latest-chapter-list .chapter-date {
    margin-left: auto;
    flex: 0 0 auto;
}

.chapter-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.chapter-grid a,
.chapter-list a {
    min-width: 0;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
}

.chapter-grid a span,
.chapter-list a span,
.ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chapter-grid a:hover,
.chapter-list a:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.reader-shell {
    position: relative;
    padding: 0;
    background: var(--reader-bg);
    color: var(--reader-text);
    border: 1px solid #e8c7c7;
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(131, 90, 90, 0.12);
}

.reader-head {
    padding: 28px 36px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.56);
    text-align: center;
}

.reader-title {
    font-size: clamp(28px, 3vw, 38px);
}

.reader-meta {
    justify-content: center;
    color: rgba(90, 71, 71, 0.82);
}

.reader-toolbar,
.reader-footer-nav {
    justify-content: center;
    flex-wrap: wrap;
}

.reader-content {
    padding: 34px 56px;
    font-size: var(--reader-size, 22px);
    line-height: 2.2;
    word-break: break-word;
}

.reader-content p {
    margin-bottom: 1.3em;
    text-indent: 2em;
}

.reader-content img {
    margin: 20px auto;
    height: auto;
}

.reader-foot {
    padding: 20px 36px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.56);
}

.reader-settings {
    position: fixed;
    top: 50%;
    right: 24px;
    z-index: 35;
    width: min(92vw, 320px);
    padding: 18px;
    border-radius: 18px;
    background: var(--paper);
    border: 1px solid var(--line-soft);
    box-shadow: 0 18px 40px rgba(77, 54, 49, 0.18);
    transform: translate(120%, -50%);
    transition: transform 0.28s ease;
}

.reader-settings.open {
    transform: translate(0, -50%);
}

.setting-group {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.setting-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.setting-options button {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--brand-deep);
}

.setting-options button.active,
.setting-options button:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
}

.floating-tools {
    position: fixed;
    right: 18px;
    top: 220px;
    z-index: 6;
    display: grid;
    gap: 10px;
}

.floating-link {
    min-width: 76px;
    min-height: 42px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 20px rgba(92, 68, 60, 0.08);
}

.empty-state,
.history-empty {
    padding: 26px 18px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
}

.page-footer {
    padding: 20px 0 34px;
    color: var(--muted);
}

.footer-top,
.footer-bottom {
    min-height: 42px;
}

.footer-top {
    padding: 0 0 10px;
    border-bottom: 1px solid rgba(143, 106, 102, 0.12);
}

.footer-top nav,
.footer-bottom nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
}

.footer-bottom {
    padding-top: 12px;
    font-size: 12px;
}

.footer-brand {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    color: var(--brand-deep);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 1180px) {
    .hero-grid,
    .book-overview {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .hero-side,
    .book-side {
        grid-column: 1 / -1;
    }

    .rank-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .recommend-grid,
    .result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chapter-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .header-main {
        align-items: start;
        flex-direction: column;
    }

    .header-tools {
        width: 100%;
        justify-content: stretch;
    }

    .search-form {
        min-width: 0;
        width: 100%;
    }

    .nav-bar,
    .lang-switch .desktop-only,
    .desktop-only {
        display: none;
    }

    .book-side,
    .read-recommend-panel {
        display: none;
    }

    .dual-layout,
    .content-with-sidebar,
    .book-overview,
    .hero-grid,
    .book-grid,
    .result-grid,
    .recommend-grid {
        grid-template-columns: 1fr;
    }

    .mini-grid,
    .cover-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rank-grid {
        grid-template-columns: 1fr;
    }

    .chapter-grid,
    .chapter-list,
    .book-summary-grid,
    .book-stats,
    .hero-summary {
        grid-template-columns: 1fr 1fr;
    }

    .floating-tools {
        display: none;
    }

    .reader-content {
        padding: 28px 24px;
    }
}

@media (max-width: 720px) {
    .page-main {
        padding-top: 18px;
    }

    .container {
        width: min(calc(100% - 16px), var(--container));
    }

    .panel-body {
        padding: 18px;
    }

    .topbar {
        display: none;
    }

    .brand strong {
        font-size: 34px;
    }

    .brand span {
        font-size: 20px;
    }

    .header-tools {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
    }

    .search-form {
        width: auto;
    }

    .menu-toggle {
        width: 42px;
        min-width: 42px;
        min-height: 42px;
        padding: 0;
    }

    .lang-switch {
        display: none;
    }

    .update-table-wrap {
        overflow: hidden;
    }

    .update-table {
        table-layout: fixed;
    }

    .update-table th,
    .update-table td {
        padding: 12px 6px;
    }

    .update-table th:nth-child(2),
    .update-table td:nth-child(2) {
        display: none;
    }

    .update-table th:first-child,
    .update-table td:first-child {
        width: auto;
        padding-left: 0;
    }

    .update-table th:last-child,
    .update-table td:last-child {
        width: 64px;
    }

    .rank-grid {
        grid-template-columns: 1fr;
    }

    .mini-grid,
    .cover-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-page .board-list li > span:last-child,
    .home-page .latest-list li > span:last-child,
    .home-page .rank-list li > span:last-child,
    .home-page .simple-list li > span:last-child,
    .board-list li > span:last-child,
    .simple-list li > span:last-child,
    .latest-list li > span:last-child,
    .rank-list li > span:last-child {
        max-width: 9em;
        font-size: 13px;
    }

    .chapter-grid,
    .chapter-list,
    .book-summary-grid,
    .book-stats,
    .hero-summary {
        grid-template-columns: 1fr;
    }

    .book-card,
    .search-card,
    .author-card,
    .rank-detail-card,
    .recommend-card,
    .history-card,
    .rank-board-top {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .reader-head,
    .reader-foot {
        padding: 22px 18px;
    }

    .reader-content {
        padding: 22px 18px;
        line-height: 2;
    }

    .reader-settings {
        right: 10px;
    }

    .footer-top,
    .footer-bottom,
    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .header-tools {
        gap: 10px;
    }

    .search-shell,
    .search-shell button,
    .search-shell input {
        min-height: 42px;
    }

    .book-card,
    .search-card,
    .author-card,
    .rank-detail-card,
    .recommend-card,
    .history-card,
    .rank-board-top {
        grid-template-columns: 84px minmax(0, 1fr);
        gap: 12px;
    }

    .rank-cover {
        width: 84px;
        min-width: 84px;
        height: 112px;
        min-height: 112px;
    }

    .history-actions {
        grid-template-columns: repeat(2, minmax(110px, 1fr));
        gap: 10px;
        max-width: 100%;
    }

    .book-card .tag-pill,
    .search-card .tag-pill,
    .author-card .tag-pill,
    .rank-detail-card .tag-pill,
    .recommend-card .tag-pill {
        max-width: calc((100% - 8px) / 2);
    }

    .book-card p,
    .search-card p,
    .author-card p,
    .rank-detail-card p,
    .recommend-card p {
        -webkit-line-clamp: 3;
    }

    .book-actions,
    .reader-toolbar,
    .reader-footer-nav,
    .toolbar-inline,
    .page-numbers {
        gap: 8px;
    }

    .primary-btn,
    .secondary-btn,
    .ghost-btn,
    .tool-btn,
    .chip-link,
    .clear-btn,
    .page-number,
    .floating-link {
        min-height: 36px;
        padding: 0 14px;
    }
}

@media (min-width: 961px) and (max-width: 1400px) {
    .rank-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}