@import url('../typography.css');

/* =========================================================
   KIEM LAI UNIVERSE — PUBLIC NOVEL READER
   ========================================================= */

:root {
    --reader-bg: #f6f5f2;
    --reader-surface: #ffffff;
    --reader-surface-soft: #faf9f6;

    --reader-text: #24221f;
    --reader-text-secondary: #706b64;
    --reader-text-muted: #969089;

    --reader-border: #e7e3dd;

    --reader-primary: #6c584c;
    --reader-primary-hover: #57463c;
    --reader-primary-light: #f0ebe6;

    --reader-success: #41725c;
    --reader-success-light: #eaf4ef;

    --reader-radius-lg: 20px;
    --reader-radius-md: 14px;
    --reader-radius-sm: 10px;

    --reader-shadow:
        0 12px 36px rgba(38, 32, 26, 0.06);

    --reader-content-width: 1180px;
}

html[data-theme="dark"],
html[data-bs-theme="dark"] {
    --reader-bg: #141312;
    --reader-surface: #1e1c1a;
    --reader-surface-soft: #252320;

    --reader-text: #eae6df;
    --reader-text-secondary: #a8a29a;
    --reader-text-muted: #78736c;

    --reader-border: #383430;

    --reader-primary: #c4a482;
    --reader-primary-hover: #d6bda0;
    --reader-primary-light: #2c2722;

    --reader-success: #5ea885;
    --reader-success-light: #1c2b23;

    --reader-shadow:
        0 12px 36px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] body,
html[data-bs-theme="dark"] body {
    background: linear-gradient(
        180deg,
        #191816 0,
        var(--reader-bg) 360px
    );
    color: var(--reader-text);
}


/* =========================================================
   RESET
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background:
        linear-gradient(
            180deg,
            #fbfaf8 0,
            var(--reader-bg) 360px
        );

    color: var(--reader-text);

    font-family: var(--font-ui);

    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
}


/* =========================================================
   PAGE
   ========================================================= */

.novel-reader {
    width: min(
        calc(100% - 40px),
        var(--reader-content-width)
    );

    margin: 0 auto;

    padding:
        54px
        0
        80px;
}


/* =========================================================
   NOVEL HERO
   ========================================================= */

.novel-reader-hero {
    display: grid;

    grid-template-columns:
        250px
        minmax(0, 1fr);

    gap: 42px;

    padding: 34px;

    border: 1px solid var(--reader-border);
    border-radius: var(--reader-radius-lg);

    background: var(--reader-surface);

    box-shadow: var(--reader-shadow);
}


/* =========================================================
   COVER
   ========================================================= */

.novel-reader-cover {
    position: relative;

    width: 100%;
    aspect-ratio: 2 / 3;

    overflow: hidden;

    border-radius: 16px;

    background: var(--reader-primary-light);

    box-shadow:
        0 14px 30px rgba(42, 34, 28, 0.14);
}

.novel-reader-cover img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}

.novel-reader-cover-placeholder {
    width: 100%;
    height: 100%;

    display: grid;

    place-items: center;

    padding: 30px;

    background:
        linear-gradient(
            145deg,
            #4e4037,
            #806c5d
        );

    color: #ffffff;

    text-align: center;
}

.novel-reader-cover-placeholder::before {
    content: "劍";

    position: absolute;

    top: 24px;
    left: 24px;

    color: rgba(255, 255, 255, 0.12);

    font-family: Georgia, serif;
    font-size: 72px;
    line-height: 1;
}

.novel-reader-cover-placeholder span {
    position: relative;

    font-family: var(--font-reading);

    font-size: 31px;
    font-weight: 700;

    letter-spacing: 2px;
}


/* =========================================================
   OVERVIEW
   ========================================================= */

.novel-reader-overview {
    min-width: 0;

    display: flex;
    flex-direction: column;

    justify-content: center;
}

.novel-reader-eyebrow {
    display: block;

    margin-bottom: 9px;

    color: var(--reader-primary);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 1.7px;
}

