:root {
    --background: #f6f7f9;
    --surface: #ffffff;
    --surface-soft: #f0f2f5;
    --text: #20242a;
    --text-soft: #69717c;
    --border: #e2e6ea;
    --primary: #334155;
    --primary-dark: #1e293b;
    --radius: 14px;
    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "PingFang SC",
        "Microsoft YaHei",
        sans-serif;
    line-height: 1.7;
}

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

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

.container {
    width: min(calc(100% - 32px), var(--container));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

.header-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.site-logo {
    color: var(--primary-dark);
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 1px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 26px;
    color: var(--text-soft);
    font-size: 14px;
}

.main-nav a:hover {
    color: var(--primary-dark);
}

.hero {
    padding: 76px 0 72px;
    background:
        linear-gradient(
            135deg,
            #e9edf2 0%,
            #f7f8fa 54%,
            #e7ebf0 100%
        );
    text-align: center;
}

.hero-label,
.section-label {
    margin: 0 0 8px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    color: var(--primary-dark);
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.2;
}

.hero-description {
    margin: 18px auto 28px;
    color: var(--text-soft);
    font-size: 17px;
}

.search-form {
    width: min(100%, 600px);
    margin: 0 auto;
    padding: 6px;
    display: flex;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 35px rgba(30, 41, 59, 0.08);
}

.search-form input {
    flex: 1;
    min-width: 0;
    padding: 12px 15px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 15px;
}

.search-form button {
    padding: 11px 24px;
    border: 0;
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

.search-form button:hover {
    background: var(--primary-dark);
}

.section {
    padding: 58px 0;
}

.section-soft {
    background: var(--surface-soft);
}

.section-heading {
    margin-bottom: 26px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.section-heading h2 {
    margin: 0;
    color: var(--primary-dark);
    font-size: 28px;
}

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

.category-card {
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(30, 41, 59, 0.08);
}

.category-card strong {
    display: block;
    color: var(--primary-dark);
    font-size: 19px;
}

.category-card span {
    color: var(--text-soft);
    font-size: 13px;
}

.category-card p {
    margin: 11px 0 0;
    color: var(--text-soft);
    font-size: 14px;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.book-card {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 18px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.book-cover {
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #e7ebef;
    border-radius: 8px;
    color: var(--text-soft);
    font-size: 12px;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-title {
    display: block;
    color: var(--primary-dark);
    font-size: 17px;
    font-weight: 700;
}

.book-meta {
    margin: 5px 0 9px;
    color: var(--text-soft);
    font-size: 13px;
}

.book-summary {
    margin: 0;
    display: -webkit-box;
    overflow: hidden;
    color: var(--text-soft);
    font-size: 13px;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.latest-list {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.latest-item {
    min-height: 64px;
    padding: 14px 18px;
    display: grid;
    grid-template-columns: 1.6fr 1fr 90px;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--border);
}

.latest-item:last-child {
    border-bottom: 0;
}

.latest-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.latest-category {
    flex: 0 0 auto;
    padding: 2px 8px;
    background: var(--surface-soft);
    border-radius: 5px;
    color: var(--text-soft);
    font-size: 12px;
}

.latest-title {
    min-width: 0;
    overflow: hidden;
    color: var(--primary-dark);
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.latest-title:hover {
    text-decoration: underline;
}

.latest-author,
.latest-chapter,
.latest-status {
    color: var(--text-soft);
    font-size: 13px;
}

.latest-author {
    flex: 0 0 auto;
}

.latest-chapter {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.latest-status {
    text-align: right;
}

.empty-state {
    padding: 54px 20px;
    background: var(--surface);
    border: 1px dashed #c9d0d8;
    border-radius: var(--radius);
    text-align: center;
}

.empty-state h3 {
    margin: 0 0 6px;
}

.empty-state p {
    margin: 0;
    color: var(--text-soft);
}

.site-footer {
    padding: 30px 0;
    background: var(--primary-dark);
    color: #cbd5e1;
    text-align: center;
    font-size: 13px;
}

.site-footer p {
    margin: 0;
}

@media (max-width: 900px) {
    .category-grid,
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .latest-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .latest-status {
        text-align: left;
    }
}

@media (max-width: 640px) {
    .header-inner {
        min-height: 60px;
    }

    .main-nav {
        display: none;
    }

    .hero {
        padding: 56px 0;
    }

    .hero-description {
        font-size: 15px;
    }

    .search-form button {
        padding-inline: 17px;
    }

    .section {
        padding: 42px 0;
    }

    .category-grid,
    .book-grid {
        grid-template-columns: 1fr;
    }

    .book-card {
        grid-template-columns: 92px 1fr;
    }

    .latest-main {
        flex-wrap: wrap;
    }
}

/* BOOK_DETAIL_STYLES_START */

.book-detail-page {
    min-height: calc(100vh - 150px);
    padding: 34px 0 60px;
}

.breadcrumb,
.reader-breadcrumb {
    margin-bottom: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-soft);
    font-size: 13px;
}

.breadcrumb a:hover,
.reader-breadcrumb a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.book-detail-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 36px;
    padding: 30px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 14px 38px rgba(30, 41, 59, 0.06);
}

.book-detail-cover {
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #e7ebef;
    border-radius: 12px;
}

.book-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-placeholder {
    width: 100%;
    height: 100%;
    padding: 26px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(
            145deg,
            #cbd5e1,
            #f1f5f9 52%,
            #cbd5e1
        );
    color: var(--primary-dark);
    text-align: center;
}

.cover-placeholder strong {
    font-size: 23px;
    line-height: 1.4;
}

.cover-placeholder span {
    margin-top: 13px;
    color: var(--text-soft);
    font-size: 13px;
}

.book-detail-label {
    display: inline-flex;
    padding: 4px 11px;
    background: var(--surface-soft);
    border-radius: 999px;
    color: var(--text-soft);
    font-size: 13px;
}

.book-detail-info h1 {
    margin: 13px 0 4px;
    color: var(--primary-dark);
    font-size: clamp(30px, 4vw, 43px);
    line-height: 1.3;
}

.book-detail-author {
    margin: 0;
    color: var(--text-soft);
}

.book-detail-meta {
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.book-detail-meta span {
    padding: 5px 10px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text-soft);
    font-size: 13px;
}

.book-detail-summary {
    max-width: 780px;
    margin: 0;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.9;
}

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

.primary-button,
.secondary-button {
    min-height: 43px;
    padding: 9px 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 650;
}

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

.primary-button:hover {
    background: var(--primary-dark);
}

.secondary-button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--primary-dark);
}

.secondary-button:hover {
    background: var(--surface-soft);
}

.chapter-directory {
    margin-top: 28px;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.chapter-directory-heading {
    margin-bottom: 22px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.chapter-directory-heading h2 {
    margin: 0;
    color: var(--primary-dark);
    font-size: 26px;
}

.chapter-directory-heading > span {
    color: var(--text-soft);
    font-size: 13px;
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.chapter-grid a {
    min-width: 0;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

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

.chapter-number {
    flex: 0 0 auto;
    color: #94a3b8;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.chapter-name {
    min-width: 0;
    overflow: hidden;
    color: var(--primary-dark);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 阅读页面 */

.reader-page {
    --reader-background: #f3efe6;
    --reader-surface: #fffdf7;
    --reader-text: #2f302f;
    background: var(--reader-background);
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.reader-page.reader-dark {
    --reader-background: #171a1f;
    --reader-surface: #22262d;
    --reader-text: #d7d9dd;
    --border: #363b44;
    --text-soft: #a5abb5;
}

.reader-header {
    background: var(--reader-surface);
    border-bottom: 1px solid var(--border);
}

.reader-header-inner {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.reader-site-name {
    color: var(--primary-dark);
    font-weight: 800;
}

.reader-dark .reader-site-name {
    color: #f1f3f5;
}

.reader-book-link {
    color: var(--text-soft);
    font-size: 13px;
}

.reader-book-link:hover {
    text-decoration: underline;
}

.reader-main {
    min-height: calc(100vh - 62px);
    padding: 28px 16px 60px;
}

.reader-shell {
    width: min(100%, 920px);
    margin: 0 auto;
}

.reader-toolbar {
    margin-bottom: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: var(--reader-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.reader-toolbar-title {
    color: var(--text-soft);
    font-size: 13px;
}

.reader-toolbar-buttons {
    display: flex;
    gap: 7px;
}

.reader-toolbar button {
    min-width: 42px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: transparent;
    color: var(--reader-text);
    cursor: pointer;
}

.reader-toolbar button:hover {
    background: rgba(100, 116, 139, 0.1);
}

.chapter-article {
    --reader-font-size: 20px;
    padding: clamp(28px, 6vw, 72px);
    background: var(--reader-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 16px 45px rgba(44, 38, 29, 0.06);
}

.chapter-header {
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.chapter-book-name {
    margin: 0 0 9px;
    color: var(--text-soft);
    font-size: 13px;
}

.chapter-header h1 {
    margin: 0;
    color: var(--reader-text);
    font-size: clamp(27px, 4vw, 38px);
    line-height: 1.4;
}

.chapter-meta {
    margin-top: 13px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    color: var(--text-soft);
    font-size: 12px;
}

.chapter-content {
    padding-top: 32px;
    color: var(--reader-text);
    font-family:
        "Noto Serif SC",
        "Songti SC",
        "SimSun",
        serif;
    font-size: var(--reader-font-size);
    line-height: 2.05;
    letter-spacing: 0.04em;
}

.chapter-content p {
    margin: 0 0 1.25em;
    text-align: justify;
    text-indent: 2em;
}

.chapter-navigation {
    margin-top: 16px;
    padding: 13px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 15px;
    background: var(--reader-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.chapter-navigation-side a,
.chapter-directory-button {
    color: var(--reader-text);
    font-size: 14px;
}

.chapter-navigation-side a:hover,
.chapter-directory-button:hover {
    text-decoration: underline;
}

.chapter-navigation-next {
    text-align: right;
}

.disabled-link {
    color: var(--text-soft);
    font-size: 14px;
}

@media (max-width: 800px) {
    .book-detail-card {
        grid-template-columns: 160px minmax(0, 1fr);
        gap: 24px;
        padding: 22px;
    }

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

@media (max-width: 560px) {
    .book-detail-page {
        padding-top: 20px;
    }

    .book-detail-card {
        grid-template-columns: 105px minmax(0, 1fr);
        gap: 17px;
        padding: 16px;
    }

    .book-detail-info h1 {
        margin-top: 8px;
        font-size: 25px;
    }

    .book-detail-meta {
        margin: 12px 0;
    }

    .book-detail-summary {
        grid-column: 1 / -1;
    }

    .book-actions {
        margin-top: 18px;
    }

    .chapter-directory {
        padding: 18px 14px;
    }

    .chapter-grid {
        grid-template-columns: 1fr;
    }

    .reader-header-inner {
        min-height: 56px;
    }

    .reader-book-link {
        max-width: 58%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .reader-main {
        padding: 16px 8px 38px;
    }

    .chapter-article {
        padding: 30px 20px;
        border-radius: 8px;
    }

    .chapter-content {
        line-height: 1.95;
    }

    .chapter-navigation {
        grid-template-columns: 1fr 1fr;
    }

    .chapter-directory-button {
        grid-column: 1 / -1;
        grid-row: 1;
        text-align: center;
    }
}

/* BOOK_DETAIL_STYLES_END */

/* ADMIN_STYLES_START */

.admin-login-page {
    min-height: 100vh;
    background:
        radial-gradient(
            circle at top left,
            #e2e8f0,
            transparent 38%
        ),
        #f4f6f8;
}

.admin-login-shell {
    min-height: 100vh;
    padding: 28px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-login-card {
    width: min(100%, 430px);
    padding: 38px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(30, 41, 59, 0.12);
}

.admin-login-brand {
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.admin-login-brand a {
    color: var(--primary-dark);
    font-size: 19px;
    font-weight: 800;
}

.admin-login-brand span {
    color: var(--text-soft);
    font-size: 12px;
}

.admin-login-card h1 {
    margin: 0;
    color: var(--primary-dark);
    font-size: 29px;
}

.admin-login-description {
    margin: 7px 0 25px;
    color: var(--text-soft);
    font-size: 14px;
}

.admin-alert {
    margin-bottom: 18px;
    padding: 11px 13px;
    border-radius: 8px;
    font-size: 13px;
}

.admin-alert-error {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}

.admin-login-form {
    display: grid;
    gap: 17px;
}

.admin-login-form label {
    display: grid;
    gap: 7px;
}

.admin-login-form label span {
    color: #475569;
    font-size: 13px;
    font-weight: 650;
}

.admin-login-form input {
    width: 100%;
    min-height: 45px;
    padding: 10px 13px;
    border: 1px solid #cfd6df;
    border-radius: 8px;
    outline: none;
    font-size: 15px;
}

.admin-login-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(51, 65, 85, 0.1);
}

.admin-login-form button {
    min-height: 46px;
    margin-top: 4px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
}

.admin-login-form button:hover {
    background: var(--primary-dark);
}

.admin-back-home {
    margin-top: 23px;
    display: inline-block;
    color: var(--text-soft);
    font-size: 13px;
}

.admin-back-home:hover {
    color: var(--primary-dark);
}

.admin-page {
    min-height: 100vh;
    background: #f3f5f7;
}

.admin-container {
    width: min(calc(100% - 34px), 1240px);
    margin: 0 auto;
}

.admin-header {
    background: #18212f;
    color: #fff;
}

.admin-header-inner {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.admin-brand a {
    font-size: 18px;
    font-weight: 800;
}

.admin-brand span {
    color: #94a3b8;
    font-size: 12px;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    color: #cbd5e1;
    font-size: 13px;
}

.admin-header-actions a:hover {
    color: #fff;
}

.admin-header-actions form {
    margin: 0;
}

.admin-header-actions button {
    padding: 6px 11px;
    border: 1px solid #475569;
    border-radius: 6px;
    background: transparent;
    color: #e2e8f0;
    cursor: pointer;
}

.admin-header-actions button:hover {
    background: #334155;
}

.admin-main {
    padding: 38px 0 65px;
}

.admin-page-heading {
    margin-bottom: 27px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.admin-page-heading p {
    margin: 0 0 4px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.admin-page-heading h1 {
    margin: 0;
    color: var(--primary-dark);
    font-size: 31px;
}

.admin-page-heading > span {
    color: var(--text-soft);
    font-size: 13px;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.admin-stat-card {
    padding: 23px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 13px;
}

.admin-stat-card span {
    display: block;
    color: var(--text-soft);
    font-size: 13px;
}

.admin-stat-card strong {
    margin-top: 8px;
    display: block;
    color: var(--primary-dark);
    font-size: 32px;
    line-height: 1.2;
}

.admin-panel {
    margin-top: 24px;
    padding: 26px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.admin-panel-heading {
    margin-bottom: 21px;
}

.admin-panel-heading h2 {
    margin: 0;
    color: var(--primary-dark);
    font-size: 21px;
}

.admin-panel-heading p {
    margin: 5px 0 0;
    color: var(--text-soft);
    font-size: 13px;
}

.admin-module-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 17px;
}

.admin-module-card {
    padding: 20px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.admin-module-card strong {
    color: var(--primary-dark);
    font-size: 16px;
}

.admin-module-card p {
    min-height: 44px;
    margin: 8px 0 15px;
    color: var(--text-soft);
    font-size: 13px;
}

.admin-module-card span {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 850px) {
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-module-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .admin-login-card {
        padding: 28px 22px;
    }

    .admin-header-inner {
        min-height: 58px;
    }

    .admin-brand span,
    .admin-header-actions > span {
        display: none;
    }

    .admin-header-actions {
        gap: 10px;
    }

    .admin-page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 11px;
    }

    .admin-stat-card {
        padding: 18px;
    }

    .admin-stat-card strong {
        font-size: 27px;
    }

    .admin-panel {
        padding: 19px;
    }
}

/* ADMIN_STYLES_END */
