:root {
    color-scheme: light;
    --page: #eeece6;
    --paper: #f6f2e8;
    --panel: #faf8f2;
    --ink: #17292b;
    --muted: #596b6e;
    --line: #d9ded8;
    --accent: #1d6a6d;
    --accent-deep: #124d50;
    --accent-soft: #e3f0ed;
    --warm: #a34f27;
    --warm-soft: #f8ede4;
    --radius: 14px;
    --shell: 1160px;
}

* {
    box-sizing: border-box;
}

html {
    max-width: 100%;
    overflow-x: clip;
    scroll-behavior: smooth;
}

body {
    min-width: 0;
    max-width: 100%;
    margin: 0;
    overflow-x: clip;
    background: var(--page);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--accent);
}

button,
input {
    font: inherit;
}

button,
a,
input {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid #9f4f2b;
    outline-offset: 3px;
}

img {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul {
    margin-top: 0;
}

h1,
h2,
h3 {
    line-height: 1.3;
}

.shell {
    width: min(calc(100% - clamp(28px, 5vw, 64px)), var(--shell));
    min-width: 0;
    margin-inline: auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 10px;
    left: 10px;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.brand-row {
    display: grid;
    grid-template-columns: minmax(190px, 0.8fr) minmax(320px, 1.5fr) auto;
    gap: clamp(16px, 3vw, 36px);
    align-items: center;
    min-height: 104px;
    padding-block: 18px;
}

.wordmark {
    display: inline-flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    border-left: 5px solid var(--accent);
    padding-left: 14px;
}

.wordmark-title {
    overflow: hidden;
    color: var(--ink);
    font-family: "Songti SC", SimSun, serif;
    font-size: clamp(1.45rem, 2.7vw, 2rem);
    font-weight: 800;
    letter-spacing: 0.05em;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wordmark-domain {
    overflow: hidden;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.site-search {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 0;
}

.site-search input,
.search-page-form input {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    border: 1px solid #bdcbc7;
    border-radius: 9px 0 0 9px;
    background: var(--panel);
    color: var(--ink);
    padding: 10px 14px;
    font-size: 16px;
}

.site-search button,
.search-page-form button {
    min-height: 48px;
    border: 0;
    border-radius: 0 9px 9px 0;
    background: var(--accent);
    color: #fff;
    padding: 10px 22px;
    cursor: pointer;
    font-weight: 700;
}

.site-search button:hover,
.search-page-form button:hover {
    background: var(--accent-deep);
}

.site-search input:hover,
.search-page-form input:hover {
    border-color: var(--accent);
}

.site-search input:focus-visible,
.search-page-form input:focus-visible {
    position: relative;
    z-index: 1;
    outline: 0;
    box-shadow: inset 0 0 0 2px #9f4f2b;
}

.site-search button:focus-visible,
.search-page-form button:focus-visible {
    position: relative;
    z-index: 1;
    outline: 0;
    box-shadow: inset 0 0 0 2px #f2c879;
}

.form-message {
    position: absolute;
    top: calc(100% + 4px);
    left: 2px;
    color: #9a3f2b;
    font-size: 0.78rem;
}

.history-link,
.quiet-action,
.primary-action,
.secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 9px;
    font-weight: 700;
}

.history-link {
    border: 1px solid var(--line);
    padding: 8px 16px;
    white-space: nowrap;
}

.category-nav {
    max-width: 100%;
    overflow: hidden;
    border-top: 1px solid var(--line);
    background: var(--accent-deep);
}

.category-track {
    display: flex;
    max-width: 100%;
    min-height: 50px;
    align-items: stretch;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.category-track a {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 50px;
    padding: 0 18px;
    color: #f8fffd;
    font-weight: 650;
    white-space: nowrap;
}

.category-track a:hover,
.category-track a:focus-visible {
    background: #226d70;
    color: #fff;
}

.site-main {
    min-height: 62vh;
    padding-block: clamp(24px, 4vw, 44px) 64px;
}

.page-intro {
    display: flex;
    min-width: 0;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.page-intro h1 {
    margin-bottom: 8px;
    font-family: "Songti SC", SimSun, serif;
    font-size: clamp(1.9rem, 4vw, 3rem);
    letter-spacing: 0.02em;
}

.page-intro p:last-child {
    max-width: 720px;
    margin-bottom: 0;
    color: var(--muted);
}

.home-intro {
    min-height: 124px;
}

.listing-intro {
    align-items: center;
}

.eyebrow {
    margin-bottom: 6px;
    color: var(--warm);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.quiet-action {
    flex: 0 0 auto;
    border: 1px solid var(--accent);
    color: var(--accent-deep);
    padding: 9px 18px;
}

.panel {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}

.section-heading {
    display: flex;
    min-width: 0;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.section-heading h2 {
    margin-bottom: 0;
    font-size: clamp(1.25rem, 2.3vw, 1.6rem);
}

.section-heading > a,
.section-heading > span,
.section-heading > time {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.88rem;
}

.section-heading > a {
    color: var(--accent);
    font-weight: 700;
}

.compact-heading {
    align-items: start;
}

.home-lead {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 0.82fr);
    gap: 20px;
}

.feature-panel,
.ranking-panel,
.update-panel,
.arrivals-panel,
.result-panel,
.side-recommend,
.search-panel,
.history-panel,
.latest-chapters,
.catalogue-panel,
.related-panel {
    padding: clamp(18px, 2.5vw, 28px);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.feature-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    min-width: 0;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.feature-card:nth-child(-n + 2) {
    border-top: 0;
    padding-top: 0;
}

.cover-link,
.result-cover,
.book-cover-wrap {
    overflow: hidden;
    border-radius: 9px;
    background: var(--accent-soft);
}

.cover-link {
    aspect-ratio: 12 / 17;
}

.cover-link img,
.result-cover img,
.book-cover,
.related-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feature-copy,
.result-copy {
    min-width: 0;
}

.feature-copy h3,
.related-card h3,
.result-copy h3 {
    margin-bottom: 5px;
    font-size: 1rem;
}

.feature-copy h3 a,
.related-card h3 a,
.result-copy h3 a,
.title-list a,
.arrival-list a,
.update-row a {
    overflow-wrap: anywhere;
}

.book-byline {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.86rem;
}

.book-byline a {
    color: var(--accent);
}

.book-summary {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 0;
    color: #536467;
    font-size: 0.9rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.rank-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rank-list li {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 50px;
    border-top: 1px solid var(--line);
}

.rank-list li:first-child {
    border-top: 0;
}

.rank-list li > span {
    color: var(--warm);
    font-family: Georgia, serif;
    font-size: 0.88rem;
    font-weight: 700;
}

.rank-list li div {
    min-width: 0;
}

.rank-list li a,
.rank-list li small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-list li a {
    font-weight: 650;
}

.rank-list li small {
    color: var(--muted);
}

.category-showcase,
.updates-grid,
.latest-chapters,
.catalogue-panel,
.related-panel,
.history-recommend {
    margin-top: 24px;
}

.wide-heading {
    margin-bottom: 16px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.category-card {
    padding: 20px;
}

.category-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 2px solid var(--accent-soft);
    padding-bottom: 12px;
}

.category-card-head h3 {
    margin-bottom: 0;
    font-size: 1.08rem;
}

.category-card-head a {
    color: var(--accent);
    font-size: 0.84rem;
    font-weight: 700;
}

.title-list,
.arrival-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.title-list li,
.arrival-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(70px, auto);
    gap: 14px;
    align-items: center;
    min-height: 44px;
    border-bottom: 1px solid var(--line);
}

.title-list li:last-child,
.arrival-list li:last-child {
    border-bottom: 0;
}

.title-list a,
.arrival-list a,
.title-list span,
.arrival-list span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.title-list span,
.arrival-list span {
    color: var(--muted);
    font-size: 0.82rem;
    text-align: right;
}

.updates-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(250px, 0.75fr);
    gap: 20px;
}

.update-list {
    min-width: 0;
}

.update-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.1fr) minmax(170px, 1.4fr) minmax(90px, 0.7fr) 92px;
    gap: 12px;
    align-items: center;
    min-height: 47px;
    border-top: 1px solid var(--line);
    font-size: 0.9rem;
}

.update-row:first-child {
    border-top: 0;
}

.update-row > * {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.update-book {
    font-weight: 700;
}

.update-chapter,
.update-author,
.update-row time {
    color: var(--muted);
}

.update-row time {
    font-size: 0.8rem;
    text-align: right;
}

.empty-state {
    grid-column: 1 / -1;
    color: var(--muted);
}

.roomy-empty {
    padding: 48px 20px;
    text-align: center;
}

.roomy-empty h2 {
    margin-bottom: 8px;
    color: var(--ink);
}

.roomy-empty p {
    margin-bottom: 20px;
}

.breadcrumbs {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 0.88rem;
}

.breadcrumbs > * {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumbs a {
    color: var(--accent);
}

.book-profile {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: clamp(22px, 4vw, 42px);
    padding: clamp(20px, 3.5vw, 38px);
}

.book-cover-wrap {
    aspect-ratio: 5 / 7;
    align-self: start;
}

.book-profile-copy {
    min-width: 0;
}

.book-profile-copy h1 {
    overflow-wrap: anywhere;
    margin-bottom: 18px;
    font-family: "Songti SC", SimSun, serif;
    font-size: clamp(1.75rem, 3.6vw, 2.7rem);
}

.book-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.book-facts div {
    min-width: 0;
    border-left: 2px solid var(--accent-soft);
    padding-left: 10px;
}

.book-facts dt {
    color: var(--muted);
    font-size: 0.76rem;
}

.book-facts dd {
    overflow: hidden;
    margin: 2px 0 0;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-description {
    max-width: 800px;
    margin-bottom: 22px;
    color: #415457;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.book-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.primary-action,
.secondary-action {
    padding: 10px 20px;
}

.primary-action {
    background: var(--accent);
    color: #fff;
}

.primary-action:hover {
    background: var(--accent-deep);
    color: #fff;
}

.secondary-action {
    border: 1px solid var(--accent);
    color: var(--accent-deep);
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
}

.chapter-grid a {
    display: flex;
    min-width: 0;
    min-height: 48px;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    padding: 10px 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chapter-grid > .empty-state {
    grid-column: 1 / -1;
}

.chapter-grid a:hover {
    background: var(--accent-soft);
}

.catalogue-grid {
    max-height: 620px;
    overflow-y: auto;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.related-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
}

.related-card > a {
    aspect-ratio: 12 / 17;
    overflow: hidden;
    border-radius: 7px;
    background: var(--accent-soft);
}

.related-card p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.keyword-links {
    margin-top: 22px;
}

.keyword-links h2 {
    font-size: 1rem;
}

.keyword-links div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-links a {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    padding: 6px 13px;
    color: var(--muted);
    font-size: 0.84rem;
}

.search-panel {
    margin-bottom: 20px;
}

.search-page-form > label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.search-page-form > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}

.notice {
    margin-bottom: 20px;
    border: 1px solid #e2c6b3;
    border-radius: 10px;
    background: var(--warm-soft);
    color: #74422a;
    padding: 12px 16px;
}

.listing-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
    gap: 20px;
    align-items: start;
}

.book-result-list {
    min-width: 0;
}

.book-result {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 16px;
    min-width: 0;
    border-top: 1px solid var(--line);
    padding: 18px 0;
}

.book-result:first-child {
    border-top: 0;
    padding-top: 0;
}

.book-result:last-child {
    padding-bottom: 0;
}

.result-cover {
    aspect-ratio: 12 / 17;
    align-self: start;
}

.result-title-row {
    display: flex;
    min-width: 0;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.result-title-row h3 {
    min-width: 0;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.result-title-row > span {
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    padding: 2px 9px;
    font-size: 0.76rem;
}

.result-meta {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.82rem;
}

.result-meta a {
    min-width: 0;
    overflow: hidden;
    color: var(--accent);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-recommend {
    position: sticky;
    top: 16px;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 26px;
    border-top: 1px solid var(--line);
    padding-top: 20px;
}

.pagination a {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    padding: 6px 12px;
}

.pagination a[aria-current="page"] {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.history-chapter {
    margin-bottom: 8px;
    color: #415457;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--paper);
}

.footer-row {
    display: flex;
    min-height: 100px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: var(--muted);
    font-size: 0.88rem;
}

.footer-row p {
    margin-bottom: 0;
}

.footer-row nav {
    display: flex;
    gap: 16px;
}

@media (max-width: 940px) {
    .brand-row {
        grid-template-columns: minmax(160px, 0.75fr) minmax(260px, 1.4fr) auto;
        gap: 16px;
    }

    .feature-card {
        grid-template-columns: 82px minmax(0, 1fr);
    }

    .update-row {
        grid-template-columns: minmax(130px, 1fr) minmax(150px, 1.2fr) minmax(80px, 0.6fr);
    }

    .update-row time {
        display: none;
    }

    .book-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .shell {
        width: min(calc(100% - 28px), var(--shell));
    }

    .brand-row {
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: 0;
        padding-block: 14px;
    }

    .site-search {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .wordmark-title {
        font-size: 1.45rem;
    }

    .history-link {
        padding-inline: 13px;
    }

    .category-track a {
        padding-inline: 15px;
    }

    .site-main {
        padding-top: 22px;
    }

    .page-intro {
        align-items: start;
    }

    .page-intro h1 {
        font-size: 1.9rem;
    }

    .home-lead,
    .updates-grid,
    .listing-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .side-recommend {
        position: static;
    }

    .book-profile {
        grid-template-columns: 132px minmax(0, 1fr);
        gap: 18px;
    }

    .book-profile-copy h1 {
        font-size: 1.8rem;
    }

    .book-description,
    .book-actions {
        grid-column: 1 / -1;
    }

    .chapter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .page-intro {
        display: block;
    }

    .quiet-action {
        margin-top: 14px;
    }

    .feature-grid,
    .category-grid,
    .related-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .feature-card:nth-child(2) {
        border-top: 1px solid var(--line);
        padding-top: 16px;
    }

    .update-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 4px 12px;
        padding-block: 9px;
    }

    .update-author {
        display: none;
    }

    .book-profile {
        grid-template-columns: minmax(0, 1fr);
        padding: 16px;
    }

    .book-cover-wrap {
        width: 120px;
    }

    .book-profile-copy h1 {
        margin-bottom: 12px;
        font-size: 1.45rem;
    }

    .book-facts {
        gap: 8px;
        font-size: 0.84rem;
    }

    .book-description {
        margin-top: 2px;
    }

    .book-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chapter-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .chapter-grid a {
        padding-inline: 10px;
        font-size: 0.88rem;
    }

    .book-result {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 12px;
    }

    .result-copy .book-summary {
        -webkit-line-clamp: 2;
    }

    .result-meta {
        display: grid;
        gap: 3px;
    }

    .search-page-form > div {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .search-page-form input,
    .search-page-form button {
        border-radius: 9px;
    }

    .footer-row {
        min-height: 112px;
        flex-direction: column;
        align-items: start;
        justify-content: center;
        gap: 8px;
    }
}

@media (max-width: 370px) {
    .shell {
        width: min(calc(100% - 22px), var(--shell));
    }

    .history-link {
        font-size: 0.86rem;
    }

    .wordmark-domain {
        display: none;
    }

    .book-cover-wrap {
        width: 108px;
    }

    .book-actions {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