.novel-reader-overview h1 {
    margin:
        0
        0
        24px;

    font-family: var(--font-reading);

    font-size: clamp(
        38px,
        5vw,
        58px
    );

    font-weight: 700;

    letter-spacing: -1.5px;
    line-height: 1.1;
}


/* =========================================================
   META
   ========================================================= */

.novel-reader-meta {
    display: flex;

    flex-wrap: wrap;

    gap:
        16px
        36px;

    margin-bottom: 28px;
}

.novel-reader-meta-item {
    display: grid;

    gap: 5px;
}

.novel-reader-meta-label {
    color: var(--reader-text-muted);

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.novel-reader-meta-item strong {
    color: var(--reader-text);

    font-size: 14px;
}


/* =========================================================
   DESCRIPTION
   ========================================================= */

.novel-reader-description {
    max-width: 760px;

    padding-top: 24px;

    border-top: 1px solid var(--reader-border);
}

.novel-reader-description h2 {
    margin:
        0
        0
        10px;

    font-size: 16px;
}

.novel-reader-description p {
    margin: 0;

    color: var(--reader-text-secondary);

    font-family: var(--font-reading);

    font-size: 15px;

    line-height: 1.85;

    white-space: pre-line;
}


/* =========================================================
   TABLE OF CONTENTS
   ========================================================= */

.novel-reader-toc {
    margin-top: 46px;
}

.novel-reader-section-heading {
    display: flex;

    align-items: flex-end;
    justify-content: space-between;

    gap: 24px;

    margin-bottom: 18px;

    padding:
        0
        4px;
}

.novel-reader-section-heading h2 {
    margin: 0;

    font-family: var(--font-reading);

    font-size: 28px;
}

.novel-reader-volume-count {
    color: var(--reader-text-secondary);

    font-size: 12px;
    font-weight: 700;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.novel-reader-empty-state {
    padding:
        58px
        28px;

    border: 1px dashed var(--reader-border);
    border-radius: var(--reader-radius-lg);

    background: var(--reader-surface);

    text-align: center;
}

.novel-reader-empty-state h3 {
    margin:
        0
        0
        8px;

    font-size: 17px;
}

.novel-reader-empty-state p {
    margin: 0;

    color: var(--reader-text-secondary);

    font-size: 13px;
}


/* =========================================================
   VOLUME ACCORDION
   ========================================================= */

.novel-reader-volume-list {
    display: grid;

    gap: 10px;
}

.novel-reader-volume {
    overflow: hidden;

    border: 1px solid var(--reader-border);
    border-radius: var(--reader-radius-md);

    background: var(--reader-surface);

    box-shadow:
        0 4px 16px rgba(38, 32, 26, 0.035);
}

.novel-reader-volume-trigger {
    width: 100%;

    display: grid;

    grid-template-columns:
        auto
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 15px;

    padding:
        18px
        20px;

    border: 0;

    background: transparent;

    color: var(--reader-text);

    text-align: left;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.novel-reader-volume-trigger:hover {
    background: var(--reader-surface-soft);
}

.novel-reader-volume-trigger:focus-visible {
    outline:
        3px
        solid
        rgba(108, 88, 76, 0.16);

    outline-offset: -3px;
}


/* =========================================================
   VOLUME ICON
   ========================================================= */

.novel-reader-volume-icon {
    width: 28px;
    height: 28px;

    display: inline-grid;

    place-items: center;

    border-radius: 8px;

    background: var(--reader-primary-light);

    color: var(--reader-primary);

    font-size: 13px;
    font-weight: 900;

    transition:
        transform 0.18s ease;
}

.novel-reader-volume-trigger[aria-expanded="true"]
.novel-reader-volume-icon {
    transform: rotate(90deg);
}


/* =========================================================
   VOLUME INFO
   ========================================================= */

.novel-reader-volume-main {
    min-width: 0;

    display: grid;

    gap: 5px;
}

.novel-reader-volume-main strong {
    display: block;

    color: var(--reader-text);

    font-family: var(--font-reading);

    font-size: 16px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.novel-reader-volume-main small {
    color: var(--reader-text-secondary);

    font-size: 11px;
}

.novel-reader-volume-order {
    padding:
        6px
        10px;

    border-radius: 999px;

    background: var(--reader-primary-light);

    color: var(--reader-primary);

    font-size: 10px;
    font-weight: 800;

    white-space: nowrap;
}


/* =========================================================
   VOLUME CONTENT
   ========================================================= */

.novel-reader-volume-content {
    border-top: 1px solid var(--reader-border);

    background: var(--reader-surface-soft);
}

.novel-reader-volume-content[hidden] {
    display: none;
}

.novel-reader-volume-loading {
    padding: 24px;

    color: var(--reader-text-secondary);

    font-size: 12px;

    text-align: center;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 820px) {

    .novel-reader {
        width: min(
            calc(100% - 28px),
            var(--reader-content-width)
        );

        padding-top: 28px;
    }

    .novel-reader-hero {
        grid-template-columns:
            180px
            minmax(0, 1fr);

        gap: 26px;

        padding: 26px;
    }

    .novel-reader-overview h1 {
        margin-bottom: 18px;
    }

}


@media (max-width: 620px) {

    .novel-reader {
        width: min(
            calc(100% - 20px),
            var(--reader-content-width)
        );

        padding:
            18px
            0
            50px;
    }

    .novel-reader-hero {
        grid-template-columns: 1fr;

        gap: 26px;

        padding: 20px;
    }

    .novel-reader-cover {
        width: min(
            210px,
            72vw
        );

        margin: 0 auto;
    }

    .novel-reader-overview {
        text-align: center;
    }

    .novel-reader-overview h1 {
        font-size: 38px;
    }

    .novel-reader-meta {
        justify-content: center;
    }

    .novel-reader-description {
        text-align: left;
    }

    .novel-reader-section-heading {
        align-items: flex-start;
        flex-direction: column;

        gap: 8px;
    }

    .novel-reader-section-heading h2 {
        font-size: 24px;
    }

    .novel-reader-volume-trigger {
        grid-template-columns:
            auto
            minmax(0, 1fr);

        gap: 12px;

        padding:
            16px
            14px;
    }

    .novel-reader-volume-order {
        grid-column: 2;

        width: fit-content;
    }

    .novel-reader-volume-main strong {
        white-space: normal;
    }

}


/* =========================================================
   CHAPTER GRID (IN VOLUME ACCORDION)
   ========================================================= */

.novel-reader-chapter-list {
    padding: 18px 20px 22px;
}

.novel-reader-chapter-empty {
    padding: 16px;
    color: var(--reader-text-muted);
    font-size: 13px;
    text-align: center;
}

.novel-reader-chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px 14px;
}

.novel-reader-chapter-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--reader-radius-sm);
    background: var(--reader-surface);
    border: 1px solid var(--reader-border);
    color: var(--reader-text);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.novel-reader-chapter-item:hover {
    background: var(--reader-primary-light);
    border-color: var(--reader-primary);
    transform: translateY(-1px);
}

.novel-reader-chapter-number {
    font-size: 11px;
    font-weight: 700;
    color: var(--reader-primary);
    white-space: nowrap;
}

.novel-reader-chapter-title {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   CHAPTER READING PAGE
   ========================================================= */

.novel-chapter-reading {
    width: min(calc(100% - 40px), 820px);
    margin: 0 auto;
    padding: 44px 0 90px;
}

.novel-chapter-utility-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    position: relative;
}

.novel-chapter-utility-row .novel-chapter-breadcrumb {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.novel-chapter-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--reader-text-muted);
}

.novel-chapter-breadcrumb a {
    color: var(--reader-primary);
    text-decoration: none;
    font-weight: 600;
}

.novel-chapter-breadcrumb a:hover {
    text-decoration: underline;
}

.novel-breadcrumb-separator {
    color: var(--reader-border);
}

/* =========================================================
   NOVEL CHAPTER READING — GEAR SETTINGS TRIGGER & POPOVER
   ========================================================= */
.novel-reading-settings-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.novel-reading-settings-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--reader-border);
    border-radius: var(--reader-radius-sm);
    background: var(--reader-surface);
    color: var(--reader-text-secondary);
    cursor: pointer;
    box-shadow: 0 2px 8px var(--reader-shadow);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.novel-reading-settings-trigger:hover {
    background: var(--reader-primary-light);
    border-color: var(--reader-primary);
    color: var(--reader-primary);
}

.novel-reading-settings-trigger.is-active,
.novel-reading-settings-trigger[aria-expanded="true"] {
    background: var(--reader-primary-light);
    border-color: var(--reader-primary);
    color: var(--reader-primary);
    box-shadow: 0 0 0 3px rgba(108, 88, 76, 0.15);
}

.novel-reading-settings-trigger:focus-visible {
    outline: 2px solid var(--reader-primary);
    outline-offset: 2px;
}

.novel-reading-settings-gear-icon {
    display: block;
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.novel-reading-settings-trigger:hover .novel-reading-settings-gear-icon {
    transform: rotate(45deg);
}

.novel-reading-settings-trigger[aria-expanded="true"] .novel-reading-settings-gear-icon {
    transform: rotate(90deg);
}

/* Popover */
.novel-reading-settings-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1050;
    width: 270px;
    max-width: calc(100vw - 24px);
    padding: 16px;
    border: 1px solid var(--reader-border);
    border-radius: var(--reader-radius-md);
    background: var(--reader-surface);
    box-shadow: 0 12px 36px var(--reader-shadow), 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.novel-reading-settings-popover[hidden] {
    display: none !important;
}

.novel-reading-popover-header {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--reader-border);
}

.novel-reading-popover-title {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 700;
    color: var(--reader-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.novel-reading-popover-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.novel-reading-popover-label {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    color: var(--reader-text-secondary);
    white-space: nowrap;
}

.novel-font-controls {
    display: inline-flex;
    align-items: center;
    padding: 2px;
    border: 1px solid var(--reader-border);
    border-radius: var(--reader-radius-sm);
    background: var(--reader-surface-soft);
}

.novel-font-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--reader-text-secondary);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.novel-font-button--family,
.novel-font-button--theme {
    min-width: 44px;
    padding: 0 8px;
}

.novel-font-button:hover {
    background: var(--reader-surface);
    color: var(--reader-text);
}

.novel-font-button.is-active,
.novel-font-button[aria-pressed="true"] {
    background: var(--reader-surface);
    color: var(--reader-primary);
    font-weight: 800;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.novel-font-button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.novel-font-button:disabled:hover {
    background: transparent;
}

.novel-font-button:focus-visible {
    outline: 2px solid var(--reader-primary);
    outline-offset: 1px;
}

.novel-chapter-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--reader-border);
    text-align: center;
}

.novel-chapter-volume-tag {
    display: inline-block;
    margin-bottom: 12px;
    padding: 4px 14px;
    border-radius: 999px;
    background: var(--reader-primary-light);
    color: var(--reader-primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.novel-chapter-title {
    margin: 0;
    font-family: var(--font-reading);
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 700;
    line-height: 1.25;
    color: var(--reader-text);
}

.novel-chapter-number-prefix {
    color: var(--reader-primary);
    margin-right: 6px;
}

/* Chapter Navigation Controls */
.novel-chapter-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 32px 0;
}

.novel-chapter-nav--top {
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--reader-border);
}

.novel-chapter-nav--bottom {
    margin-top: 50px;
    padding-top: 24px;
    border-top: 1px solid var(--reader-border);
}

.novel-chapter-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: var(--reader-radius-sm);
    border: 1px solid var(--reader-border);
    background: var(--reader-surface);
    color: var(--reader-text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.novel-chapter-nav-btn:hover:not(.novel-chapter-nav-btn--disabled) {
    background: var(--reader-primary-light);
    border-color: var(--reader-primary);
    color: var(--reader-primary);
}

.novel-chapter-nav-btn--disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--reader-surface-soft);
}

.novel-chapter-nav-btn--toc {
    background: var(--reader-surface-soft);
}

/* Chapter Prose Typography */
.novel-reader-chapter-body {
    font-family: var(--font-reading);
    font-size: calc(18px * var(--reading-scale, 1));
    line-height: 1.95;
    color: var(--reader-text);
    word-break: break-word;
    overflow-wrap: break-word;
}

.novel-reader-chapter-body p {
    margin: 0 0 1.6em;
    text-align: justify;
    text-justify: inter-word;
    overflow-wrap: break-word;
}

.novel-reader-chapter-body h1,
.novel-reader-chapter-body h2,
.novel-reader-chapter-body h3,
.novel-reader-chapter-body h4,
.novel-reader-chapter-body h5,
.novel-reader-chapter-body h6 {
    font-family: var(--font-ui);
    color: var(--reader-text);
    margin: 1.8em 0 0.8em;
    text-align: left;
}

.novel-reader-chapter-body blockquote {
    margin: 1.8em 0;
    padding: 14px 20px;
    border-left: 3px solid var(--reader-primary);
    background: var(--reader-surface-soft);
    color: var(--reader-text-secondary);
    font-style: italic;
    text-align: left;
}

.novel-reader-chapter-body blockquote p {
    text-align: left;
}

@media (max-width: 576px) {
    .novel-reader-chapter-body p {
        text-align: left;
    }
}

/* =========================================================
   TABLE OF CONTENTS (TOC) DRAWER
   ========================================================= */

body.has-toc-open {
    overflow: hidden;
}

/* Backdrop */
.novel-toc-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(36, 34, 31, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.novel-toc-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

/* Drawer Shell */
.novel-toc-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    width: min(380px, 90vw);
    height: 100vh;
    height: 100dvh;
    background: var(--reader-surface);
    box-shadow: -8px 0 32px rgba(36, 34, 31, 0.15);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s ease;
    visibility: hidden;
}

.novel-toc-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
}

/* Drawer Header */
.novel-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--reader-border);
    background: var(--reader-surface-soft);
    flex-shrink: 0;
}

.novel-toc-header-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.novel-toc-back-link {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--reader-primary);
    text-decoration: none;
    transition: color 0.15s ease;
    margin-bottom: 2px;
}

.novel-toc-back-link:hover {
    color: var(--reader-primary-hover);
    text-decoration: underline;
}

.novel-toc-header h2 {
    margin: 0;
    font-family: var(--font-reading);
    font-size: 20px;
    font-weight: 700;
    color: var(--reader-text);
}

.novel-toc-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--reader-border);
    border-radius: var(--reader-radius-sm);
    background: var(--reader-surface);
    color: var(--reader-text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.novel-toc-close:hover {
    background: var(--reader-primary-light);
    border-color: var(--reader-primary);
    color: var(--reader-primary);
}

/* Scrollable Chapter List */
.novel-toc-scrollable {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 16px 24px;
}

.novel-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.novel-toc-item {
    margin: 0;
    padding: 0;
}

.novel-toc-link {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--reader-radius-sm);
    color: var(--reader-text);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    transition: background 0.15s ease, color 0.15s ease;
}

.novel-toc-link:hover {
    background: var(--reader-surface-soft);
    color: var(--reader-primary);
}

.novel-toc-item-number {
    font-weight: 700;
    font-size: 13px;
    color: var(--reader-primary);
    flex-shrink: 0;
}

.novel-toc-item-separator {
    color: var(--reader-text-muted);
    flex-shrink: 0;
}

.novel-toc-item-title {
    font-weight: 500;
    color: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Active Chapter Item */
.novel-toc-item.is-active .novel-toc-link {
    background: var(--reader-primary-light);
    color: var(--reader-primary);
    font-weight: 700;
}

.novel-toc-item.is-active .novel-toc-item-number {
    color: var(--reader-primary-hover);
}

.novel-toc-item.is-active .novel-toc-item-title {
    font-weight: 700;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .novel-toc-drawer {
        width: 100%;
        max-width: 100vw;
    }

    .novel-toc-header {
        padding: 16px 20px;
    }

    .novel-toc-link {
        padding: 12px 14px;
    }
}