/* Truyện chữ: trang giới thiệu + trang đọc. Dùng lại khung .comic-container của truyện tranh. */

.novel-page,
.novel-reader {
    padding-top: 20px;
    padding-bottom: 40px;
}

.novel-page,
.novel-skin {
    --novel-accent: var(--primary-color);
    --novel-accent-soft: rgba(47, 111, 237, 0.08);
    --novel-ink: #1a2744;
    --novel-sub: #7a869a;
    --novel-line: #e8edf5;
}

.novel-muted {
    color: #7a869a;
    font-size: 0.85em;
    font-weight: normal;
}

.novel-section {
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

/* ---------- Thẻ chung ---------- */

.novel-card {
    border: 1px solid color-mix(in srgb, var(--fs-color-primary) 14%, #fff);
    border-radius: 16px;
    padding: 22px 24px;
    margin-top: 20px;
}

.novel-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.novel-card__icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--novel-accent-soft);
    color: var(--novel-accent);
}

.novel-card__icon svg {
    width: 20px;
    height: 20px;
}

.novel-card__title {
    margin: 0;
    font-size: 1.15em;
    font-weight: 700;
    color: var(--novel-ink);
    letter-spacing: 0.01em;
}

/* ---------- Giới thiệu ---------- */

.novel-intro__body {
    position: relative;
    color: #3a4660;
    font-size: 1rem;
}

.novel-intro__body p:last-child {
    margin-bottom: 0;
}

.novel-intro__body.is-collapsed {
    max-height: 10.5em;
    overflow: hidden;
}


.novel-pill-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin: 14px auto 0;
    margin-right: auto !important;
    margin-left: auto !important;
    min-height: 0;
    padding: 6px 16px;
    border: 1px solid var(--novel-line);
    border-radius: 999px;
    background: #fff;
    color: var(--novel-accent);
    font-size: 0.9em;
    font-weight: 600;
    line-height: 1.4;
    text-transform: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.novel-pill-toggle:hover {
    background: var(--novel-accent-soft);
    border-color: transparent;
}

.novel-pill-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.novel-pill-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

/* ---------- Danh sách chương ---------- */

.novel-toc__count {
    margin-left: auto;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--novel-accent-soft);
    color: var(--novel-accent);
    font-size: 0.85em;
    font-weight: 700;
}

.novel-toc__latest {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: linear-gradient(120deg, var(--novel-accent), #6a8dff);
    color: #fff;
    box-shadow: 0 6px 18px rgba(47, 111, 237, 0.25);
    transition: transform 0.15s;
}

.novel-toc__latest:hover {
    color: #fff;
    transform: translateY(-1px);
}

.novel-toc__latest-label {
    flex: none;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.novel-toc__latest-name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.novel-toc__latest-time {
    flex: none;
    font-size: 0.85em;
    opacity: 0.85;
}

.novel-toc__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.novel-toc__search {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0 14px;
    height: 40px;
    border: 1px solid var(--novel-line);
    border-radius: 10px;
    background: #f7f9fc;
    color: var(--novel-sub);
    font-weight: normal;
    transition: border-color 0.15s, background 0.15s;
}

.novel-toc__search:focus-within {
    border-color: var(--novel-accent);
    background: #fff;
}

.novel-toc__search svg {
    flex: none;
    width: 18px;
    height: 18px;
}

/* Flatsome gắn viền, bóng, nền cho input[type=search]; cần selector mạnh hơn. */
.novel-toc .novel-toc__search input[type="search"],
.novel-toc .novel-toc__search input[type="search"]:hover,
.novel-toc .novel-toc__search input[type="search"]:focus {
    flex: 1;
    min-width: 0;
    width: auto;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 0;
    outline: none;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--novel-ink);
    font-size: 0.95em;
    line-height: normal;
    -webkit-appearance: none;
    appearance: none;
}

.novel-toc .novel-toc__search input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

.novel-toc__sort {
    display: inline-flex;
    padding: 3px;
    border-radius: 10px;
    background: #f0f3f8;
}

.novel-toc__sort button {
    margin: 0;
    min-height: 0;
    padding: 7px 14px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--novel-sub);
    font-size: 0.88em;
    font-weight: 600;
    line-height: 1.3;
    text-transform: none;
    cursor: pointer;
}

.novel-toc__sort button.is-active {
    background: #fff;
    color: var(--novel-ink);
    box-shadow: 0 1px 4px rgba(26, 39, 68, 0.12);
}

.novel-toc__ranges {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.novel-toc__ranges button {
    flex: none;
    margin: 0;
    min-height: 0;
    padding: 5px 12px;
    border: 1px solid var(--novel-line);
    border-radius: 999px;
    background: #fff;
    color: var(--novel-sub);
    font-size: 0.82em;
    font-weight: 600;
    line-height: 1.4;
    text-transform: none;
    cursor: pointer;
}

.novel-toc__ranges button.is-active {
    border-color: var(--novel-accent);
    background: var(--novel-accent);
    color: #fff;
}

.novel-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.novel-toc__item {
    margin: 0;
}

.novel-toc__item a {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
    padding: 9px 12px 9px 9px;
    border: 1px solid var(--novel-line);
    border-radius: 10px;
    color: var(--novel-ink);
    transition: border-color 0.15s, background 0.15s;
}

.novel-toc__item a:hover {
    border-color: var(--novel-accent);
    background: var(--novel-accent-soft);
}

.novel-toc__no {
    flex: none;
    min-width: 44px;
    padding: 4px 6px;
    border-radius: 8px;
    background: #f0f3f8;
    color: var(--novel-ink);
    font-size: 0.85em;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.novel-toc__item a:hover .novel-toc__no {
    background: var(--novel-accent);
    color: #fff;
}

.novel-toc__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.novel-toc__item a:visited .novel-toc__name {
    color: #8a93a6;
}

.novel-toc__badge {
    flex: none;
    padding: 1px 8px;
    border-radius: 999px;
    background: #ffecec;
    color: #e5484d;
    font-size: 0.72em;
    font-weight: 700;
}

.novel-toc__time {
    flex: none;
    color: var(--novel-sub);
    font-size: 0.8em;
}

.novel-toc__item.is-current a {
    border-color: #f5a524;
    background: #fff8eb;
}

.novel-toc__item.is-current .novel-toc__no {
    background: #f5a524;
    color: #fff;
}

.novel-toc__item.is-current .novel-toc__name::after {
    content: ' · Đang đọc';
    color: #c27c0e;
    font-size: 0.85em;
    font-weight: 600;
}

.novel-toc__empty {
    margin: 8px 0 0;
    padding: 24px;
    border: 1px dashed var(--novel-line);
    border-radius: 12px;
    color: var(--novel-sub);
    text-align: center;
}

/* ---------- Trang đọc ---------- */

/* Biến đặt trên body để nền cả trang đổi theo lựa chọn; JS gắn data-novel-* lên body. */
body.is-novel-reader {
    --r-page: #514646;
    --r-paper: #fff;
    --r-fg: #23272f;
    --r-sub: #7a869a;
    --r-line: #e7ebf2;
    --r-chip: #f0f3f8;
    --r-accent: var(--primary-color, #2f6fed);
    --r-accent-soft: rgba(47, 111, 237, 0.1);
    --r-size: 20px;
    --r-leading: 1.9;
    --r-width: 760px;
    background: var(--r-page);
    transition: background 0.25s;
}

body.is-novel-reader[data-novel-theme="sepia"] {
    --r-page:#514a37;
    --r-paper: #f8f1dd;
    --r-fg: #43382a;
    --r-sub: #8c7b62;
    --r-line: #e2d5b3;
    --r-chip: #efe4c6;
    --r-accent: #a86a1f;
    --r-accent-soft: rgba(168, 106, 31, 0.12);
}

body.is-novel-reader[data-novel-theme="mint"] {
    --r-page: #434f46;
    --r-paper: #ebf5ed;
    --r-fg: #25382b;
    --r-sub: #6a8471;
    --r-line: #cde0d2;
    --r-chip: #dcecdf;
    --r-accent: #2f8a57;
    --r-accent-soft: rgba(47, 138, 87, 0.12);
}

body.is-novel-reader[data-novel-theme="dark"] {
    --r-page: #232c3b;
    --r-paper: #1a1e25;
    --r-fg: #d4d9e1;
    --r-sub: #8a94a6;
    --r-line: #2a303a;
    --r-chip: #252a33;
    --r-accent: #7aa2ff;
    --r-accent-soft: rgba(122, 162, 255, 0.14);
}



body.is-novel-reader[data-novel-leading="sm"] { --r-leading: 1.65; }
body.is-novel-reader[data-novel-leading="lg"] { --r-leading: 2.2; }
body.is-novel-reader[data-novel-width="sm"] { --r-width: 640px; }
body.is-novel-reader[data-novel-width="lg"] { --r-width: 920px; }

body.is-novel-reader #wrapper,
body.is-novel-reader #main {
    background: transparent;
}

.novel-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    height: 3px;
    pointer-events: none;
}

.novel-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--r-accent);
    box-shadow: 0 0 8px var(--r-accent);
    transition: width 0.1s linear;
}

.novel-reader {
    max-width: calc(var(--r-width) + 32px);
    margin: 0 auto;
    padding: 24px 16px 120px;
}

.novel-paper {
    background: var(--r-paper);
    color: var(--r-fg);
    border: 1px solid var(--r-line);
    border-radius: 10px;
    padding: 44px 56px 36px;
    box-shadow: 0 10px 40px rgba(16, 24, 40, 0.06);
    transition: background 0.25s, color 0.25s, border-color 0.25s;
}

/* ---------- Đầu chương ---------- */

.novel-head {
    position: relative;
    margin: -44px -56px 36px;
    padding: 28px 56px 26px;
    border-bottom: 1px solid var(--r-line);
    border-radius: 10px 10px 0 0;
    background:
        radial-gradient(120% 140% at 0% 0%, var(--r-accent-soft), transparent 60%),
        var(--r-paper);
    overflow: hidden;
}

.novel-head__crumb {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin-bottom: 22px;
    color: var(--r-sub);
    font-size: 0.85em;
    font-weight: 600;
}

.novel-head__crumb > svg {
    flex: none;
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.novel-head__crumb a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: inherit;
}

.novel-head__crumb a:hover {
    color: var(--r-accent);
}

.novel-head__crumb a svg {
    flex: none;
    width: 17px;
    height: 17px;
}

.novel-head__crumb a span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.novel-head__crumb-current {
    flex: none;
    color: var(--r-fg);
}

.novel-head__main {
    display: flex;
    align-items: center;
    gap: 22px;
}

.novel-head__no {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 12px 14px 10px;
    border-radius: 10px;
    background: var(--r-accent);
    color: #fff;
    box-shadow: 0 10px 24px var(--r-accent-soft);
    line-height: 1;
}

.novel-head__no small {
    font-size: 0.68em;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.85;
}

.novel-head__no strong {
    margin-top: 6px;
    font-size: 2.1em;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.novel-head__title {
    flex: 1;
    min-width: 0;
    margin: 0;
    color: var(--r-fg);
    font-size: 1.85em;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: break-word;
}

.novel-head.is-plain .novel-head__title {
    font-size: 2.1em;
}

.novel-head__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin-top: 22px;
}

.novel-head__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.novel-head__chips li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 5px 12px;
    border: 1px solid var(--r-line);
    border-radius: 10px;
    background: var(--r-paper);
    color: var(--r-sub);
    font-size: 0.8em;
    font-weight: 600;
    white-space: nowrap;
}

.novel-head__chips svg {
    flex: none;
    width: 15px;
    height: 15px;
}

.novel-head__pos {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 150px;
    color: var(--r-fg);
    font-size: 0.85em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.novel-head__pos em {
    color: var(--r-sub);
    font-style: normal;
    font-weight: 500;
}

.novel-head__pos i {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: var(--r-chip);
    overflow: hidden;
}

.novel-head__pos b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--r-accent);
}

.novel-reader__content {
    color: var(--r-fg);
    font-size: var(--r-size);
    line-height: var(--r-leading);
    overflow-wrap: break-word;
    text-align: justify;
    hyphens: auto;
}

.novel-reader__content p {
    margin: 0 0 1.1em;
}

.novel-reader__content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em auto;
    border-radius: 10px;
}

.novel-reader__end {
    margin-top: 40px;
    text-align: center;
}

.novel-reader__end-mark {
    display: block;
    margin-bottom: 28px;
    color: var(--r-sub);
    letter-spacing: 0.6em;
    opacity: 0.6;
}

.novel-reader__pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.novel-pager-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid var(--r-line);
    border-radius: 8px;
    color: var(--r-fg);
    text-align: left;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.novel-pager-card:hover {
    border-color: var(--r-accent);
    background: var(--r-accent-soft);
    color: var(--r-fg);
    transform: translateY(-1px);
}

.novel-pager-card svg {
    flex: none;
    width: 22px;
    height: 22px;
    color: var(--r-accent);
}

.novel-pager-card > span {
    flex: 1;
    min-width: 0;
}

.novel-pager-card small {
    display: block;
    color: var(--r-sub);
    font-size: 0.78em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.novel-pager-card strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.98em;
}

.novel-pager-card--next {
    text-align: right;
    border-color: var(--r-accent);
    background: var(--r-accent-soft);
}

.novel-pager-card.is-muted {
    border-color: var(--r-line);
    background: transparent;
}

.novel-reader__comments {
    margin-top: 24px;
    padding: 20px;
    border-radius: 10px;
    background: #fff;
}

.novel-reader__missing {
    text-align: center;
    padding: 64px 24px;
}

.novel-reader__missing-icon {
    display: inline-flex;
    width: 64px;
    height: 64px;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: var(--r-accent-soft);
    color: var(--r-accent);
}

.novel-reader__missing-icon svg {
    width: 32px;
    height: 32px;
}

.novel-reader__missing h1 {
    margin: 18px 0 8px;
    color: var(--r-fg);
}

.novel-reader__missing p {
    color: var(--r-sub);
}

.novel-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 999px;
    font-weight: 600;
}

.novel-btn--primary {
    background: var(--r-accent);
    color: #fff;
}

.novel-btn--primary:hover {
    color: #fff;
    opacity: 0.9;
}

/* ---------- Thanh nổi ---------- */

.novel-dock {
    position: fixed;
    left: 50%;
    bottom: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--r-line);
    border-radius: 999px;
    background: var(--r-paper);
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.18);
    transform: translateX(-50%);
    transition: transform 0.25s, opacity 0.25s, background 0.25s;
}

.novel-dock.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 140%);
}

.novel-dock__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--r-fg);
    font-size: 0.9em;
    font-weight: 700;
    line-height: 1;
    text-transform: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.novel-dock__btn svg {
    width: 22px;
    height: 22px;
}

.novel-dock__btn:hover,
.novel-dock__btn.is-active {
    background: var(--r-chip);
    color: var(--r-accent);
}

.novel-dock__btn--wide {
    width: auto;
    padding: 0 16px;
}

.novel-dock__btn--wide em {
    color: var(--r-sub);
    font-style: normal;
    font-weight: 500;
}

.novel-dock__btn--primary,
.novel-dock__btn--primary:hover {
    background: var(--r-accent);
    color: #fff;
}

.novel-dock__btn.is-disabled {
    opacity: 0.3;
    pointer-events: none;
}

.novel-dock__btn--auto .novel-dock__ico-pause {
    display: none;
}

.novel-dock__btn--auto.is-active .novel-dock__ico-play {
    display: none;
}

.novel-dock__btn--auto.is-active .novel-dock__ico-pause {
    display: block;
}

.novel-dock__btn--auto.is-active {
    background: var(--r-accent);
    color: #fff;
}

.novel-auto-bar {
    position: fixed;
    left: 50%;
    bottom: 84px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 14px;
    border: 1px solid var(--r-line);
    border-radius: 999px;
    background: var(--r-paper);
    box-shadow: 0 10px 28px rgba(16, 24, 40, 0.16);
    transform: translateX(-50%);
    color: var(--r-fg);
}

.novel-auto-bar[hidden] {
    display: none;
}

.novel-auto-bar__label {
    color: var(--r-sub);
    font-size: 0.82em;
    font-weight: 700;
    white-space: nowrap;
}

.novel-auto-bar__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--r-sub);
    cursor: pointer;
}

.novel-auto-bar__close:hover {
    background: var(--r-chip);
    color: var(--r-fg);
}

.novel-auto-bar__close svg {
    width: 14px;
    height: 14px;
}

.novel-stepper--compact {
    padding: 2px;
}

.novel-stepper--compact button {
    padding: 6px 10px;
}

.novel-stepper--compact output {
    min-width: 28px;
}

/* ---------- Bảng cài đặt + mục lục ---------- */

.novel-overlay {
    position: fixed;
    inset: 0;
    z-index: 1001;
    background: rgba(10, 14, 20, 0.35);
    backdrop-filter: blur(2px);
}

.novel-sheet {
    position: fixed;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    background: var(--r-paper);
    color: var(--r-fg);
    border: 1px solid var(--r-line);
    box-shadow: 0 20px 50px rgba(16, 24, 40, 0.25);
}

.novel-sheet[hidden] {
    display: none;
}

.novel-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 1.05em;
}

.novel-sheet__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--r-chip);
    color: var(--r-fg);
    cursor: pointer;
}

.novel-sheet__close svg {
    width: 18px;
    height: 18px;
}

.novel-settings {
    left: 50%;
    bottom: 88px;
    width: min(380px, calc(100vw - 24px));
    padding: 20px;
    border-radius: 20px;
    transform: translateX(-50%);
    animation: novel-pop 0.18s ease-out;
}

.novel-settings__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--r-line);
}

.novel-settings__label {
    color: var(--r-sub);
    font-size: 0.9em;
    font-weight: 600;
}

.novel-stepper,
.novel-segment {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border-radius: 12px;
    background: var(--r-chip);
}

.novel-stepper button,
.novel-segment button {
    min-height: 0;
    margin: 0;
    padding: 7px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--r-fg);
    font-size: 0.85em;
    font-weight: 600;
    line-height: 1.2;
    text-transform: none;
    cursor: pointer;
}

.novel-stepper output {
    min-width: 36px;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.novel-segment button.is-active {
    background: var(--r-paper);
    color: var(--r-accent);
    box-shadow: 0 1px 4px rgba(16, 24, 40, 0.12);
}

.novel-swatches {
    display: inline-flex;
    gap: 10px;
}

.novel-swatches button {
    width: 32px;
    height: 32px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 999px;
    cursor: pointer;
    transition: box-shadow 0.15s;
}

.novel-swatches button.is-active {
    box-shadow: 0 0 0 2px var(--r-paper), 0 0 0 4px var(--r-accent);
}

.novel-swatches .is-light { background: #fff; }
.novel-swatches .is-sepia { background: #f8f1dd; }
.novel-swatches .is-mint { background: #ebf5ed; }
.novel-swatches .is-dark { background: #1a1e25; }

.novel-drawer {
    top: 0;
    right: 0;
    bottom: 0;
    width: min(400px, 92vw);
    padding: 20px;
    border-radius: 20px 0 0 20px;
    animation: novel-slide 0.22s ease-out;
}

.novel-drawer__count {
    margin-left: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--r-accent-soft);
    color: var(--r-accent);
    font-size: 0.8em;
}

.novel-drawer__search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    margin: 0 0 12px;
    padding: 0 14px;
    border: 1px solid var(--r-line);
    border-radius: 12px;
    background: var(--r-chip);
    color: var(--r-sub);
    font-weight: normal;
}

.novel-drawer__search:focus-within {
    border-color: var(--r-accent);
}

.novel-drawer__search svg {
    flex: none;
    width: 18px;
    height: 18px;
}

.novel-drawer .novel-drawer__search input[type="search"],
.novel-drawer .novel-drawer__search input[type="search"]:focus {
    flex: 1;
    min-width: 0;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 0;
    outline: none;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--r-fg);
    -webkit-appearance: none;
    appearance: none;
}

.novel-drawer__list {
    flex: 1;
    min-height: 0;
    margin: 0 -8px;
    padding: 0 8px;
    list-style: none;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.novel-drawer__list li {
    margin: 0;
}

.novel-drawer__list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 10px;
    color: var(--r-fg);
}

.novel-drawer__list a:hover {
    background: var(--r-chip);
    color: var(--r-fg);
}

.novel-drawer__no {
    flex: none;
    min-width: 42px;
    padding: 3px 6px;
    border-radius: 8px;
    background: var(--r-chip);
    font-size: 0.82em;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.novel-drawer__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95em;
}

.novel-drawer__list .is-current a {
    background: var(--r-accent-soft);
    color: var(--r-accent);
    font-weight: 600;
}

.novel-drawer__list .is-current .novel-drawer__no {
    background: var(--r-accent);
    color: #fff;
}

body.novel-lock {
    overflow: hidden;
}

@keyframes novel-pop {
    from { opacity: 0; transform: translate(-50%, 12px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes novel-slide {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@media (max-width: 600px) {
    .novel-card {
        padding: 18px 16px;
        border-radius: 14px;
    }

    .novel-toc__latest {
        flex-wrap: wrap;
        gap: 6px 10px;
    }

    .novel-toc__latest-name {
        flex-basis: 100%;
        order: 3;
        white-space: normal;
    }

    .novel-toc__latest-time {
        margin-left: auto;
    }

    .novel-toc__search {
        min-width: 0;
        flex-basis: 100%;
    }

    .novel-toc__sort {
        width: 100%;
    }

    .novel-toc__sort button {
        flex: 1;
    }

    .novel-toc__list {
        grid-template-columns: 1fr;
    }

    .novel-toc__time {
        display: none;
    }

    .novel-reader {
        padding: 12px 8px 110px;
    }

    .novel-paper {
        padding: 28px 18px 24px;
        border-radius: 8px;
    }

    .novel-head {
        margin: -28px -18px 24px;
        padding: 20px 18px;
        border-radius: 8px 8px 0 0;
    }

    .novel-head__crumb {
        margin-bottom: 16px;
    }

    .novel-head__main {
        gap: 14px;
    }

    .novel-head__no {
        min-width: 64px;
        padding: 9px 10px 8px;
        border-radius: 8px;
    }

    .novel-head__no strong {
        font-size: 1.5em;
    }

    .novel-head__title,
    .novel-head.is-plain .novel-head__title {
        font-size: 1.35em;
    }

    .novel-head__foot {
        margin-top: 16px;
    }

    .novel-head__chips {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
        gap: 6px;
        width: 100%;
    }

    .novel-head__chips li {
        justify-content: center;
        gap: 5px;
        min-width: 0;
        padding: 6px 8px;
        border-radius: 10px;
        font-size: 0.74em;
    }

    .novel-head__chips svg {
        width: 13px;
        height: 13px;
    }

    .novel-head__pos {
        width: 100%;
    }

    .novel-reader__content {
        text-align: left;
    }

    .novel-reader__end {
        margin-top: 28px;
    }

    .novel-reader__end-mark {
        margin-bottom: 20px;
    }

    .novel-reader__pager {
        gap: 8px;
    }

    .novel-pager-card {
        align-items: flex-start;
        gap: 6px;
        padding: 12px 10px;
    }

    .novel-pager-card:hover {
        transform: none;
    }

    .novel-pager-card svg {
        width: 18px;
        height: 18px;
        margin-top: 1px;
    }

    .novel-pager-card small {
        font-size: 0.66em;
        letter-spacing: 0.03em;
    }

    .novel-pager-card strong {
        display: -webkit-box;
        margin-top: 2px;
        font-size: 0.86em;
        line-height: 1.35;
        white-space: normal;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .novel-dock {
        bottom: 12px;
        left: 50%;
        width: auto;
        max-width: calc(100vw - 16px);
        gap: 2px;
        padding: 5px;
        justify-content: center;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .novel-dock::-webkit-scrollbar {
        display: none;
    }

    .novel-dock__btn {
        width: 40px;
        height: 40px;
        flex: 0 0 auto;
    }

    .novel-dock__btn svg {
        width: 20px;
        height: 20px;
    }

    .novel-dock__btn--wide {
        padding: 0 10px;
        font-size: 0.84em;
        gap: 5px;
    }

    .novel-auto-bar {
        bottom: 72px;
    }

    .novel-settings {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
        transform: none;
        animation-name: novel-sheet-up;
    }

    .novel-drawer {
        width: 100%;
        border-radius: 0;
    }
}

@media (max-width: 360px) {
    .novel-reader__pager {
        grid-template-columns: 1fr;
    }

    .novel-pager-card--next {
        order: -1;
    }

    .novel-head__chips li {
        flex-direction: column;
        gap: 3px;
        padding: 6px 4px;
        white-space: normal;
        text-align: center;
        line-height: 1.2;
    }
}

@keyframes novel-sheet-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ---------- Trang thể loại ---------- */

.novel-type-tabs {
    --novel-accent: var(--primary-color, #2f6fed);
    display: flex;
    gap: 8px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.novel-archive .novel-type-tabs {
    padding: 0;
    margin: 0 0 16px;
}

.novel-type-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid #e3e8f0;
    border-radius: 8px;
    background: #fff;
    color: #56627a;
    font-weight: 600;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.novel-type-tabs a:hover {
    border-color: var(--novel-accent);
    color: var(--novel-accent);
}

.novel-type-tabs a.is-active {
    border-color: var(--novel-accent);
    background: var(--novel-accent);
    color: #fff;
}

.novel-type-tabs svg {
    width: 18px;
    height: 18px;
}

.novel-type-tabs span {
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    font-size: 0.8em;
}

.novel-type-tabs a.is-active span {
    background: rgba(255, 255, 255, 0.22);
}

.novel-archive__hero {
    --hero-surface: #fff;
    --hero-muted: #56627a;
    --hero-on: #fff;
    position: relative;
    margin-bottom: 20px;
    padding: 28px 32px;
    border: 1px solid var(--novel-line);
    border-radius: 10px;
    background:
        radial-gradient(120% 160% at 0% 0%, var(--novel-accent-soft), transparent 60%),
        var(--hero-surface);
}

.novel-archive__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--novel-accent);
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.novel-archive__eyebrow svg {
    width: 16px;
    height: 16px;
}

.novel-archive__title {
    margin: 8px 0 6px;
    color: var(--novel-ink);
    font-size: 2em;
    line-height: 1.25;
}

.novel-archive__desc {
    max-width: 720px;
    margin: 0 0 12px;
    color: var(--hero-muted, #56627a);
    line-height: 1.7;
}

.novel-archive__count {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--novel-accent-soft);
    color: var(--novel-accent);
    font-size: 0.85em;
    font-weight: 700;
}

.novel-archive__hero--band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.novel-archive__hero-copy {
    flex: 1;
    min-width: 0;
}

.novel-archive__hero--banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
    align-items: stretch;
    gap: 0;
    min-height: 150px;
    padding: 0;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--novel-accent) 18%, var(--novel-line));
    background: var(--hero-surface);
    color: var(--novel-ink);
}

.novel-archive__hero--banner::before {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: 44%;
    background:
        radial-gradient(circle at 18% 30%, rgba(255, 255, 255, 0.35), transparent 28%),
        linear-gradient(135deg, var(--novel-accent), color-mix(in srgb, var(--novel-accent) 45%, #10233f));
    clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%);
}

.novel-archive__hero--banner::after {
    content: "";
    position: absolute;
    inset: 18px 38% auto auto;
    width: 72px;
    height: 72px;
    border: 1px solid color-mix(in srgb, var(--novel-accent) 18%, #fff);
    border-radius: 50%;
    opacity: 0.35;
}

.novel-archive__hero--banner .novel-archive__eyebrow {
    position: relative;
    z-index: 1;
    padding: 0;
    background: none;
    color: var(--novel-accent);
}

.novel-archive__hero--banner .novel-archive__hero-copy {
    position: relative;
    z-index: 1;
    padding: 28px 32px 30px;
}

.novel-archive__hero--banner .novel-archive__title {
    max-width: 660px;
    margin: 10px 0 0;
    color: var(--novel-ink);
    font-size: 2.15em;
}

.novel-archive__hero--banner .novel-archive__desc {
    margin: 10px 0 0;
    color: var(--hero-muted);
}

.novel-archive__hero--band .novel-archive__count {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0;
    border-radius: 0;
    background: none;
    line-height: 1.1;
}

.novel-archive__hero--banner .novel-archive__count {
    position: relative;
    z-index: 1;
    display: flex;
    align-self: stretch;
    justify-self: stretch;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0;
    padding: 22px 22px 20px 34px;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--hero-on);
    text-align: center;
    line-height: 1;
}

.novel-archive__hero--banner .novel-archive__count strong {
    font-size: 3.35em;
    font-weight: 700;
    letter-spacing: -0.05em;
}

.novel-archive__hero--band .novel-archive__count strong {
    font-size: 1.7em;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.novel-archive__hero--banner .novel-archive__count span {
    font-size: 0.74em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.86;
}

.novel-archive__hero--band .novel-archive__count span {
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.novel-archive__hero--band {
    padding: 20px 24px 20px 22px;
    border: 1px solid var(--novel-line);
    border-left: 4px solid var(--novel-accent);
    border-radius: 10px;
    background: #fff;
}

.novel-archive__hero--band .novel-archive__title {
    margin: 2px 0 0;
    font-size: 1.65em;
}

.novel-archive__hero--band .novel-archive__desc {
    margin: 6px 0 0;
}

.novel-archive__hero--band .novel-archive__count {
    align-items: flex-end;
    color: var(--novel-accent);
}

.novel-archive__hero--band .novel-archive__count span {
    color: var(--novel-sub);
}

.novel-archive__hero--plain {
    margin-bottom: 18px;
    padding: 2px 0 0;
    border: 0;
    border-radius: 0;
    background: none;
}

.novel-archive__hero--plain .novel-archive__eyebrow {
    display: flex;
    margin-bottom: 6px;
    gap: 5px;
    color: var(--novel-sub);
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.novel-archive__hero--plain .novel-archive__eyebrow svg {
    display: none;
}

.novel-archive__hero--plain .novel-archive__hero-line {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 6px;
}

.novel-archive__hero--plain .novel-archive__title {
    position: relative;
    width: auto;
    margin: 0;
    padding-bottom: 8px;
    font-size: 2em;
}

.novel-archive__hero--plain .novel-archive__title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    border-radius: 99px;
    background: var(--novel-accent);
}

.novel-archive__hero--plain .novel-archive__desc {
    max-width: 620px;
    margin: 8px 0 0;
    color: var(--novel-sub);
    font-size: 0.95em;
}

.novel-archive__filters {
    margin-bottom: 18px;
}

.novel-archive__filter-toggle {
    display: none;
}

.novel-archive__bar {
    --filter-surface: #fff;
    --filter-track: #f0f3f8;
    --filter-chip: #56627a;
    --filter-on: #fff;
    --filter-icon-bg: color-mix(in srgb, var(--novel-accent) 12%, var(--filter-surface));
    --filter-badge: color-mix(in srgb, var(--novel-accent) 14%, var(--filter-surface));
    --novel-accent-soft: color-mix(in srgb, var(--novel-accent) 12%, var(--filter-surface));
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0;
}

.novel-archive__bar,
.novel-archive__chips,
.novel-archive__sort,
.novel-archive__chips a,
.novel-archive__sort a,
.novel-archive__field,
.novel-archive__field select,
.novel-archive__panel {
    box-sizing: border-box;
}

.novel-archive__chips,
.novel-archive__sort {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.novel-archive__chips::-webkit-scrollbar,
.novel-archive__sort::-webkit-scrollbar {
    display: none;
}

.novel-archive__chips a {
    flex: none;
    padding: 6px 14px;
    border: 1px solid var(--novel-line);
    border-radius: 999px;
    background: var(--filter-surface);
    color: var(--filter-chip);
    font-size: 0.88em;
    font-weight: 600;
}

.novel-archive__chips a:hover {
    border-color: var(--novel-accent);
    color: var(--novel-accent);
}

.novel-archive__chips a.is-active {
    border-color: var(--novel-accent);
    background: var(--novel-accent);
    color: var(--filter-on);
}

.novel-archive__sort {
    padding: 3px;
    border-radius: 8px;
    background: var(--filter-track);
}

.novel-archive__sort a {
    flex: none;
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--novel-sub);
    font-size: 0.85em;
    font-weight: 600;
}

.novel-archive__sort a:hover {
    color: var(--novel-ink);
}

.novel-archive__sort a.is-active {
    background: var(--filter-surface);
    color: var(--novel-ink);
    box-shadow: 0 1px 4px rgba(26, 39, 68, 0.12);
}

.novel-archive__label {
    color: var(--novel-sub);
    font-size: 0.75em;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.novel-archive__bar--stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr);
    align-items: center;
    gap: 0;
    padding: 14px 18px;
    border: 1px solid color-mix(in srgb, var(--novel-accent) 8%, var(--novel-line));
    border-radius: 16px;
    background: color-mix(in srgb, var(--novel-accent) 8%, var(--filter-surface));
    box-shadow: 0 10px 26px rgba(26, 39, 68, 0.06);
}

.novel-archive__group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.novel-archive__bar--stack .novel-archive__group + .novel-archive__group {
    padding-left: 18px;
    border-left: 1px solid var(--novel-line);
}

.novel-archive__group-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--filter-icon-bg);
    color: var(--novel-accent);
}

.novel-archive__group-icon svg {
    width: 17px;
    height: 17px;
}

.novel-archive__group .novel-archive__label {
    flex: none;
    width: auto;
    min-width: 76px;
    color: var(--novel-ink);
    font-size: 0.76em;
    letter-spacing: 0.08em;
}

.novel-archive__bar--stack .novel-archive__chips,
.novel-archive__bar--stack .novel-archive__sort {
    flex: 1 1 auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
}

.novel-archive__bar--stack .novel-archive__chips,
.novel-archive__bar--stack .novel-archive__sort {
    gap: 8px;
}

.novel-archive__bar--stack .novel-archive__chips a,
.novel-archive__bar--stack .novel-archive__sort a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 16px;
    border: 1px solid var(--novel-line);
    border-radius: 999px;
    background: var(--filter-surface);
    color: var(--novel-sub);
    font-size: 0.84em;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 2px 9px rgba(26, 39, 68, 0.04);
}

.novel-archive__bar--stack .novel-archive__chips a svg,
.novel-archive__bar--stack .novel-archive__sort a svg {
    flex: none;
    width: 15px;
    height: 15px;
}

.novel-archive__bar--stack .novel-archive__chips a:hover,
.novel-archive__bar--stack .novel-archive__sort a:hover {
    border-color: var(--novel-accent);
    color: var(--novel-accent);
}

.novel-archive__bar--stack .novel-archive__chips a.is-active,
.novel-archive__bar--stack .novel-archive__sort a.is-active {
    border-color: var(--novel-accent);
    background: var(--novel-accent);
    color: var(--filter-on);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--novel-accent) 24%, transparent);
}

.novel-archive__bar--line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    align-items: end;
    gap: 0;
    padding: 0;
    border-bottom: 0;
}

.novel-archive__line-group {
    min-width: 0;
    padding: 0 18px 0 0;
}

.novel-archive__line-group--sort {
    padding: 0 0 0 18px;
    border-left: 1px solid var(--novel-line);
}

.novel-archive__bar--line .novel-archive__label {
    display: block;
    margin: 0 0 8px;
    font-size: 0.68em;
    letter-spacing: 0.18em;
}

.novel-archive__bar--line .novel-archive__chips,
.novel-archive__bar--line .novel-archive__sort {
    display: grid;
    width: 100%;
    padding: 0;
    gap: 0;
    border-bottom: 1px solid var(--novel-line);
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.novel-archive__bar--line .novel-archive__chips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.novel-archive__bar--line .novel-archive__sort {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.novel-archive__bar--line .novel-archive__chips a,
.novel-archive__bar--line .novel-archive__sort a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    margin-bottom: -1px;
    padding: 8px 10px 11px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--novel-sub);
    font-size: 0.8em;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
    box-shadow: none;
}

.novel-archive__bar--line .novel-archive__chips a svg,
.novel-archive__bar--line .novel-archive__sort a svg {
    flex: none;
    width: 16px;
    height: 16px;
}

.novel-archive__bar--line .novel-archive__chips a:hover,
.novel-archive__bar--line .novel-archive__sort a:hover {
    color: var(--novel-accent);
}

.novel-archive__bar--line .novel-archive__chips a.is-active,
.novel-archive__bar--line .novel-archive__sort a.is-active {
    border-bottom-color: var(--novel-accent);
    background: transparent;
    color: var(--novel-accent);
    box-shadow: none;
}

.novel-archive__bar--select {
    gap: 10px;
}

.novel-archive__field {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 8px;
    min-width: 220px;
}

.novel-archive__field span {
    flex: none;
    color: var(--novel-sub);
    font-size: 0.82em;
    font-weight: 500;
}

.novel-archive__field select {
    width: 100%;
    height: 38px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--novel-line);
    border-radius: 8px;
    background: var(--filter-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2356627a' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E") no-repeat right 12px center;
    color: var(--novel-ink);
    font: inherit;
    font-size: 0.9em;
    font-weight: 600;
    appearance: none;
}

.novel-archive__field select:hover,
.novel-archive__field select:focus {
    border-color: var(--novel-accent);
    outline: none;
}

.novel-archive__bar--cards-select {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--novel-line);
    border-radius: 16px;
    background: var(--filter-surface);
    box-shadow: 0 10px 26px rgba(26, 39, 68, 0.05);
}

.novel-archive__select-card {
    position: relative;
    border: 1px solid var(--novel-line);
    border-radius: 12px;
    background: var(--filter-surface);
    color: var(--novel-ink);
}

.novel-archive__select-card summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(110px, auto) auto;
    align-items: center;
    gap: 14px;
    min-height: 48px;
    padding: 0 16px;
    cursor: pointer;
    list-style: none;
}

.novel-archive__select-card summary::-webkit-details-marker {
    display: none;
}

.novel-archive__select-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    color: var(--novel-accent);
}

.novel-archive__select-icon svg {
    width: 22px;
    height: 22px;
}

.novel-archive__select-label {
    min-width: 0;
    font-size: 0.98em;
    font-weight: 700;
}

.novel-archive__select-value {
    min-width: 0;
    font-size: 0.98em;
    font-weight: 500;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.novel-archive__select-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--novel-accent);
    transition: transform 0.15s;
}

.novel-archive__select-chevron svg {
    width: 14px;
    height: 9px;
}

.novel-archive__select-card[open] .novel-archive__select-chevron {
    transform: rotate(180deg);
}

.novel-archive__select-card:focus-within {
    border-color: var(--novel-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--novel-accent) 12%, transparent);
}

.novel-archive__select-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    right: 12px;
    min-width: 180px;
    padding: 6px;
    border: 1px solid var(--novel-line);
    border-radius: 12px;
    background: var(--filter-surface);
    box-shadow: 0 14px 30px rgba(26, 39, 68, 0.14);
}

.novel-archive__select-menu a {
    display: block;
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--novel-ink);
    font-size: 0.9em;
    font-weight: 500;
    text-align: left;
}

.novel-archive__select-menu a:hover,
.novel-archive__select-menu a.is-active {
    background: color-mix(in srgb, var(--novel-accent) 9%, var(--filter-surface));
    color: var(--novel-accent);
    box-shadow: inset 0 0 0 1px var(--novel-accent);
}

.novel-archive__bar--board {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1.18fr);
    align-items: end;
    gap: 0;
}

.novel-archive__panel {
    min-width: 0;
    padding: 0 18px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.novel-archive__bar--board .novel-archive__panel + .novel-archive__panel {
    padding: 0 0 0 18px;
    border-left: 1px solid var(--novel-line);
}

.novel-archive__panel .novel-archive__label {
    display: block;
    margin-bottom: 9px;
    font-size: 0.68em;
    letter-spacing: 0.18em;
}

.novel-archive__bar--board .novel-archive__chips,
.novel-archive__bar--board .novel-archive__sort {
    display: grid;
    width: 100%;
    gap: 12px;
    overflow: visible;
}

.novel-archive__bar--board .novel-archive__chips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.novel-archive__bar--board .novel-archive__sort {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.novel-archive__bar--board .novel-archive__sort {
    padding: 0;
    border-radius: 0;
    background: transparent;
}

.novel-archive__bar--board .novel-archive__chips a,
.novel-archive__bar--board .novel-archive__sort a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 44px;
    padding: 10px;
    border: 1px solid var(--novel-line);
    border-radius: 8px;
    background: var(--filter-surface);
    color: var(--novel-ink);
    font-size: 0.84em;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(26, 39, 68, 0.04);
    transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

.novel-archive__button-main {
    display: inline-flex;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
    gap: 7px;
}

.novel-archive__button-main svg {
    flex: none;
    width: 16px;
    height: 16px;
    color: var(--novel-sub);
}

.novel-archive__button-main span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.novel-archive__badge {
    flex: none;
    min-width: 22px;
    padding: 2px 5px;
    border-radius: 999px;
    background: var(--filter-badge);
    color: var(--novel-accent);
    font-size: 0.76em;
    font-weight: 700;
    text-align: center;
}

.novel-archive__bar--board .novel-archive__chips a:hover,
.novel-archive__bar--board .novel-archive__sort a:hover {
    border-color: var(--novel-accent);
    color: var(--novel-accent);
    box-shadow: 0 4px 14px rgba(26, 39, 68, 0.08);
}

.novel-archive__bar--board .novel-archive__chips a:hover .novel-archive__button-main svg,
.novel-archive__bar--board .novel-archive__sort a:hover .novel-archive__button-main svg {
    color: var(--novel-accent);
}

.novel-archive__bar--board .novel-archive__chips a.is-active,
.novel-archive__bar--board .novel-archive__sort a.is-active {
    border-color: var(--novel-accent);
    background: color-mix(in srgb, var(--novel-accent) 9%, var(--filter-surface));
    color: var(--novel-ink);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--novel-accent) 15%, transparent), 0 4px 14px rgba(26, 39, 68, 0.07);
}

.novel-archive__bar--board .novel-archive__chips a.is-active .novel-archive__button-main svg,
.novel-archive__bar--board .novel-archive__sort a.is-active .novel-archive__button-main svg {
    color: var(--novel-accent);
}

.novel-archive__bar--finder {
    display: block;
    overflow: visible;
    border: 1px solid var(--novel-line);
    border-radius: 12px;
    background: var(--filter-surface);
    box-shadow: 0 12px 28px rgba(15, 41, 82, 0.05);
}

.novel-archive__finder-status,
.novel-archive__finder-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.novel-archive__finder-status {
    padding: 12px 14px;
    border-bottom: 1px solid var(--novel-line);
}

.novel-archive__finder-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 4px;
    color: var(--novel-ink);
    font-size: 0.88rem;
    font-weight: 700;
}

.novel-archive__finder-label svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    color: var(--novel-accent);
}

.novel-archive__finder-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--novel-line);
    border-radius: 8px;
    background: var(--filter-track);
    color: var(--filter-chip);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.3;
}

.novel-archive__finder-chip span {
    color: var(--novel-sub);
    font-size: 0.74rem;
    font-weight: 600;
}

.novel-archive__finder-chip:hover,
.novel-archive__finder-chip.is-active {
    border-color: var(--novel-accent);
    background: color-mix(in srgb, var(--novel-accent) 10%, var(--filter-surface));
    color: var(--novel-accent);
}

.novel-archive__finder-chip.is-active span {
    color: inherit;
}

.novel-archive__finder-reset {
    margin-left: auto;
    color: #e35d6a;
    font-size: 0.84rem;
    font-weight: 600;
}

.novel-archive__finder-toolbar {
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
}

.novel-archive__finder-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.novel-archive__finder-tabs a {
    padding: 6px 16px;
    border: 1px solid var(--novel-line);
    border-radius: 8px;
    background: var(--filter-surface);
    color: var(--novel-ink);
    font-size: 0.88rem;
    font-weight: 600;
}

.novel-archive__finder-tabs a.is-active {
    border-color: var(--novel-accent);
    background: var(--novel-accent);
    color: var(--filter-on);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--novel-accent) 28%, transparent);
}

.novel-archive__finder-sort {
    position: relative;
    flex: none;
}

.novel-archive__finder-sort summary {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--novel-line);
    border-radius: 8px;
    background: var(--filter-surface);
    color: var(--novel-sub);
    font-size: 0.86rem;
    font-weight: 500;
    list-style: none;
    cursor: pointer;
}

.novel-archive__finder-sort summary::-webkit-details-marker {
    display: none;
}

.novel-archive__finder-sort summary strong {
    color: var(--novel-ink);
    font-weight: 700;
}

.novel-archive__finder-sort summary svg {
    width: 12px;
    height: 8px;
    fill: none;
    stroke: var(--novel-accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.novel-archive__finder-sort[open] summary svg {
    transform: rotate(180deg);
}

.novel-archive__finder-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    padding: 6px;
    border: 1px solid var(--novel-line);
    border-radius: 10px;
    background: var(--filter-surface);
    box-shadow: 0 14px 30px rgba(26, 39, 68, 0.14);
}

.novel-archive__finder-menu a {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--novel-ink);
    font-size: 0.9em;
    font-weight: 600;
    text-align: left;
}

.novel-archive__finder-menu a:hover,
.novel-archive__finder-menu a.is-active {
    background: color-mix(in srgb, var(--novel-accent) 9%, var(--filter-surface));
    color: var(--novel-accent);
    box-shadow: inset 0 0 0 1px var(--novel-accent);
}

@media (max-width: 849px) {
    .novel-archive__finder-status {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 10px 28px 10px 12px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
        mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    }

    .novel-archive__finder-status::-webkit-scrollbar {
        display: none;
    }

    .novel-archive__finder-status > * {
        flex: none;
        white-space: nowrap;
    }

    .novel-archive__finder-toolbar {
        padding: 10px 12px;
    }
}

@media (max-width: 640px) {
    .novel-archive__finder-tabs a {
        padding: 6px 14px;
        font-size: 0.82rem;
    }
}

@media (max-width: 480px) {
    .novel-archive__finder-label {
        font-size: 0.82rem;
    }

    .novel-archive__finder-chip {
        padding: 4px 10px;
        font-size: 0.8rem;
    }

    .novel-archive__finder-toolbar {
        flex-wrap: nowrap;
        gap: 8px;
    }

    .novel-archive__finder-tabs {
        flex: 1 1 auto;
        flex-wrap: nowrap;
        gap: 6px;
        min-width: 0;
    }

    .novel-archive__finder-tabs a {
        flex: none;
        padding: 6px 10px;
        white-space: nowrap;
    }

    .novel-archive__finder-sort {
        flex: none;
        margin-left: auto;
    }

    .novel-archive__finder-sort summary {
        min-height: 32px;
        padding-left: 8px;
        font-size: 0.8rem;
    }

    .novel-archive__finder-sort summary strong {
        display: none;
    }
}

@media (max-width: 360px) {
    .novel-archive__finder-tabs {
        gap: 4px;
    }

    .novel-archive__finder-tabs a,
    .novel-archive__finder-sort summary {
        padding-right: 8px;
        padding-left: 8px;
        font-size: 0.75rem;
    }
}

.novel-archive__grid {
    display: grid;
    grid-template-columns: repeat(var(--cols-xl, 2), minmax(0, 1fr));
    gap: 14px;
}

.novel-tile {
    display: flex;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--novel-line);
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.novel-tile:hover {
    border-color: #d3dcec;
    box-shadow: 0 8px 24px rgba(26, 39, 68, 0.08);
}

.novel-tile__cover {
    position: relative;
    flex: none;
    width: 112px;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    background: #eef2f8;
    overflow: hidden;
}

.novel-tile__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.novel-tile:hover .novel-tile__cover img {
    transform: scale(1.04);
}

.novel-tile__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--novel-accent);
    font-size: 2.2em;
    font-weight: 800;
}

.novel-tile__hot {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 1px 7px;
    border-radius: 4px;
    background: #e5484d;
    color: #fff;
    font-size: 0.68em;
    font-weight: 800;
}

.novel-tile__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.novel-tile__title {
    margin: 0;
    font-size: 1.05em;
    line-height: 1.35;
}

.novel-tile__title a {
    display: -webkit-box;
    overflow: hidden;
    color: var(--novel-ink);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.novel-archive__grid.has-title-color .novel-tile__title a,
.novel-archive__grid.has-title-color .novel-tile__title a:hover {
    color: var(--comics-title-color);
}

.novel-archive__grid.has-item-bg .novel-tile,
.novel-archive__grid.has-item-bg .comic-card-9.comic-item {
    background: var(--comic-item-bg);
}

.novel-tile__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    font-size: 0.82em;
}

.novel-tile__author {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    color: var(--novel-sub);
}

.novel-tile__author svg {
    flex: none;
    width: 14px;
    height: 14px;
}

.novel-tile__status {
    padding: 1px 8px;
    border-radius: 4px;
    background: #f0f3f8;
    color: var(--novel-sub);
    font-size: 0.92em;
    font-weight: 700;
}

.novel-tile__status.is-1 {
    background: #eef1ff ;
    color: #4655d4 ;
}

.novel-tile__status.is-2 {
    background: #e8f5ee;
    color: #1f8a4c;
}

.novel-tile__excerpt {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #56627a;
    font-size: 0.86em;
    line-height: 1.6;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.novel-tile__genres {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.novel-tile__genres a {
    padding: 1px 8px;
    border: 1px solid var(--novel-line);
    border-radius: 4px;
    color: var(--novel-sub);
    font-size: 0.75em;
}

.novel-tile__genres a:hover {
    border-color: var(--novel-accent);
    color: var(--novel-accent);
}

.novel-tile__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px dashed var(--novel-line);
    font-size: 0.8em;
}

.novel-tile__chapters {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: none;
    color: var(--novel-sub);
    font-weight: 600;
}

.novel-tile__chapters svg {
    width: 14px;
    height: 14px;
}

.novel-tile__latest {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    color: var(--novel-accent);
    font-weight: 700;
    white-space: nowrap;
}

.novel-tile__latest time {
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--novel-sub);
    font-weight: 400;
}

.novel-tile__side {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    min-width: 88px;
    margin-left: auto;
    text-align: right;
}

.novel-tile__stats {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: var(--novel-sub);
    font-size: 0.78em;
}

.novel-tile__stats strong {
    color: var(--novel-ink);
    font-size: 1.15em;
    font-weight: 800;
    line-height: 1.2;
}

.novel-tile__read {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 8px;
    background: var(--novel-accent);
    color: #fff;
    font-size: 0.8em;
    font-weight: 700;
    white-space: nowrap;
}

.novel-tile__read:hover {
    color: #fff;
    filter: brightness(1.05);
}

.novel-tile.is-plain {
    padding-left: 16px;
}

.novel-archive__pagination {
    margin-top: 24px;
}

.novel-archive__pagination ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.novel-archive__pagination li {
    margin: 0;
}

.novel-archive__pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--novel-line);
    border-radius: 8px;
    background: #fff;
    color: var(--novel-ink);
    font-weight: 600;
}

.novel-archive__pagination a.page-numbers:hover {
    border-color: var(--novel-accent);
    color: var(--novel-accent);
}

.novel-archive__pagination .page-numbers.current {
    border-color: var(--novel-accent);
    background: var(--novel-accent);
    color: #fff;
}

.novel-archive__pagination .page-numbers.dots {
    border: 0;
    background: transparent;
}

.novel-archive__empty {
    padding: 48px 20px;
    border: 1px dashed var(--novel-line);
    border-radius: 10px;
    color: var(--novel-sub);
    text-align: center;
}

@media (max-width: 849px) {
    .novel-archive__grid {
        grid-template-columns: repeat(var(--cols-md, 1), minmax(0, 1fr));
    }
}

@media (max-width: 549px) {
    .novel-archive__grid {
        grid-template-columns: repeat(var(--cols-xs, 1), minmax(0, 1fr));
    }
}

@media (max-width: 849px) {
    .novel-archive__filters {
        border: 1px solid var(--novel-line, #e6edf7);
        border-radius: 14px;
        background: var(--filter-surface, #fff);
        box-shadow: 0 10px 24px rgba(15, 41, 82, 0.05);
        overflow: hidden;
    }

    .novel-archive__filter-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        min-height: 0;
        margin: 0;
        padding: 12px 14px;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        color: var(--novel-ink, #17233d);
        font-size: 0.95rem;
        font-weight: 700;
        line-height: 1.3;
        text-align: left;
        text-transform: none;
        cursor: pointer;
    }

    .novel-archive__filter-toggle span {
        flex: 1;
    }

    .novel-archive__filter-toggle strong {
        min-width: 20px;
        padding: 1px 7px;
        border-radius: 999px;
        background: var(--novel-accent, var(--fs-color-primary));
        color: #fff;
        font-size: 0.72rem;
        text-align: center;
    }

    .novel-archive__filter-toggle i {
        flex: none;
        width: 7px;
        height: 7px;
        margin-right: 3px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        opacity: 0.55;
        transform: translateY(-2px) rotate(45deg);
        transition: transform 0.2s ease;
    }

    .novel-archive__filters.is-open .novel-archive__filter-toggle {
        border-bottom: 1px solid var(--novel-line, #e6edf7);
    }

    .novel-archive__filters.is-open .novel-archive__filter-toggle i {
        transform: translateY(2px) rotate(-135deg);
    }

    .novel-archive__filter-panel {
        display: none;
        padding: 12px 14px 14px;
    }

    .novel-archive__filters.is-open .novel-archive__filter-panel {
        display: block;
    }

    .novel-archive__filter-panel .novel-archive__bar {
        margin-bottom: 0;
    }
}

@media (max-width: 600px) {
    .novel-archive__hero {
        padding: 20px 18px;
    }

    .novel-archive__hero--plain {
        padding: 0;
    }

    .novel-archive__hero--band {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .novel-archive__hero--banner {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 12px;
        padding: 22px 18px 18px;
        background:
            linear-gradient(135deg, var(--novel-accent), color-mix(in srgb, var(--novel-accent) 48%, #10233f));
    }

    .novel-archive__hero--banner::before,
    .novel-archive__hero--banner::after {
        display: none;
    }

    .novel-archive__hero--banner .novel-archive__hero-copy {
        padding: 0;
    }

    .novel-archive__hero--banner .novel-archive__eyebrow,
    .novel-archive__hero--banner .novel-archive__title {
        color: #fff;
    }

    .novel-archive__hero--banner .novel-archive__desc {
        color: rgba(255, 255, 255, 0.82);
    }

    .novel-archive__hero--banner .novel-archive__count {
        padding: 0;
        align-items: flex-start;
    }

    .novel-archive__hero--banner .novel-archive__count strong {
        font-size: 2.8em;
    }

    .novel-archive__hero--band {
        padding: 16px 16px 16px 14px;
    }

    .novel-archive__hero--band .novel-archive__count {
        align-items: flex-start;
    }

    .novel-archive__title {
        font-size: 1.5em;
    }

    .novel-archive__chips,
    .novel-archive__sort {
        width: 100%;
        flex-wrap: wrap;
        overflow: visible;
    }

    .novel-archive__chips a,
    .novel-archive__sort a {
        text-align: center;
        white-space: nowrap;
    }

    .novel-archive__chips a {
        flex: 1 1 auto;
        padding-right: 8px;
        padding-left: 8px;
    }

    .novel-archive__sort {
        flex-wrap: wrap;
    }

    .novel-archive__sort a {
        flex: 1 1 calc(50% - 6px);
        padding-right: 8px;
        padding-left: 8px;
    }

    .novel-archive__group {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .novel-archive__group .novel-archive__label {
        width: auto;
    }

    .novel-archive__bar--stack .novel-archive__chips,
    .novel-archive__bar--stack .novel-archive__sort {
        flex-wrap: wrap;
        overflow: visible;
    }

    .novel-archive__bar--stack {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 14px;
        border-radius: 14px;
    }

    .novel-archive__bar--stack .novel-archive__group,
    .novel-archive__bar--stack .novel-archive__group + .novel-archive__group {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        padding: 0;
        border-left: 0;
    }

    .novel-archive__bar--stack .novel-archive__group-icon {
        width: 32px;
        height: 32px;
    }

    .novel-archive__bar--stack .novel-archive__label {
        min-width: 0;
    }

    .novel-archive__bar--stack .novel-archive__chips,
    .novel-archive__bar--stack .novel-archive__sort {
        grid-column: 1 / -1;
        display: grid;
        gap: 8px;
    }

    .novel-archive__bar--stack .novel-archive__chips {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .novel-archive__bar--stack .novel-archive__sort {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .novel-archive__bar--stack .novel-archive__chips a,
    .novel-archive__bar--stack .novel-archive__sort a {
        padding-right: 10px;
        padding-left: 10px;
    }

    .novel-archive__bar--stack .novel-archive__sort a {
        flex: 1 1 calc(50% - 6px);
    }

    .novel-archive__bar--line {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .novel-archive__line-group,
    .novel-archive__line-group--sort {
        padding: 0;
        border-left: 0;
    }

    .novel-archive__bar--line .novel-archive__chips {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .novel-archive__bar--line .novel-archive__sort {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .novel-archive__bar--line .novel-archive__chips a,
    .novel-archive__bar--line .novel-archive__sort a {
        min-height: 42px;
        padding: 8px 6px 10px;
    }

    .novel-archive__bar--line .novel-archive__chips a {
        gap: 5px;
        font-size: 0.78em;
    }

    .novel-archive__field {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        min-width: 0;
    }

    .novel-archive__bar--cards-select {
        padding: 12px;
        border-radius: 12px;
    }

    .novel-archive__select-card {
        border-radius: 10px;
    }

    .novel-archive__select-card summary {
        grid-template-columns: auto minmax(0, 0.9fr) minmax(92px, 1fr) auto;
        gap: 10px;
        min-height: 40px;
        padding: 0 12px;
    }

    .novel-archive__select-icon {
        width: 24px;
        height: 24px;
    }

    .novel-archive__select-icon svg {
        width: 20px;
        height: 20px;
    }

    .novel-archive__select-label,
    .novel-archive__select-value {
        font-size: 0.92em;
    }

    .novel-archive__select-menu {
        right: 8px;
        min-width: 160px;
    }

    .novel-archive__bar--board {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .novel-archive__bar--board .novel-archive__panel,
    .novel-archive__bar--board .novel-archive__panel + .novel-archive__panel {
        padding: 0;
        border-left: 0;
    }

    .novel-archive__bar--board .novel-archive__chips {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .novel-archive__bar--board .novel-archive__sort {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .novel-archive__bar--board .novel-archive__chips a,
    .novel-archive__bar--board .novel-archive__sort a {
        min-height: 42px;
        padding: 9px 10px;
    }

    .novel-archive__bar--board .novel-archive__sort a {
        justify-content: center;
        text-align: center;
    }

    .novel-archive__bar--board .novel-archive__sort .novel-archive__button-main {
        justify-content: center;
    }

    .novel-type-tabs a {
        flex: 1;
        justify-content: center;
        padding: 8px 10px;
        font-size: 0.9em;
    }

    .novel-tile {
        gap: 12px;
        padding: 12px;
    }

    .novel-tile__cover {
        width: 84px;
    }

    .novel-tile__excerpt,
    .novel-tile__genres {
        display: none;
    }

    .novel-tile__foot {
        flex-wrap: wrap;
        gap: 4px 10px;
    }

    .novel-tile.has-side {
        flex-wrap: wrap;
    }

    .novel-tile__side {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-width: 0;
        margin-left: 0;
        padding-top: 4px;
        text-align: left;
    }
}

/* ---------- Danh sách chương: Mục lục ---------- */

.novel-toc--feed {
    --feed-accent: var(--primary-color);
    --feed-ink: var(--novel-ink);
    --feed-muted: var(--novel-sub);
    --feed-line: var(--novel-line);
    --feed-surface: var(--fs-color-alert);
    margin-top: 20px;
    padding: 8px 8px 12px;
    border: 1px solid color-mix(in srgb, var(--feed-accent) 18%, var(--feed-line));
    border-radius: 20px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--feed-accent) 7%, var(--feed-surface)), var(--feed-surface) 120px);
    color: var(--feed-ink);
}

.novel-feed__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 12px;
}

h2.novel-feed__title {
    margin: 0;
    color: var(--feed-ink);
    font-size: 1.15em !important;
    font-weight: 700;
}

.novel-feed__total {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--feed-accent) 12%, var(--feed-surface));
    color: var(--feed-accent);
    font-size: 0.82em;
    font-weight: 700;
    white-space: nowrap;
}

.novel-feed__sort {
    position: relative;
    flex: none;
    display: inline-flex;
    align-items: center;
}

.novel-toc--feed .novel-feed__sort select {
    appearance: none;
    margin: 0;
    min-height: 0;
    height: auto;
    padding: 7px 32px 7px 12px;
    border: 1px solid var(--feed-line);
    border-radius: 10px;
    background: var(--feed-surface);
    box-shadow: none;
    color: var(--feed-ink);
    font-size: 0.92em;
    line-height: 1.3;
}

.novel-feed__sort svg {
    position: absolute;
    right: 10px;
    width: 14px;
    height: 14px;
    color: var(--feed-muted);
    pointer-events: none;
}

.novel-feed__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 8px;
    margin: 0;
    list-style: none;
}

.novel-toc--feed .novel-feed__item {
    margin: 0 !important;
    padding: 0;
    list-style: none;
    min-width: 0;
}

.novel-feed__item[hidden] {
    display: none;
}

.novel-feed__item a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 0;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: color-mix(in srgb, var(--feed-accent) 4%, var(--feed-surface));
    color: inherit;
    line-height: 1.35;
    text-decoration: none;
}

.novel-feed__item.is-current a,
.novel-feed__item:hover a,
.novel-feed__item:focus-within a,
.novel-feed__item:active a {
    align-items: center;
    padding: 10px;
    border-color: color-mix(in srgb, var(--feed-accent) 22%, var(--feed-line));
    border-radius: 16px;
    background: color-mix(in srgb, var(--feed-accent) 10%, var(--feed-surface));
}

.novel-feed__mark {
    flex: none;
    display: grid;
}

.novel-feed__thumb,
.novel-feed__no {
    grid-area: 1 / 1;
}

.novel-feed__thumb {
    display: none;
    width: 52px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
}

.novel-feed__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.novel-feed__no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 6px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--feed-accent) 12%, var(--feed-surface));
    color: var(--feed-accent);
    font-size: 0.82em;
    font-weight: 700;
}

.novel-feed__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.novel-feed__kicker {
    display: none;
    color: var(--feed-accent);
    font-size: 0.75em;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.novel-feed__line {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.novel-feed__name {
    min-width: 0;
    overflow: hidden;
    color: var(--feed-ink);
    font-weight: 600;
    font-size: 0.98em;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.novel-feed__badge {
    flex: none;
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--feed-accent) 14%, var(--feed-surface));
    color: var(--feed-accent);
    font-size: 0.72em;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}

.novel-feed__aside {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--feed-muted);
    font-size: 0.8em;
    white-space: nowrap;
}

.novel-feed__meta::before {
    content: "·";
    margin-right: 8px;
}

.novel-feed__read,
.novel-feed__chevron {
    flex: none;
}

.novel-feed__read {
    display: none;
    align-items: center;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--feed-accent);
    color: var(--fs-color-alert);
    font-size: 0.9em;
    font-weight: 700;
    line-height: 1.2;
}

.novel-feed__chevron {
    display: inline-flex;
    color: var(--feed-accent);
}

.novel-feed__chevron svg {
    width: 18px;
    height: 18px;
}

.novel-feed__item.is-current .novel-feed__thumb,
.novel-feed__item:hover .novel-feed__thumb,
.novel-feed__item:focus-within .novel-feed__thumb,
.novel-feed__item:active .novel-feed__thumb {
    display: block;
}

.novel-feed__item.is-current:has(.novel-feed__thumb) .novel-feed__no,
.novel-feed__item:hover:has(.novel-feed__thumb) .novel-feed__no,
.novel-feed__item:focus-within:has(.novel-feed__thumb) .novel-feed__no,
.novel-feed__item:active:has(.novel-feed__thumb) .novel-feed__no,
.novel-feed__item.is-current .novel-feed__chevron,
.novel-feed__item:hover .novel-feed__chevron,
.novel-feed__item:focus-within .novel-feed__chevron,
.novel-feed__item:active .novel-feed__chevron {
    display: none;
}

.novel-feed__item.is-current .novel-feed__body,
.novel-feed__item:hover .novel-feed__body,
.novel-feed__item:focus-within .novel-feed__body,
.novel-feed__item:active .novel-feed__body {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
}

.novel-feed__item.is-current .novel-feed__kicker,
.novel-feed__item.is-current .novel-feed__read,
.novel-feed__item:hover .novel-feed__read,
.novel-feed__item:focus-within .novel-feed__read,
.novel-feed__item:active .novel-feed__read {
    display: inline-flex;
}

.novel-feed__item.is-current .novel-feed__badge,
.novel-feed__item:hover .novel-feed__badge,
.novel-feed__item:focus-within .novel-feed__badge,
.novel-feed__item:active .novel-feed__badge {
    display: none;
}

.novel-feed__item.is-current .novel-feed__name,
.novel-feed__item:hover .novel-feed__name,
.novel-feed__item:focus-within .novel-feed__name,
.novel-feed__item:active .novel-feed__name {
    flex: none;
    font-size: 1em;
    white-space: normal;
}

button.novel-feed__more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 0;
    margin: 8px 0 0;
    padding: 12px 16px;
    border: 1px solid color-mix(in srgb, var(--feed-accent) 72%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--feed-accent) 16%, transparent);
    box-shadow: none;
    color: var(--feed-accent);
    font-size: 0.95em;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.3;
    text-transform: none;
}

button.novel-feed__more svg {
    width: 16px;
    height: 16px;
}

button.novel-feed__more[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.novel-feed__empty {
    margin: 0;
    color: var(--feed-muted);
}

@media (max-width: 849px) {
    
.novel-feed__name {
    font-weight: 500;
    font-size: 0.9em;
}
    .novel-feed__head {
        flex-wrap: wrap;
    }

    .novel-feed__total {
        margin-left: 0;
    }

    .novel-feed__sort {
        margin-left: auto;
    }

    .novel-feed__read {
        padding: 5px 10px;
        font-size: 0.8em;
    }
}

@media (max-width: 549px) {
    .novel-feed__list {
        grid-template-columns: 1fr;
    }
}

/* ---------- Danh sách chương: Dải chương ---------- */

.novel-toc--bands {
    --bands-accent: var(--primary-color);
    --bands-ink: var(--novel-ink);
    --bands-muted: var(--novel-sub);
    --bands-line: var(--novel-line);
    --bands-surface: var(--fs-color-alert);
    margin-top: 20px;
    padding: 16px 16px 14px;
    border: 1px solid color-mix(in srgb, var(--bands-accent) 14%, var(--bands-line));
    border-radius: 18px;
    background: var(--bands-surface);
    color: var(--bands-ink);
}

.novel-bands__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.novel-bands__icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--bands-accent) 12%, var(--bands-surface));
    color: var(--bands-accent);
}

.novel-bands__icon svg {
    width: 20px;
    height: 20px;
}

h2.novel-bands__title {
    flex: 1 1 auto;
    width: auto !important;
    min-width: 0;
    margin: 0;
    color: var(--bands-ink);
    font-size: 1.15em !important;
    font-weight: 700;
}

.novel-bands__sort {
    position: relative;
    flex: none;
    display: inline-flex;
    align-items: center;
    margin-left: auto;
}

.novel-toc--bands .novel-bands__sort select {
    appearance: none;
    margin: 0;
    min-height: 0;
    height: auto;
    padding: 8px 34px 8px 12px;
    border: 0;
    border-radius: 10px;
    background: color-mix(in srgb, var(--bands-accent) 6%, var(--bands-surface));
    box-shadow: none;
    color: var(--bands-ink);
    font-size: 0.9em;
    font-weight: 600;
    line-height: 1.3;
}

.novel-bands__sort svg {
    position: absolute;
    right: 10px;
    width: 16px;
    height: 16px;
    color: var(--bands-muted);
    pointer-events: none;
}

.novel-bands__ranges {
    display: flex;
    gap: 8px;
    margin: 0 0 12px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.novel-bands__ranges button {
    flex: none;
    margin: 0;
    min-height: 0;
    padding: 7px 14px;
    border: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bands-accent) 8%, var(--bands-surface));
    box-shadow: none;
    color: var(--bands-muted);
    font-size: 0.88em;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.3;
    text-transform: none;
}

.novel-bands__ranges button.is-active {
    background: var(--bands-accent);
    color: var(--fs-color-alert);
}

.novel-bands__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 4px 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.novel-toc--bands .novel-bands__item {
    margin: 0 !important;
    padding: 0;
    list-style: none;
    min-width: 0;
}

.novel-bands__list:not(.is-grid) > .novel-bands__item {
    container-type: inline-size;
}

.novel-bands__item[hidden] {
    display: none;
}

.novel-bands__item a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 0;
    margin: 0;
    padding: 9px 8px;
    border-radius: 12px;
    color: inherit;
    line-height: 1.35;
    text-decoration: none;
}

.novel-bands__item a:hover {
    background: color-mix(in srgb, var(--bands-accent) 7%, var(--bands-surface));
}

.novel-bands__item.is-latest a {
    background: color-mix(in srgb, var(--bands-accent) 10%, var(--bands-surface));
}

.novel-bands__item.is-current a {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bands-accent) 55%, var(--bands-line));
}

.novel-bands__doc {
    flex: none;
    display: inline-flex;
    color: var(--bands-muted);
}

.novel-bands__item.is-latest .novel-bands__doc {
    color: var(--bands-accent);
}

.novel-bands__doc svg,
.novel-bands__chevron svg {
    width: 16px;
    height: 16px;
}

.novel-bands__no {
    flex: none;
    color: var(--bands-ink);
    font-weight: 700;
}

.novel-bands__name {
    min-width: 0;
    overflow: hidden;
    color: var(--bands-ink);
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.novel-bands__badge {
    flex: none;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--bands-accent);
    color: var(--fs-color-alert);
    font-size: 0.68em;
    font-weight: 700;
    line-height: 1.5;
}

.novel-bands__time {
    flex: none;
    margin-left: auto;
    color: var(--bands-muted);
    font-size: 0.82em;
    white-space: nowrap;
}

.novel-bands__chevron {
    flex: none;
    display: inline-flex;
    color: var(--bands-muted);
}

.novel-bands__list.is-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.novel-bands__list.is-grid a {
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: center;
    min-height: 0;
    padding: 12px;
    background: color-mix(in srgb, var(--bands-accent) 5%, var(--bands-surface));
}

.novel-bands__list.is-grid .novel-bands__name {
    flex: 1 0 100%;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.novel-bands__list.is-grid .novel-bands__time {
    margin-left: 0;
}

.novel-bands__list.is-grid .novel-bands__chevron {
    display: none;
}

button.novel-bands__more[hidden] {
    display: none;
}

button.novel-bands__more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 0;
    margin: 12px 0 0;
    padding: 12px 16px;
    border: 0;
    border-radius: 12px;
    background: color-mix(in srgb, var(--bands-accent) 12%, var(--bands-surface));
    box-shadow: none;
    color: var(--bands-accent);
    font-size: 0.95em;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.3;
    text-transform: none;
}

button.novel-bands__more svg {
    width: 16px;
    height: 16px;
}

button.novel-bands__more[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.novel-bands__empty {
    margin: 0;
    color: var(--bands-muted);
}

@container (max-width: 340px) {
    a {
        flex-wrap: wrap;
        row-gap: 0;
    }

    .novel-bands__chevron {
        order: 4;
    }

    .novel-bands__time {
        order: 5;
        flex-basis: 100%;
        margin-left: 0;
        padding-left: 48px;
    }
}

@media (max-width: 849px) {
    .novel-bands__list.is-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 549px) {
    .novel-bands__list,
    .novel-bands__list.is-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Danh sách chương: Bảng chương ---------- */

.novel-toc--sheet {
    --sheet-accent: var(--primary-color);
    --sheet-ink: var(--novel-ink);
    --sheet-muted: var(--novel-sub);
    --sheet-line: var(--novel-line);
    --sheet-surface: var(--fs-color-alert);
    margin-top: 20px;
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--sheet-accent) 14%, var(--sheet-line));
    border-radius: 18px;
    color: var(--sheet-ink);
}

.novel-sheet__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.novel-sheet__icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--sheet-accent);
    color: var(--fs-color-alert);
}

.novel-sheet__icon svg {
    width: 20px;
    height: 20px;
}

h2.novel-sheet__title {
    margin: 0;
    color: var(--sheet-ink);
    font-size: 1.15em !important;
    font-weight: 700;
}

.novel-sheet__search {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 220px;
    margin: 0 0 0 auto;
    padding: 0 12px;
    height: 38px;
    border: 1px solid var(--sheet-line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--sheet-accent) 4%, var(--sheet-surface));
    color: var(--sheet-muted);
    font-weight: 400;
}

.novel-sheet__search svg {
    flex: none;
    width: 16px;
    height: 16px;
}

.novel-toc--sheet .novel-sheet__search input[type="search"],
.novel-toc--sheet .novel-sheet__search input[type="search"]:hover,
.novel-toc--sheet .novel-sheet__search input[type="search"]:focus {
    flex: 1;
    min-width: 0;
    width: auto;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 0;
    outline: none;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--sheet-ink);
    font-size: 0.9em;
    line-height: normal;
    -webkit-appearance: none;
    appearance: none;
}

.novel-sheet__sort {
    position: relative;
    flex: none;
    display: inline-flex;
    align-items: center;
}

.novel-toc--sheet .novel-sheet__sort select {
    appearance: none;
    margin: 0;
    min-height: 0;
    height: 38px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--sheet-line);
    border-radius: 10px;
    background: var(--sheet-surface);
    box-shadow: none;
    color: var(--sheet-ink);
    font-size: 0.9em;
    font-weight: 600;
    line-height: 1.3;
}

.novel-sheet__sort svg {
    position: absolute;
    right: 10px;
    width: 14px;
    height: 14px;
    color: var(--sheet-muted);
    pointer-events: none;
}

.novel-sheet__body {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.novel-sheet__bands {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.novel-sheet__bands button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    color: var(--sheet-ink);
    font-size: 0.88em;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.3;
    text-align: left;
    text-transform: none;
}

.novel-sheet__bands button.is-active {
    background: var(--sheet-accent);
    color: var(--fs-color-alert);
}

.novel-sheet__count {
    flex: none;
    color: var(--sheet-muted);
    font-weight: 600;
}

.novel-sheet__bands button.is-active .novel-sheet__count {
    color: var(--fs-color-alert);
}

.novel-sheet__cols,
.novel-sheet__row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 108px 72px 112px;
    align-items: center;
    gap: 8px;
}

.novel-sheet__cols {
    padding: 0 12px 8px;
    color: var(--sheet-muted);
    font-size: 0.82em;
    font-weight: 700;
}

.novel-sheet__row {
    min-height: 0;
    margin: 0 0 4px;
    padding: 10px 12px;
    border-radius: 12px;
    color: inherit;
    line-height: 1.35;
    text-decoration: none;
}

.novel-sheet__row[hidden] {
    display: none;
}

.novel-sheet__row:hover {
    background: color-mix(in srgb, var(--sheet-accent) 7%, var(--sheet-surface));
}

.novel-sheet__row.is-latest {
    background: color-mix(in srgb, var(--sheet-accent) 10%, var(--sheet-surface));
}

.novel-sheet__row.is-current {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sheet-accent) 45%, var(--sheet-line));
}

.novel-sheet__no {
    font-weight: 700;
}

.novel-sheet__name {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.novel-sheet__name span:first-child {
    min-width: 0;
    overflow: hidden;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.novel-sheet__badge {
    flex: none;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--sheet-accent);
    color: var(--fs-color-alert);
    font-size: 0.68em;
    font-weight: 700;
    line-height: 1.5;
}

.novel-sheet__meta {
    display: contents;
}

.novel-sheet__time,
.novel-sheet__words {
    color: var(--sheet-muted);
    font-size: 0.88em;
    white-space: nowrap;
}

.novel-sheet__action {
    display: grid;
    justify-items: end;
    align-items: center;
    width: 112px;
    height: 32px;
}

.novel-sheet__read,
.novel-sheet__chevron {
    grid-area: 1 / 1;
}

.novel-sheet__read {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    box-sizing: border-box;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--sheet-accent);
    color: var(--fs-color-alert);
    font-size: 0.82em;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.novel-sheet__row.is-latest .novel-sheet__read,
.novel-sheet__row:hover .novel-sheet__read,
.novel-sheet__row:focus-visible .novel-sheet__read {
    visibility: visible;
}

.novel-sheet__chevron {
    display: inline-flex;
    color: var(--sheet-muted);
}

.novel-sheet__chevron svg {
    width: 16px;
    height: 16px;
}

.novel-sheet__row.is-latest .novel-sheet__chevron,
.novel-sheet__row:hover .novel-sheet__chevron,
.novel-sheet__row:focus-visible .novel-sheet__chevron {
    visibility: hidden;
}

.novel-sheet__pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
}

.novel-sheet__pager button,
.novel-sheet__pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 0;
    height: 34px;
    margin: 0;
    padding: 0 8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    color: var(--sheet-muted);
    font-size: 0.9em;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    text-transform: none;
}

.novel-sheet__pager button.is-active {
    background: var(--sheet-accent);
    color: var(--fs-color-alert);
}

.novel-sheet__pager button:disabled {
    opacity: 0.35;
}

.novel-sheet__empty {
    margin: 12px 0 0;
    color: var(--sheet-muted);
    text-align: center;
}

@media (max-width: 1024px) {
    .novel-toc--sheet {
        padding: 14px;
    }

    .novel-sheet__body {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .novel-sheet__bands {
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .novel-sheet__bands::-webkit-scrollbar {
        display: none;
    }

    .novel-sheet__bands button {
        flex: none;
        width: auto;
        padding: 5px 10px;
        border-radius: 9px;
        font-size: 0.8em;
        font-weight: 500;
        background: color-mix(in srgb, var(--sheet-accent) 8%, var(--sheet-surface));
        white-space: nowrap;
    }
}

@media (max-width: 720px) {
    .novel-toc--sheet {
        padding: 12px;
        border-radius: 16px;
    }

    .novel-sheet__head {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "icon title sort"
            "search search search";
        gap: 10px;
    }

    .novel-sheet__icon {
        grid-area: icon;
    }

    h2.novel-sheet__title {
        grid-area: title;
        align-self: center;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .novel-sheet__sort {
        grid-area: sort;
    }

    .novel-sheet__search {
        grid-area: search;
        width: auto;
        margin: 0;
    }

    .novel-sheet__cols {
        display: none;
    }

    .novel-sheet__row {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "no name action"
            "no meta action";
        row-gap: 2px;
        padding: 10px;
    }

    .novel-sheet__no {
        grid-area: no;
        align-self: start;
        padding-top: 1px;
    }

    .novel-sheet__name {
        display: block;
        grid-area: name;
        line-height: 1.35;
    }

    .novel-sheet__name span:first-child {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    .novel-sheet__badge {
        margin-left: 6px;
        vertical-align: 1px;
    }

    .novel-sheet__meta {
        display: flex;
        grid-area: meta;
        align-items: center;
        gap: 6px;
        min-width: 0;
        color: var(--sheet-muted);
        font-size: 0.78em;
    }

    .novel-sheet__words::before {
        content: "·";
        margin-right: 6px;
    }

    .novel-sheet__action {
        grid-area: action;
        width: auto;
        height: 32px;
    }

    .novel-sheet__read {
        display: none;
    }

    .novel-sheet__chevron {
        position: static;
        visibility: visible;
    }

    .novel-sheet__row.is-latest .novel-sheet__read {
        display: inline-flex;
        position: static;
        visibility: visible;
        height: 32px;
        padding: 0 10px;
    }

    .novel-sheet__row.is-latest .novel-sheet__chevron {
        display: none;
    }

    .novel-sheet__row:hover .novel-sheet__read,
    .novel-sheet__row:focus-visible .novel-sheet__read {
        display: none;
        visibility: hidden;
    }

    .novel-sheet__row:hover .novel-sheet__chevron,
    .novel-sheet__row:focus-visible .novel-sheet__chevron {
        visibility: visible;
    }

    .novel-sheet__row.is-latest:hover .novel-sheet__read,
    .novel-sheet__row.is-latest:focus-visible .novel-sheet__read {
        display: inline-flex;
        visibility: visible;
    }

    .novel-sheet__pager {
        flex-wrap: wrap;
        gap: 4px;
    }

    .novel-sheet__pager button,
    .novel-sheet__pager span {
        min-width: 32px;
        height: 32px;
    }
}

/* ---------- Thông tin truyện: Bìa nền ---------- */

.novel-info--banner {
    --poster-accent: var(--primary-color);
    --poster-ink: var(--novel-ink);
    --poster-muted: var(--novel-sub);
    --poster-line: var(--novel-line);
    --poster-surface: var(--fs-color-alert);
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    color: var(--poster-ink);
    background: color-mix(in srgb, var(--poster-accent) 18%, var(--poster-ink));
}

.novel-poster__bg {
    position: absolute;
    inset: -24px;
}

.novel-poster__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(18px);
    transform: scale(1.12);
}

.novel-poster__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, var(--poster-ink) 62%, transparent);
}

.novel-poster__panel {
    position: relative;
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    margin: 0;
    padding: 20px;
    background: transparent;
}

.novel-poster__cover {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--poster-ink) 18%, transparent);
}

.novel-poster__cover img {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.novel-poster__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--poster-accent);
    color: var(--poster-surface);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;
}

.novel-poster__badge.is-hot {
    background: var(--fs-color-success);
}

.novel-poster__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

h1.novel-poster__title {
    margin: 0;
    color: var(--poster-surface);
    font-size: 1.45em !important;
    font-weight: 700;
    line-height: 1.25;
}

.novel-poster__origin {
    margin: -6px 0 0;
    color: color-mix(in srgb, var(--poster-surface) 78%, transparent);
    font-size: 0.9em;
}

.novel-poster__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    font-size: 0.9em;
}

.novel-poster__rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--poster-surface);
    font-weight: 700;
    text-decoration: none;
}

.novel-poster__rating svg,
.novel-poster__views svg {
    width: 1em;
    height: 1em;
    flex: none;
}

.novel-poster__rating svg {
    color: var(--poster-accent);
}

.novel-poster__count,
.novel-poster__views {
    color: color-mix(in srgb, var(--poster-surface) 82%, transparent);
    font-weight: 500;
}

.novel-poster__views {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.novel-poster__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--poster-surface) 18%, transparent);
    color: var(--poster-surface);
    font-size: 0.85em;
    font-weight: 700;
}

.novel-poster__status::before {
    content: "";
    width: 0.45em;
    height: 0.45em;
    border-radius: 50%;
    background: currentColor;
}

.novel-poster__genres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.novel-poster__genres a {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--poster-surface) 16%, transparent);
    color: var(--poster-surface);
    font-size: 0.82em;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
}

.novel-poster__genres a:hover {
    background: color-mix(in srgb, var(--poster-surface) 28%, transparent);
    color: var(--poster-surface);
    text-decoration: none;
}

.novel-poster__facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.novel-poster__facts div {
    min-width: 0;
    padding: 8px 10px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--poster-surface) 14%, transparent);
}

.novel-info--banner .novel-poster__facts dt,
.novel-info--banner .novel-poster__facts dd {
    display: block !important;
    text-transform: none !important;
}

.novel-poster__facts dt {
    margin: 0;
    color: color-mix(in srgb, var(--poster-surface) 72%, transparent);
    font-size: 0.75rem;
    font-weight: 600;
}

.novel-poster__facts dd {
    margin: 2px 0 0;
    overflow: hidden;
    color: var(--poster-surface);
    font-size: 0.95rem !important;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.novel-poster__facts dd a {
    color: inherit;
    text-decoration: none;
}

.novel-poster__facts dd a:hover {
    color: var(--poster-surface);
}

.novel-poster__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.novel-poster__actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 0;
    margin: 0;
    padding: 10px 16px;
    border-radius: 999px;
    color: var(--poster-surface);
    font-size: 0.92em;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    text-decoration: none;
    text-transform: none;
}

.novel-poster__actions svg {
    width: 1em;
    height: 1em;
    flex: none;
}

.novel-poster__start {
    background: var(--poster-accent);
}

.novel-poster__latest {
    background: var(--fs-color-success);
}

.novel-poster__history {
    border: 1px solid color-mix(in srgb, var(--poster-surface) 32%, transparent);
    background: color-mix(in srgb, var(--poster-ink) 36%, transparent);
}

.novel-poster__actions a:hover {
    color: var(--poster-surface);
    filter: brightness(1.06);
    text-decoration: none;
}

@media (max-width: 720px) {
    .novel-poster__panel {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 14px;
        margin: 0;
        padding: 16px;
    }

    .novel-poster__cover {
        width: 132px;
    }

    .novel-poster__body {
        align-items: center;
        width: 100%;
        text-align: center;
    }

    h1.novel-poster__title {
        font-size: 1.2em !important;
    }

    .novel-poster__meta,
    .novel-poster__genres,
    .novel-poster__actions {
        justify-content: center;
    }

    .novel-poster__facts {
        width: 100%;
        text-align: left;
    }

    .novel-poster__facts {
        grid-template-columns: 1fr;
    }

    .novel-poster__facts dd {
        white-space: normal;
    }

    .novel-poster__actions {
        width: 100%;
    }

    .novel-poster__actions a {
        flex: 1;
        white-space: nowrap;
        padding: 11px 10px;
    }
}

/* ---------- Thông tin truyện: Nổi bật ---------- */

.novel-info--spotlight {
    --stage-accent: var(--primary-color);
    --stage-ink: var(--novel-ink);
    --stage-surface: var(--fs-color-alert);
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    color: var(--stage-surface);
    background: var(--stage-ink);
}

.novel-stage__bg {
    position: absolute;
    inset: 0;
}

.novel-stage__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
    filter: saturate(1.05);
}

.novel-stage__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, var(--stage-ink) 0%, color-mix(in srgb, var(--stage-ink) 92%, transparent) 38%, color-mix(in srgb, var(--stage-ink) 62%, transparent) 100%),
        linear-gradient(180deg, color-mix(in srgb, var(--stage-ink) 20%, transparent), color-mix(in srgb, var(--stage-ink) 72%, transparent));
}

.novel-stage__panel {
    position: relative;
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    padding: 28px;
}

.novel-stage__cover {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 16px 36px color-mix(in srgb, var(--stage-ink) 45%, transparent);
}

.novel-stage__cover img {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.novel-stage__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    background: #7c8aa5;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
}
.novel-stage__badge.is-0 { background: #f59e0b; }
.novel-stage__badge.is-1 { background: #3b82f6; }
.novel-stage__badge.is-2 { background: #22c55e; }
.novel-stage__badge.is-3 { background: #7c8aa5; }

.novel-stage__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

h1.novel-stage__title {
    margin: 0;
    color: var(--stage-surface);
    font-size: 1.5rem !important;
    font-weight: 700;
    line-height: 1.15;
}

.novel-stage__origin {
    margin: -6px 0 0;
    color: color-mix(in srgb, var(--stage-surface) 72%, transparent);
    font-size: 0.95em;
}

.novel-stage__facts,
.novel-stage__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.novel-info--spotlight .novel-stage__facts li,
.novel-info--spotlight .novel-stage__stats li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 !important;
    min-width: 0;
}

.novel-stage__facts svg,
.novel-stage__stats svg {
    flex: none;
    width: 22px;
    height: 22px;
    color: color-mix(in srgb, var(--stage-surface) 78%, transparent);
}


.novel-stage__value {
    display: block;
    color: var(--stage-surface);
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.3;
}

.novel-stage__hint {
    display: block;
    color: color-mix(in srgb, var(--stage-surface) 62%, transparent);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
}

.novel-stage__value a {
    color: inherit;
    text-decoration: none;
}

.novel-stage__value a:hover {
    color: var(--stage-surface);
}

.novel-stage__genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.novel-stage__genres a {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border: 1px solid color-mix(in srgb, var(--stage-surface) 28%, transparent);
    border-radius: 9px;
    background: transparent;
    color: var(--stage-surface);
    font-size: 0.8em;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
}


.novel-stage__genres a:hover {
    border-color: color-mix(in srgb, var(--stage-surface) 55%, transparent);
    color: var(--stage-surface);
    text-decoration: none;
}

.novel-stage__stats {
    gap: 0;
    max-width: 560px;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--stage-surface) 16%, transparent);
    border-radius: 14px;
}

.novel-info--spotlight .novel-stage__stats li {
    flex: 1;
    justify-content: center;
    padding: 2px 8px;
}

.novel-stage__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
}

.novel-stage__read,
.novel-stage__ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    margin: 0;
    border-radius: 12px;
    box-shadow: none;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
    text-decoration: none;
    text-transform: none;
}

.novel-stage__read {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "icon label chev" "icon chapter chev";
    column-gap: 10px;
    row-gap: 2px;
    align-items: center;
    min-width: min(100%, 280px);
    padding: 10px 16px;
    background: var(--stage-accent);
    color: var(--stage-surface);
}

.novel-stage__read:not(:has(.novel-stage__read-chapter)) {
    grid-template-areas: "icon label chev";
}

.novel-stage__read-icon {
    grid-area: icon;
    width: 22px;
    height: 22px;
}

.novel-stage__read-label {
    grid-area: label;
    overflow: hidden;
    font-size: 1em;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.novel-stage__read-chapter {
    grid-area: chapter;
    overflow: hidden;
    color: color-mix(in srgb, var(--stage-surface) 82%, transparent);
    font-size: 0.75em;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.novel-stage__read::after {
    content: "";
    grid-area: chev;
    width: 8px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
}

.novel-info--spotlight .novel-stage__ghost {
    align-self: stretch;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid color-mix(in srgb, var(--stage-surface) 28%, transparent);
    color: var(--stage-surface);
}

.novel-info--spotlight .novel-stage__history {
    background: color-mix(in srgb, var(--stage-surface) 10%, transparent);
}

.novel-stage__ghost svg {
    flex: none;
    width: 18px;
    height: 18px;
}

.novel-stage__read:hover,
.novel-stage__ghost:hover {
    color: var(--stage-surface);
    filter: brightness(1.08);
    text-decoration: none;
}

@media (max-width: 720px) {
    .novel-stage__panel {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 8px;
        padding: 18px 16px 20px;
    }

    .novel-stage__cover {
        width: 148px;
    }

    .novel-stage__body {
        align-items: center;
        width: 100%;
        text-align: center;
    }

    h1.novel-stage__title {
        font-size: 1.13rem !important;
    }

    .novel-stage__genres {
        justify-content: center;
    }

    .novel-stage__facts {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 10px 8px;
    }

    .novel-info--spotlight .novel-stage__facts li {
        flex-direction: column;
        justify-content: flex-start;
        gap: 4px;
        text-align: center;
    }

    .novel-stage__facts .novel-stage__value {
        max-width: 100%;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        font-size: 0.9em;
        font-weight: 500;

    }

    .novel-stage__stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        max-width: none;
    }

    .novel-info--spotlight .novel-stage__stats li {
        justify-content: flex-start;
        padding: 8px 12px;
    }

    .novel-stage__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .novel-stage__read {
        grid-column: 1 / -1;
        width: 100%;
    }

    .novel-info--spotlight .novel-stage__ghost {
        width: 100%;
        min-width: 0;
        padding: 10px;
    }
}

/* ---------- Thông tin truyện: Áp phích ---------- */
.novel-info--billboard {
    --bill-accent: var(--primary-color);
    --bill-ink: var(--novel-ink);
    --bill-surface: var(--fs-color-alert);
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: var(--bill-ink);
    color: var(--bill-surface);
}

.novel-bill__bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.novel-bill__bg-fill {
    position: absolute;
    inset: -24px;
    width: calc(100% + 48px);
    height: calc(100% + 48px);
    object-fit: cover;
    object-position: right center;
    display: block;
    filter: blur(28px) saturate(1.05);
    opacity: 0.9;
}

.novel-bill__bg-main {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: 62%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    z-index: 1;
}

.novel-bill__shade {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(90deg,
        var(--bill-ink) 0%,
        color-mix(in srgb, var(--bill-ink) 92%, transparent) 32%,
        color-mix(in srgb, var(--bill-ink) 28%, transparent) 52%,
        transparent 68%);
}

.novel-bill__body {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 14px;
    min-width: 0;
    max-width: 58%;
    min-height: 480px;
    padding: 36px 28px 28px 32px;
}

h1.novel-bill__title {
    margin: 0;
    color: var(--bill-surface);
    font-size: 2.5rem ;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: 0;
}

.novel-bill__badges,
.novel-bill__meta,
.novel-bill__genres,
.novel-bill__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.novel-bill__badge {
    padding: 3px 8px;
    border: 1px solid color-mix(in srgb, var(--bill-surface) 40%, transparent);
    border-radius: 4px;
    color: var(--bill-surface);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

.novel-bill__badge.is-solid {
    border-color: transparent;
    background: var(--bill-accent);
    color: var(--bill-surface);
}

.novel-bill__meta {
    gap: 14px;
    color: color-mix(in srgb, var(--bill-surface) 82%, transparent);
    font-size: 0.92rem;
}

.novel-bill__score {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--bill-accent);
    font-weight: 700;
}

.novel-bill__score svg {
    width: 16px;
    height: 16px;
}

.novel-bill__genres a {
    padding: 4px 10px;
    border: 1px solid color-mix(in srgb, var(--bill-surface) 32%, transparent);
    border-radius: 6px;
    color: var(--bill-surface);
    font-size: 0.82rem;
    line-height: 1.4;
    text-decoration: none;
}

.novel-bill__genres a:hover {
    border-color: var(--bill-accent);
    color: var(--bill-accent);
}

.novel-bill__actions {
    gap: 10px;
    margin-top: 4px;
}

.novel-info--billboard .novel-bill__play,
.novel-info--billboard .novel-bill__quiet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    min-height: 0;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: none;
    text-decoration: none;
    box-shadow: none;
}

.novel-info--billboard .novel-bill__play {
    padding: 11px 18px;
    background: var(--bill-accent);
    color: var(--bill-surface);
}

.novel-info--billboard .novel-bill__quiet {
    padding: 10px 14px;
    border: 1px solid color-mix(in srgb, var(--bill-surface) 28%, transparent);
    background: color-mix(in srgb, var(--bill-ink) 55%, transparent);
    color: var(--bill-surface);
}

.novel-info--billboard .novel-bill__history {
    background: color-mix(in srgb, var(--bill-surface) 10%, transparent);
}

.novel-info--billboard .novel-bill__play:hover,
.novel-info--billboard .novel-bill__quiet:hover {
    filter: brightness(1.08);
    color: var(--bill-surface);
}

.novel-bill__play svg,
.novel-bill__quiet svg {
    width: 18px;
    height: 18px;
    flex: none;
}

@media (max-width: 720px) {
    .novel-info--billboard {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .novel-bill__bg {
        position: relative;
        height: 260px;
        flex-shrink: 0;
    }

    .novel-bill__bg-fill {
        display: none;
    }

    .novel-bill__bg-main {
        left: 0;
        right: 0;
        max-width: none;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center 18%;
    }

    .novel-bill__shade {
        inset: auto;
        top: 0;
        left: 0;
        right: 0;
        height: 260px;
        background: linear-gradient(180deg, transparent 42%, var(--bill-ink) 100%);
    }

    .novel-bill__body {
        max-width: none;
        min-height: 0;
        padding: 4px 16px 20px;
    }

    h1.novel-bill__title {
        font-size: 1.2rem !important;
    }

    .novel-bill__actions {
        width: 100%;
    }

    .novel-info--billboard .novel-bill__play {
        flex: 1 1 100%;
    }

    .novel-info--billboard .novel-bill__quiet {
        flex: 1 1 0;
        min-width: 0;
        padding: 10px 8px;
    }
}

/* ---------- Thông tin truyện: Bìa sách ---------- */
/* Book — theme sáng (mặc định) */
.novel-info--book,
.novel-rows,
.novel-page .col-inner:has(.novel-info--book) {
    --book-accent: var(--primary-color);
    --book-ink: #f4f6fa;
    --book-glow: color-mix(in srgb, var(--primary-color) 18%, transparent);
    --book-card: #ffffff;
    --book-line: #e2e8f0;
    --book-surface: #1a2744;
    --book-on-accent: #ffffff;
    --book-wash-a: #eef2f8;
    --book-wash-b: #f4f6fa;
    --book-shadow: 0 10px 24px rgba(26, 39, 68, 0.08);
    background: var(--book-ink);
    color: var(--book-surface);
}

/* Book — theme tối (skin charcoal cũ) */
.novel-page[data-show-theme="dark"] .novel-info--book,
.novel-page[data-show-theme="dark"] .novel-rows,
.novel-page[data-show-theme="dark"] .col-inner:has(.novel-info--book) {
    --book-accent: var(--primary-color);
    --book-ink: #121214;
    --book-glow: color-mix(in srgb, var(--primary-color) 46%, black);
    --book-card: #222224;
    --book-line: #2a2a2c;
    --book-surface: var(--fs-color-alert);
    --book-on-accent: var(--fs-color-alert);
    --book-wash-a: #2a2a2c;
    --book-wash-b: #242426;
    --book-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.novel-page .col-inner:has(.novel-info--book) {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-areas:
        "cover main"
        "cover chapters"
        "cover comments";
    column-gap: 28px;
    align-items: start;
    overflow: visible;
    border-radius: 18px;
    background:
        radial-gradient(80% 34% at 32% 0%, var(--book-glow) 0%, transparent 70%),
        linear-gradient(180deg, var(--book-wash-a) 0%, var(--book-wash-b) 17%, var(--book-ink) 42%);
    padding: 28px;
}

.novel-page:has(.novel-info--book) .row,
.novel-page:has(.novel-info--book) .col {
    overflow: visible;
}

.novel-page .col-inner:has(.novel-info--book) > .novel-skin:not(.novel-rows):not(.novel-section),
.novel-page .col-inner:has(.novel-info--book) .novel-info--book,
.novel-page .col-inner:has(.novel-info--book) .novel-book {
    display: contents;
}

.novel-page .col-inner:has(.novel-info--book) .novel-book__cover {
    grid-area: cover;
    position: sticky;
    top: 88px;
    align-self: start;
    width: 220px;
    z-index: 2;
}

.novel-page .col-inner:has(.novel-info--book) .novel-book__main {
    grid-area: main;
    min-width: 0;
}

.novel-page .col-inner:has(.novel-info--book) .novel-rows {
    grid-area: chapters;
    min-width: 0;
    border-radius: 0;
    background: transparent;
    padding: 8px 0 0;
}

.novel-page .col-inner:has(.novel-info--book) > #myRating {
    grid-area: comments;
    min-width: 0;
    margin-top: 20px;
    border-radius: 12px;
    padding: 8px 12px;
}

.novel-book__backdrop {
    display: none;
}

.novel-book__cover {
    position: relative;
}

.novel-book__cover img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.novel-book__status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--book-accent);
    color: var(--book-on-accent);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.3;
    text-transform: uppercase;
}

.novel-book__topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
}

h1.novel-book__title {
    margin: 0;
    min-width: 0;
    flex: 1 1 auto;
    color: var(--book-surface);
    font-size: clamp(1.35rem, 2.2vw, 1.9rem) !important;
    font-weight: 700;
    line-height: 1.25;
}

.novel-book__main .novel-theme-toggle {
    margin-top: 2px;
}

.novel-book__rate {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
}

.novel-book__score {
    font-size: 1.05rem;
    font-weight: 700;
}

.novel-book__stars {
    position: relative;
    display: inline-block;
    font-size: 0.95rem;
    letter-spacing: 1px;
    line-height: 1;
}

.novel-book__stars-base {
    color: color-mix(in srgb, var(--book-surface) 28%, transparent);
}

.novel-book__stars-fill {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    width: calc(var(--novel-score) / 5 * 100%);
    color: #f5c518;
    white-space: nowrap;
}

.novel-book__count {
    color: color-mix(in srgb, var(--book-surface) 68%, transparent);
    font-size: 0.9rem;
}

.novel-book__views {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: color-mix(in srgb, var(--book-surface) 78%, transparent);
    font-size: 0.9rem;
    font-weight: 600;
}

.novel-book__views svg {
    width: 15px;
    height: 15px;
    flex: none;
}

.novel-book__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0 0 20px;
    padding-top: 16px;
    border-top: 1px solid color-mix(in srgb, var(--book-surface) 14%, transparent);
}

.novel-book__label,
.novel-book__value {
    display: block;
}

.novel-book__label {
    margin-bottom: 4px;
    color: color-mix(in srgb, var(--book-surface) 55%, transparent);
    font-size: 0.82rem;
}

.novel-book__value {
    color: var(--book-surface);
    font-size: 0.95rem;
    font-weight: 600;
}

.novel-book__value a {
    color: inherit;
    text-decoration: none;
}

.novel-book__value a:hover {
    color: var(--book-accent);
}

.novel-book__genres a:not(:last-child)::after {
    content: ", ";
}

.novel-book__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.novel-info--book .novel-book__read,
.novel-info--book .novel-book__start {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    min-height: 0;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: none;
    text-decoration: none;
    box-shadow: none;
}

.novel-book__read-label,
.novel-book__start-label {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.novel-info--book .novel-book__read {
    background: var(--book-accent);
    color: var(--book-on-accent);
}

.novel-info--book .novel-book__start {
    border: 1px solid color-mix(in srgb, var(--book-surface) 28%, transparent);
    background: transparent;
    color: var(--book-surface);
}

.novel-info--book .novel-book__history {
    background: color-mix(in srgb, var(--book-surface) 10%, transparent);
}

.novel-info--book .novel-book__read:hover {
    filter: brightness(1.08);
    color: var(--book-on-accent);
}

.novel-info--book .novel-book__start:hover {
    filter: brightness(1.08);
    color: var(--book-surface);
}

.novel-book__read svg,
.novel-book__start svg {
    width: 18px;
    height: 18px;
    flex: none;
}

.novel-book__desc {
    margin: 0;
    color: color-mix(in srgb, var(--book-surface) 78%, transparent);
    font-size: 0.92rem;
    line-height: 1.6;
}

.novel-book__desc.is-collapsed {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.novel-book__more {
    margin: 6px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--book-accent);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}

.novel-book__more[hidden] {
    display: none;
}

.novel-rows {
    border-radius: 0 0 18px 18px;
    margin-top: 0;
    padding: 8px 12px 16px;
}

.novel-rows__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px 12px;
    border-top: 1px solid color-mix(in srgb, var(--book-surface) 12%, transparent);
}

.novel-rows__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    min-width: 0;
}

.novel-rows__tabs span,
.novel-rows__tabs a {
    color: color-mix(in srgb, var(--book-surface) 62%, transparent);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
}

.novel-rows__tabs .is-current,
.novel-rows__tabs a:hover {
    color: var(--book-accent);
}

.novel-rows__sort {
    flex: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: color-mix(in srgb, var(--book-surface) 72%, transparent);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}

.novel-rows__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.novel-rows__list > li[hidden] {
    display: none;
}

.novel-rows__pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 16px 0 4px;
}

.novel-rows__pages[hidden] {
    display: none;
}

.novel-rows__pages button {
    min-width: 36px;
    height: 36px;
    margin: 0;
    min-height: 0;
    padding: 0 12px;
    border: 1px solid color-mix(in srgb, var(--book-surface) 16%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--book-surface) 10%, var(--book-ink));
    color: var(--book-surface);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    text-transform: none;
    box-shadow: none;
    cursor: pointer;
}

.novel-rows__pages button.is-current {
    background: var(--book-accent);
    color: var(--book-surface);
}

.novel-rows__pages button:disabled {
    opacity: 0.35;
    cursor: default;
}

.novel-rows__gap {
    color: color-mix(in srgb, var(--book-surface) 45%, transparent);
    font-weight: 700;
}

.novel-rows__list a {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 36px;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--book-card);
    color: var(--book-surface);
    text-decoration: none;
}

.novel-rows__list a:hover .novel-rows__name,
.novel-rows__list .is-current .novel-rows__name {
    color: var(--book-accent);
}

.novel-rows__name {
    min-width: 0;
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.novel-rows__meta {
    display: flex;
    gap: 16px;
    align-items: center;
}

.novel-rows__words,
.novel-rows__time {
    color: color-mix(in srgb, var(--book-surface) 58%, transparent);
    font-size: 0.85rem;
    white-space: nowrap;
}

.novel-rows__play {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--book-surface);
    color: var(--book-ink);
}

.novel-rows__play svg {
    width: 30px;
    height: 30px;
    margin-left: 2px;
}

.novel-rows__empty {
    margin: 0;
    padding: 16px 12px 8px;
}

@media (max-width: 849px) {
    .novel-page .col-inner:has(.novel-info--book) {
        display: block;
        overflow: hidden;
        padding: 0 0 16px;
        border-radius: 14px;
        background: var(--book-ink);
    }

    .novel-page .col-inner:has(.novel-info--book) > .novel-skin,
    .novel-page .col-inner:has(.novel-info--book) .novel-info--book {
        display: block;
    }

    .novel-page .col-inner:has(.novel-info--book) .novel-book {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: none;
        justify-items: stretch;
        gap: 16px;
        overflow: hidden;
        padding: 22px 16px 4px;
    }

    .novel-book__backdrop {
        display: block;
        position: absolute;
        z-index: 0;
        overflow: hidden;
        inset: 0;
        pointer-events: none;
    }

    .novel-book__backdrop-img {
        position: absolute;
        inset: -28px;
        width: calc(100% + 56px);
        height: calc(100% + 56px);
        max-width: none;
        object-fit: cover;
        object-position: center 18%;
        filter: blur(26px) saturate(1.05);
        transform: scale(1.08);
    }

    .novel-book__backdrop::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(
            180deg,
            color-mix(in srgb, var(--book-ink) 18%, transparent) 0%,
            color-mix(in srgb, var(--book-ink) 55%, transparent) 36%,
            var(--book-ink) 68%
        );
    }

    .novel-page[data-show-theme="dark"] .novel-book__backdrop::after {
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0%, rgba(10, 12, 11, 0.42) 36%, var(--book-ink) 68%);
    }

    .novel-book__topline {
        flex-direction: column;
        align-items: center;
    }

    .novel-book__main .novel-theme-toggle {
        align-self: flex-end;
        margin: -4px 0 4px;
    }

    .novel-page .col-inner:has(.novel-info--book) .novel-book__cover,
    .novel-page .col-inner:has(.novel-info--book) .novel-book__main {
        position: relative;
        z-index: 1;
    }

    h1.novel-book__title,
    .novel-book__rate {
        justify-content: center;
        text-align: center;
    }

    .novel-page .col-inner:has(.novel-info--book) .novel-book__cover,
    .novel-page .col-inner:has(.novel-info--book) .novel-book__main,
    .novel-page .col-inner:has(.novel-info--book) .novel-rows,
    .novel-page .col-inner:has(.novel-info--book) > #myRating {
        grid-area: auto;
        width: auto;
        min-width: 0;
    }

    .novel-page .col-inner:has(.novel-info--book) .novel-book__cover {
        position: relative;
        top: auto;
        z-index: 1;
        justify-self: center;
        width: min(260px, 46vw);
    }

    .novel-page .col-inner:has(.novel-info--book) .novel-book__cover img {
        border-radius: 10px;
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
    }

    .novel-page .col-inner:has(.novel-info--book) .novel-rows,
    .novel-page .col-inner:has(.novel-info--book) > #myRating {
        margin-inline: 16px;
    }

    .novel-page .col-inner:has(.novel-info--book) .novel-rows {
        padding: 4px 0 12px;
        background: transparent;
    }

    .novel-info--book {
        padding: 0;
        border-radius: 0;
        background: transparent;
    }

    .novel-book__cover {
        width: min(260px, 46vw);
    }

    .novel-book__main {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .novel-page .col-inner:has(.novel-info--book) .novel-book__cover,
    .novel-book__cover {
        width: min(210px, 58vw);
    }

    h1.novel-book__title {
        font-size: 1.3rem !important;
    }

    .novel-book__facts {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .novel-book__actions {
        display: grid;
        grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    }

    .novel-info--book .novel-book__read,
    .novel-info--book .novel-book__start {
        min-width: 0;
        overflow: hidden;
        padding-inline: 10px;
        white-space: nowrap;
    }

    .novel-info--book .novel-book__history {
        grid-column: 1 / -1;
    }

    .novel-rows {
        padding: 4px 8px 12px;
        border-radius: 0 0 14px 14px;
    }

    .novel-rows__head {
        align-items: flex-start;
        padding-inline: 8px;
    }

    .novel-rows__tabs {
        flex-direction: column;
        gap: 8px;
    }

    .novel-rows__list a {
        grid-template-columns: minmax(0, 1fr) 34px;
        grid-template-areas:
            "name play"
            "meta play";
        gap: 4px 10px;
    }

    .novel-rows__meta {
        grid-area: meta;
        gap: 0;
    }

    .novel-rows__name {
        grid-area: name;
        white-space: normal;
    }

    .novel-rows__words,
    .novel-rows__time {
        grid-area: meta;
    }

    .novel-rows__time::before {
        content: " · ";
    }

    .novel-rows__play {
        grid-area: play;
    }
}

/* ---------- Thông tin truyện: Màn hình ---------- */
.novel-page:has(.novel-info--screen) {
    position: relative;
    isolation: isolate;
}

.novel-page:has(.novel-info--screen)::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    background: var(--screen-ink);
}

body:has(.novel-info--screen) {
    overflow-x: hidden;
}

/* Screen — theme sáng (mặc định) */
.novel-page:has(.novel-info--screen),
.novel-info--screen,
.novel-chips,
.novel-page .col-inner:has(.novel-info--screen) {
    --screen-ink: #f4f6fa;
    --screen-card: #ffffff;
    --screen-chip: #eef1f6;
    --screen-line: #e2e8f0;
    --screen-surface: #1a2744;
    --screen-accent: var(--primary-color);
    --screen-on-accent: #ffffff;
    --screen-shadow: 0 10px 24px rgba(26, 39, 68, 0.08);
    --screen-fade: color-mix(in srgb, var(--screen-ink) 0%, transparent);
    color: var(--screen-surface);
}

/* Screen — theme tối (skin cũ) */
.novel-page[data-show-theme="dark"]:has(.novel-info--screen),
.novel-page[data-show-theme="dark"] .novel-info--screen,
.novel-page[data-show-theme="dark"] .novel-chips,
.novel-page[data-show-theme="dark"] .col-inner:has(.novel-info--screen) {
    --screen-ink: #14151c;
    --screen-card: #1c1e27;
    --screen-chip: #2a2d3a;
    --screen-line: #2a2d3a;
    --screen-surface: var(--fs-color-alert);
    --screen-accent: var(--primary-color);
    --screen-on-accent: var(--fs-color-alert);
    --screen-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    --screen-fade: rgb(28 30 39 / 0%);
}

.novel-page .col-inner:has(.novel-info--screen) {
    position: relative;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    column-gap: 0;
    row-gap: 0;
    align-items: start;
    padding-top: 400px;
}

.novel-page .col-inner:has(.novel-info--screen) > .novel-skin:not(.novel-chips):not(.novel-intro):not(.novel-section),
.novel-page .col-inner:has(.novel-info--screen) .novel-info--screen,
.novel-page .col-inner:has(.novel-info--screen) .novel-screen {
    display: contents;
}

.novel-screen__backdrop {
    position: absolute;
    z-index: 0;
    top: -20px;
    left: 50%;
    width: 100vw;
    height: 800px;
    overflow: hidden;
    transform: translateX(-50%);
    pointer-events: none;
}

.novel-screen__backdrop-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    filter: blur(6px) saturate(0.9) brightness(0.72);
    transform: scale(1.06);
}

.novel-screen__backdrop::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image: url("../images/blocks/dotted (1).png");
    background-repeat: repeat;
    opacity: 0.2;
}

.novel-screen__backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        linear-gradient(
            180deg,
            color-mix(in srgb, var(--screen-ink) 18%, transparent) 0%,
            color-mix(in srgb, var(--screen-ink) 55%, transparent) 42%,
            var(--screen-ink) 78%
        );
}

.novel-page:not([data-show-theme="dark"]) .novel-screen__backdrop-img {
    filter: blur(8px) saturate(1.05) brightness(1.05);
    opacity: 0.55;
}

.novel-screen__side,
.novel-screen__actions,
.novel-page .col-inner:has(.novel-info--screen) > .novel-chips,
.novel-page .col-inner:has(.novel-info--screen) > .novel-intro,
.novel-page:has(.novel-info--screen) #myRating {
    position: relative;
    z-index: 1;
}

.novel-screen__side {
    position: absolute;
    top: 400px;
    left: 0;
    display: flex;
    flex-direction: column;
    width: 250px;
    min-width: 0;
    padding: 16px;
    border-radius: 18px 48px 48px 18px;
    background: var(--screen-card);
}

.novel-screen__actions,
.novel-page .col-inner:has(.novel-info--screen) > .novel-chips,
.novel-page .col-inner:has(.novel-info--screen) > .novel-intro,
.novel-page:has(.novel-info--screen) #myRating {
    grid-column: 2;
}

.novel-screen__poster img {
    display: block;
    width: 168px;
    height: auto;
    margin: 0 auto;
    border-radius: 12px;
}

h1.novel-screen__title {
    margin: 16px 0 0;
    min-width: 0;
    color: var(--screen-surface);
    font-size: 1.35rem !important;
    font-weight: 700;
    line-height: 1.3;
}

.novel-screen__actions .novel-theme-toggle {
    margin: 0;
    margin-left: auto;
}

.novel-screen__origin {
    margin: 6px 0 0;
    color: color-mix(in srgb, var(--screen-surface) 68%, transparent);
    font-size: 0.92rem;
}

.novel-screen__facts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 18px 0 0;
}

.novel-screen__fact {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    margin: 0;
}

.novel-info--screen .novel-screen__fact dt,
.novel-info--screen .novel-screen__fact dd {
    display: inline;
    margin: 0;
    text-transform: none;
}

.novel-screen__fact dt {
    color: color-mix(in srgb, var(--screen-surface) 55%, transparent);
    font-size: 0.78rem;
    font-weight: 400;
}

.novel-screen__fact dd,
.novel-screen__fact dd a {
    color: var(--screen-surface);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
}

.novel-screen__fact dd a:hover {
    color: var(--screen-accent);
}

.novel-screen__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    min-width: 0;
    margin: 0;
    padding: 16px 16px 0;
    border-radius: 48px 18px 0 0;
    background: var(--screen-card);
}

.novel-screen__read,
.novel-screen__rate {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    min-height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    text-decoration: none;
    text-transform: none;
}

.novel-screen__read {
    background: var(--screen-accent);
    color: var(--screen-on-accent);
}

.novel-screen__read svg,
.novel-screen__rate svg {
    width: 14px;
    height: 14px;
}

.novel-screen__rate {
    margin-left: auto;
    border: 1px solid color-mix(in srgb, var(--screen-surface) 24%, transparent);
    color: var(--screen-surface);
}

.novel-screen__history {
    margin-left: 0;
    background: color-mix(in srgb, var(--screen-surface) 10%, transparent);
}

.novel-screen__read:hover {
    color: var(--screen-on-accent);
    filter: brightness(1.06);
}

.novel-screen__rate:hover {
    color: var(--screen-surface);
}

.novel-page .col-inner:has(.novel-info--screen) > .novel-chips {
    min-width: 0;
    margin: 0;
    padding: 16px;
    border-radius: 0 0 18px 48px;
    background: var(--screen-card);
}

.novel-page .col-inner:has(.novel-info--screen):has(.novel-intro) > .novel-chips {
    border-radius: 0;
}

.novel-page .col-inner:has(.novel-info--screen) > .novel-intro {
    min-width: 0;
    margin: 0;
    padding: 0 16px 16px;
    border: 0;
    border-radius: 0 0 18px 30px;
    background: var(--screen-card);
    color: var(--screen-surface);
}

.novel-page .col-inner:has(.novel-info--screen) > .novel-intro .novel-card__icon {
    display: none;
}

.novel-page .col-inner:has(.novel-info--screen) > .novel-intro .novel-card__head {
    margin-bottom: 8px;
}

.novel-page .col-inner:has(.novel-info--screen) > .novel-intro h2.novel-card__title {
    color: var(--screen-surface);
    font-size: 1rem !important;
}

.novel-page .col-inner:has(.novel-info--screen) > .novel-intro .novel-intro__body {
    color: color-mix(in srgb, var(--screen-surface) 78%, transparent);
}

.novel-page .col-inner:has(.novel-info--screen) > .novel-intro .novel-intro__body.is-collapsed::after {
    background: linear-gradient(var(--screen-fade), var(--screen-card) 85%);
}

.novel-page .col-inner:has(.novel-info--screen) > .novel-intro .novel-pill-toggle {
    margin: 10px 0 0;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--screen-accent);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: none;
}

.novel-chips__list {
    display: grid;
    grid-template-columns: repeat(var(--chips-cols, 4), minmax(0, 1fr));
    gap: 10px;
}

@media (max-width: 849px) {
    .novel-chips__list {
        grid-template-columns: repeat(var(--chips-cols-md, var(--chips-cols, 4)), minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .novel-chips__list {
        grid-template-columns: repeat(var(--chips-cols-sm, 2), minmax(0, 1fr));
    }
}

.novel-chips__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    gap: 6px;
    min-height: 36px;
    margin: 0;
    padding: 0 12px;
    border-radius: 8px;
    background: var(--screen-chip);
    color: var(--screen-surface);
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
}

.novel-chips__item[hidden] {
    display: none;
}

.novel-chips__item svg {
    width: 11px;
    height: 11px;
}

.novel-chips__item:hover,
.novel-chips__item.is-current {
    background: color-mix(in srgb, var(--screen-accent) 72%, black);
    color: var(--screen-surface);
}

.novel-chips__pages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.novel-chips__pages[hidden] {
    display: none;
}

.novel-chips__pages button {
    min-width: 36px;
    height: 36px;
    margin: 0;
    min-height: 0;
    padding: 0 12px;
    border: 1px solid color-mix(in srgb, var(--screen-surface) 16%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--screen-surface) 8%, var(--screen-card));
    color: var(--screen-surface);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    text-transform: none;
    box-shadow: none;
    cursor: pointer;
}

.novel-chips__pages button.is-current {
    background: var(--screen-accent);
    color: var(--screen-surface);
}

.novel-chips__pages button:disabled {
    opacity: 0.35;
    cursor: default;
}

.novel-chips__gap {
    color: color-mix(in srgb, var(--screen-surface) 45%, transparent);
    font-weight: 700;
}

.novel-chips__empty {
    margin: 0;
}

.novel-screen__intro {
    min-width: 0;
    margin-top: 18px;
}

h2.novel-screen__intro-title {
    margin: 0 0 8px;
    color: var(--screen-surface);
    font-size: 1rem !important;
    font-weight: 700;
}

.novel-screen__body {
    position: relative;
    color: color-mix(in srgb, var(--screen-surface) 78%, transparent);
    font-size: 0.92rem;
    line-height: 1.65;
}

.novel-screen__body p:last-child {
    margin-bottom: 0;
}

.novel-screen__body.is-collapsed {
    max-height: 7.2em;
    overflow: hidden;
}

.novel-screen__body.is-collapsed::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2.4em;
    background: linear-gradient(var(--screen-fade), var(--screen-card) 85%);
}

.novel-screen__more {
    margin: 10px 0 0;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--screen-accent);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: none;
    cursor: pointer;
}

.novel-screen__more[hidden] {
    display: none;
}

.novel-page:has(.novel-info--screen) #myRating {
    margin-top: 20px;
    border-radius: 12px;
    color: var(--novel-ink);
}

@media (max-width: 849px) {
    .novel-page .col-inner:has(.novel-info--screen) {
        grid-template-columns: minmax(0, 1fr);
        padding-top: 28px;
    }

    .novel-screen__side {
        position: relative;
        top: auto;
        left: auto;
        grid-column: 1;
        width: auto;
    }

    .novel-screen__actions,
    .novel-page .col-inner:has(.novel-info--screen) > .novel-chips,
    .novel-page .col-inner:has(.novel-info--screen) > .novel-intro,
    .novel-page:has(.novel-info--screen) #myRating {
        grid-column: 1;
    }

    .novel-screen__backdrop {
        height: 280px;
    }

    .novel-screen__side {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: min(290px, 100%);
        margin: 0 auto 18px;
        border-radius: 16px;
        text-align: center;
    }

    .novel-screen__poster img {
        width: min(180px, 46vw);
    }

    .novel-screen__facts {
        align-self: stretch;
        align-items: stretch;
        width: 100%;
        text-align: left;
    }

    .novel-screen__fact {
        justify-content: flex-start;
    }

    .novel-screen__actions,
    .novel-page .col-inner:has(.novel-info--screen) > .novel-chips,
    .novel-page .col-inner:has(.novel-info--screen) > .novel-intro {
        border-radius: 0;
    }

    .novel-screen__actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px;
        grid-template-areas:
            "read read read"
            "rate hist theme";
        align-items: stretch;
        gap: 8px;
        border-radius: 16px 16px 0 0;
        padding: 14px 12px 0;
    }

    .novel-screen__read {
        grid-area: read;
        justify-content: center;
        min-width: 0;
        width: 100%;
        padding-inline: 14px;
    }

    .novel-screen__read-label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .novel-screen__rate {
        grid-area: rate;
    }

    .novel-screen__history {
        grid-area: hist;
    }

    .novel-screen__rate,
    .novel-screen__history {
        min-width: 0;
        width: 100%;
        margin-left: 0;
        justify-content: center;
        padding-inline: 10px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .novel-screen__actions .novel-theme-toggle {
        grid-area: theme;
        align-self: center;
        justify-self: stretch;
        order: 0;
        width: 36px;
        height: 36px;
        margin: 0;
        padding: 0;
        justify-content: center;
    }

    .novel-screen__actions .novel-theme-toggle__label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .novel-page .col-inner:has(.novel-info--screen) > .novel-intro,
    .novel-page .col-inner:has(.novel-info--screen):not(:has(.novel-intro)) > .novel-chips {
        border-radius: 0 0 16px 16px;
    }
}

/* Thanh chuyển chương nằm trên menu dưới đáy. */
@media (max-width: 849px) {
    body.has-mbn.is-novel-reader .novel-reader {
        padding-bottom: 150px;
    }

    body.has-mbn.is-novel-reader .novel-dock {
        bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    }

    body.has-mbn.is-novel-reader .novel-auto-bar {
        bottom: calc(138px + env(safe-area-inset-bottom, 0px));
    }

    body.has-mbn.is-novel-reader .novel-settings {
        bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    }
}

/* ---------- Truyện liên quan: trượt ngang ---------- */
.novel-rail {
    position: relative;
    z-index: 1;
    margin-top: 28px;
}

.novel-rail__title {
    margin: 0 0 14px;
    color: var(--fs-color-primary);
    font-weight: 700;
    line-height: 1.3;
}

.novel-rail .comics-slider {
    margin-bottom: 0;
}

.novel-page .col-inner:has(.novel-info--screen) > .novel-rail {
    grid-column: 1 / -1;
}

.novel-page:has(.novel-info--screen) .novel-rail__title,
.novel-page:has(.novel-info--screen) .novel-rail :is(
    .comic-card-1__title,
    .comic-card-2__title,
    .comic-card-3__title,
    .comic-card-4__title,
    .comic-card-6__title,
    .comic-card-7__title,
    .comic-card-8__title,
    .tim-truyen-card__title,
    .comic-title-banner
) a {
    color: var(--screen-surface);
}

.novel-page:has(.novel-info--screen) .novel-rail :is(
    .comic-card-1__title,
    .comic-card-2__title,
    .comic-card-3__title,
    .comic-card-4__title,
    .comic-card-6__title,
    .comic-card-7__title,
    .comic-card-8__title,
    .tim-truyen-card__title,
    .comic-title-banner
) a:hover {
    color: var(--screen-accent);
}

.novel-page:has(.novel-info--screen) .novel-rail .comics-section.has-title-color :is(h3, .comic-title, .comic-title-banner) a,
.novel-page:has(.novel-info--screen) .novel-rail .comics-section.has-title-color :is(h3, .comic-title, .comic-title-banner) a:hover {
    color: var(--comics-title-color);
}

/* ---------- Lịch sử đọc ---------- */

.history-page {
    padding-top: 28px;
}

.history-preview-note {
    margin: 0 0 14px;
    color: var(--novel-sub);
    font-size: 0.85rem;
}

.history-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.history-head__eyebrow {
    margin: 0 0 4px;
    color: var(--novel-accent);
    font-size: 0.78rem;
    font-weight: 700;
}

.history-head__title {
    margin: 0;
    color: var(--novel-ink);
    font-size: 1.7rem;
    line-height: 1.2;
}

.history-head__side {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: none;
}

.history-head__count {
    margin: 0;
    color: var(--novel-sub);
    font-size: 0.95rem;
}

.history-head__clear {
    border: 1px solid var(--novel-line);
    border-radius: 999px;
    background: #fff;
    color: var(--novel-ink);
    padding: 7px 14px;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    text-transform: none;
    cursor: pointer;
}

.history-head__clear:hover {
    border-color: var(--novel-accent);
    color: var(--novel-accent);
}

.history-list .history-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols-xl, 1), minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 0;
}

.history-loading,
.history-empty {
    padding: 48px 20px;
    border: 1px dashed var(--novel-line);
    border-radius: 10px;
    color: var(--novel-sub);
    text-align: center;
}

.history-empty p,
.history-loading {
    margin: 0;
}

.history-card {
    position: relative;
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px 18px;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid #e7edf4;
    border-radius: 16px;
    background-color: #ffffff60; 
}

.history-card--item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    background-image: none;
    box-shadow: none;
}

.history-card__cover {
    position: relative;
    flex: none;
    width: 78px;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 12px;
    background: #eef2f8;
}

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

.history-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--novel-sub);
    font-weight: 700;
}

.history-card__main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.history-card__title {
    max-width: 100%;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
}

.history-card__title a {
    display: block;
    overflow: hidden;
    color: #1c2434;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.history-list.has-title-color .history-card__title a,
.history-list.has-title-color .history-card__title a:hover {
    color: var(--comics-title-color);
}

.history-card__title a:hover {
    color: var(--fs-color-primary);
}

.history-card__genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-card__genres a {
    padding: 2px 10px;
    border: 1px solid #e3e8ef;
    border-radius: 6px;
    color: #8b95a7;
    font-size: 0.78rem;
    line-height: 1.5;
    text-decoration: none;
}

.history-card__genres a:hover {
    border-color: var(--fs-color-primary);;
    color: var(--fs-color-primary);;
}

.history-card__progress {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.history-card__chapter,
.history-card__percent,
.history-card__bar {
    margin: 0;
    color: #5d6b80;
    font-size: 0.86rem;
    line-height: 1.3;
}

.history-card__chapter,
.history-card__percent {
    flex: none;
    white-space: nowrap;
}

.history-card__track {
    position: relative;
    flex: 1 1 auto;
    min-width: 48px;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #e7ebf2;
}

.history-card__track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--fs-color-primary);;
}

.history-card__side {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: none;
}

.history-card__when {
    text-align: right;
}

.history-card__read-label {
    margin: 0;
    color: #98a2b3;
    font-size: 0.78rem;
    line-height: 1.3;
}

.history-card__time {
    margin: 2px 0 0;
    color: #3d4a5c;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
}

.history-card__actions,
.history-card__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.history-card__bar .history-card__continue {
    margin-left: auto;
}

.history-card__continue {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--fs-color-primary);;
    border-radius: 10px;
    background: var(--fs-color-primary);;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    text-decoration: none;
    text-transform: none;
    white-space: nowrap;
    box-shadow: none;
}

.history-card__continue svg {
    flex: none;
    width: 16px;
    height: 16px;
}

.history-card__continue:hover {
    color: #fff;
    opacity: 0.92;
}

.history-card__continue.is-reread {
    border-color: #e4e8ef;
    background: #fff;
    color: #1c2434;
}

.history-card__continue.is-reread:hover {
    border-color: var(--fs-color-primary);;
    color: var(--fs-color-primary);;
    opacity: 1;
}

.history-card--item .history-card__continue {
    min-height: 0;
    gap: 0;
    border: 0;
    border-radius: 999px;
    background: var(--novel-accent);
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.history-card--item .history-card__continue:hover {
    color: #fff;
    opacity: 0.9;
}

.history-card__menu {
    position: relative;
}

.history-card__more,
.history-card__menu-list button,
.history-card__remove {
    margin: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--novel-sub);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: none;
    cursor: pointer;
}

.history-card__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #e4e8ef;
    border-radius: 10px;
    background: #fff;
    color: #8b95a7;
}

.history-card__more svg {
    width: 18px;
    height: 18px;
}

.history-card__more:hover,
.history-card__menu.is-open .history-card__more {
    border-color: var(--fs-color-primary);;
    color: var(--fs-color-primary);;
}

.history-card__menu-list {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 4;
    display: none;
    min-width: 132px;
    padding: 6px;
    border: 1px solid #e7edf4;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(28, 39, 68, 0.12);
}

.history-card__menu.is-open .history-card__menu-list {
    display: block;
}

.history-card.is-menu-open {
    z-index: 3;
}

.history-card__menu-list button {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    color: #1c2434;
    text-align: left;
}

.history-card__menu-list button:hover,
.history-card__remove:hover {
    background: #f6f7fb;
    color: var(--fs-color-primary);;
}

.history-card__remove {
    padding: 6px 0;
}

@media (max-width: 849px) {
    .history-list .history-grid {
        grid-template-columns: repeat(var(--cols-md, 1), minmax(0, 1fr));
    }
}

@media (max-width: 699px) {
    .history-card {
        grid-template-columns: 68px minmax(0, 1fr);
        gap: 12px;
        padding: 12px;
    }

    .history-card__cover {
        width: 68px;
    }

    .history-card__side {
        grid-column: 1 / -1;
        justify-content: space-between;
    }

    .history-card__when {
        text-align: left;
    }
}

@media (max-width: 549px) {
    .history-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-list .history-grid {
        grid-template-columns: repeat(var(--cols-xs, 1), minmax(0, 1fr));
    }

    .history-card__bar .history-card__continue {
        margin-left: 0;
    }

    .history-card__continue {
        min-height: 36px;
        padding: 0 12px;
        font-size: 0.85rem;
    }
}

/* ---------- Thông tin truyện: Show (POPS) ---------- */
.novel-page:has(.novel-info--show) {
    position: relative;
    isolation: isolate;
}

.novel-page:has(.novel-info--show)::before {
    content: '';
    position: absolute;
    z-index: 0;
    top: 0;
    left: 50%;
    width: 100vw;
    height: 100%;
    transform: translateX(-50%);
    background: var(--show-ink, #141414);
    pointer-events: none;
}

body:has(.novel-info--show) {
    overflow-x: hidden;
}

/* Theme sáng (mặc định) — khớp token novel-page */
.novel-info--show,
.novel-page .col-inner:has(.novel-info--show) {
    --show-ink: #f4f6fa;
    --show-card: #ffffff;
    --show-line: #e2e8f0;
    --show-muted: #7a869a;
    --show-surface: #1a2744;
    --show-accent: var(--primary-color);
    --show-quiet: #ffffff;
    --show-quiet-ink: #1a2744;
    --show-desc: #3a4660;
    --show-backdrop-a: rgba(244, 246, 250, 0.94);
    --show-backdrop-b: rgba(244, 246, 250, 0.72);
    --show-backdrop-c: rgba(244, 246, 250, 0.28);
    --show-shadow: 0 12px 28px rgba(26, 39, 68, 0.12);
}

/* Theme tối — ghi đè cả .novel-info--show (display:contents vẫn giữ custom property) */
.novel-page[data-show-theme="dark"]:has(.novel-info--show),
.novel-page[data-show-theme="dark"] .novel-info--show,
.novel-page[data-show-theme="dark"] .col-inner:has(.novel-info--show),
.novel-page[data-show-theme="dark"] .novel-episodes {
    --show-ink: #141414;
    --show-card: #1c1c1c;
    --show-line: #2a2a2a;
    --show-muted: #b3b3b3;
    --show-surface: #ffffff;
    --show-accent: var(--primary-color);
    --show-quiet: #ffffff;
    --show-quiet-ink: #141414;
    --show-desc: #e8e8e8;
    --show-backdrop-a: rgba(20, 20, 20, 0.92);
    --show-backdrop-b: rgba(20, 20, 20, 0.55);
    --show-backdrop-c: rgba(20, 20, 20, 0.35);
    --show-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.novel-page .col-inner:has(.novel-info--show) {
    position: relative;
    z-index: 1;
    color: var(--show-surface);
}

.novel-page .col-inner:has(.novel-info--show) > .novel-skin:not(.novel-episodes):not(.novel-section),
.novel-page .col-inner:has(.novel-info--show) .novel-info--show {
    display: contents;
}

.novel-info--show {
    position: relative;
    display: block;
    margin: 0 -15px;
    color: var(--show-surface);
    background: var(--show-ink);
}

.novel-show__backdrop {
    position: absolute;
    inset: 0 0 auto;
    height: min(72vw, 520px);
    overflow: hidden;
    pointer-events: none;
}

.novel-show__backdrop-img,
.novel-show__backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: blur(18px) saturate(1.05);
    transform: scale(1.12);
    opacity: 0.45;
}

.novel-page[data-show-theme="dark"] .novel-show__backdrop-img,
.novel-page[data-show-theme="dark"] .novel-show__backdrop img {
    opacity: 0.55;
}

.novel-show__backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, var(--show-backdrop-a) 0%, var(--show-backdrop-b) 42%, var(--show-backdrop-c) 100%),
        linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--show-ink) 72%, transparent) 78%, var(--show-ink) 100%);
}

.novel-show {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px 36px;
    align-items: start;
    max-width: 1100px;
    margin: 0 auto;
    padding: 36px 24px 28px;
}

.novel-show__topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.novel-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    margin: 2px 0 0;
    padding: 7px 12px;
    border: 1px solid var(--show-line, var(--screen-line, var(--book-line, #e2e8f0)));
    border-radius: 999px;
    background: var(--show-card, var(--screen-card, var(--book-card, #fff)));
    color: var(--show-surface, var(--screen-surface, var(--book-surface, #1a2744)));
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--show-shadow, var(--screen-shadow, var(--book-shadow, 0 8px 20px rgba(26, 39, 68, 0.08))));
}

.novel-theme-toggle:hover {
    border-color: color-mix(in srgb, var(--show-accent, var(--screen-accent, var(--book-accent, var(--primary-color)))) 45%, var(--show-line, var(--screen-line, var(--book-line, #e2e8f0))));
    color: var(--show-accent, var(--screen-accent, var(--book-accent, var(--primary-color))));
}

.novel-theme-toggle svg {
    width: 16px;
    height: 16px;
}

.novel-theme-toggle__moon {
    display: none;
}

.novel-page[data-show-theme="dark"] .novel-theme-toggle__sun {
    display: none;
}

.novel-page[data-show-theme="dark"] .novel-theme-toggle__moon {
    display: block;
}

.novel-show__poster {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: var(--show-shadow);
    aspect-ratio: 2 / 3;
    background: var(--show-card);
}

.novel-show__poster img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.novel-show__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    padding-top: 4px;
}

h1.novel-show__title {
    margin: 0;
    min-width: 0;
    flex: 1 1 auto;
    color: var(--show-surface);
    font-size: clamp(1.45rem, 2.4vw, 1.85rem);
    font-weight: 700;
    line-height: 1.25;
}

.novel-show__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.novel-show__stats li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--show-muted);
    font-size: 0.95rem;
}

.novel-show__stats svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: var(--show-surface);
}

.novel-show__stats strong {
    color: var(--show-accent);
    font-weight: 700;
}

.novel-show__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.novel-show__play,
.novel-show__latest,
.novel-show__quiet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 1 auto;
    min-height: 40px;
    padding: 8px 18px;
    border-radius: 4px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: filter 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.novel-show__play {
    background: var(--show-accent);
    color: #fff;
}

.novel-show__play:hover {
    color: #fff;
    filter: brightness(1.08);
}

.novel-show__latest {
    background: transparent;
    border-color: var(--show-accent);
    color: var(--show-accent);
}

.novel-show__latest:hover {
    background: color-mix(in srgb, var(--show-accent) 14%, transparent);
    color: var(--show-accent);
}

.novel-show__quiet {
    background: var(--show-quiet);
    color: var(--show-quiet-ink);
    border-color: var(--show-line);
}

.novel-show__quiet:hover {
    color: var(--show-quiet-ink);
    filter: brightness(0.97);
}

.novel-show__quiet svg {
    width: 16px;
    height: 16px;
}

.novel-show__facts {
    display: grid;
    gap: 8px;
    margin: 4px 0 0;
    font-size: inherit;
    opacity: 1;
    text-transform: none;
}

.novel-show__fact {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin: 0;
}

.novel-show__fact dt {
    margin: 0;
    color: var(--show-muted);
    font-size: 0.92rem;
    font-weight: 500;
}

.novel-show__fact dd {
    margin: 0;
    color: var(--show-surface);
    font-size: 0.95rem;
    line-height: 1.45;
}

.novel-show__fact dd a {
    color: var(--show-accent);
    text-decoration: none;
}

.novel-show__fact dd a:hover {
    text-decoration: underline;
}

.novel-show__sep {
    color: var(--show-muted);
}

.novel-show__desc {
    margin: 0;
    color: var(--show-desc);
    font-size: 0.95rem;
    line-height: 1.55;
}

.novel-show__desc.is-collapsed {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.novel-show__more {
    margin-top: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--show-surface);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.novel-show__more:hover {
    color: var(--show-accent);
}

.novel-page .col-inner:has(.novel-info--show) > .novel-episodes,
.novel-page:has(.novel-info--show) #myRating,
.novel-page .col-inner:has(.novel-info--show) > .novel-rail {
    position: relative;
    z-index: 1;
    margin-left: auto;
    margin-right: auto;
}

.novel-page .col-inner:has(.novel-info--show) > .novel-episodes {
    margin-top: 8px;
    margin-bottom: 24px;
}

.novel-page:has(.novel-info--show) #myRating {
    margin-top: 8px;
    margin-bottom: 24px;
    padding: 18px 24px;
    border-radius: 12px;
    color: var(--novel-ink);
}

.novel-page:has(.novel-info--show) .novel-rail__title,
.novel-page:has(.novel-info--show) .novel-rail :is(
    .comic-card-1__title,
    .comic-card-2__title,
    .comic-card-3__title,
    .comic-card-4__title,
    .comic-card-6__title,
    .comic-card-7__title,
    .comic-card-8__title,
    .tim-truyen-card__title,
    .comic-title-banner
) a {
    color: var(--show-surface);
}

.novel-page:has(.novel-info--show) .novel-rail :is(
    .comic-card-1__title,
    .comic-card-2__title,
    .comic-card-3__title,
    .comic-card-4__title,
    .comic-card-6__title,
    .comic-card-7__title,
    .comic-card-8__title,
    .tim-truyen-card__title,
    .comic-title-banner
) a:hover {
    color: var(--show-accent);
}

/* ---------- Danh sách chương: Tập ---------- */
.novel-episodes {
    color: var(--show-surface, #fff);
}

.novel-episodes__tabs {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin: 0 0 14px;
    border-bottom: 1px solid var(--show-line, #2a2a2a);
}

.novel-episodes__tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 10px 10px;
    color: var(--show-muted, #b3b3b3);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
}

.novel-episodes__tab.is-active {
    color: var(--show-accent, var(--primary-color));
}

.novel-episodes__tab.is-active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--show-accent, var(--primary-color));
}

.novel-episodes__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 14px 16px 8px;
    border-radius: 12px 12px 0 0;
    background: var(--show-card, #1c1c1c);
}

h2.novel-episodes__count {
    margin: 0;
    color: var(--show-surface, #fff);
    font-size: 1.05rem;
    font-weight: 700;
}

.novel-episodes__sort {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--show-surface, #fff);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.novel-episodes__sort span {
    white-space: nowrap;
}

.novel-episodes__sort svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.novel-episodes__list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 8px 8px 12px;
    list-style: none;
    border-radius: 0 0 12px 12px;
    background: var(--show-card, #1c1c1c);
}

.novel-episodes__item a {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 8px;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.novel-episodes__item a:hover {
    background: color-mix(in srgb, var(--show-surface, #fff) 6%, transparent);
}

.novel-episodes__thumb {
    display: block;
    overflow: hidden;
    width: 56px;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    background: #111;
}

.novel-episodes__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.novel-episodes__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.novel-episodes__name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: var(--show-surface, #fff);
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.35;
}

.novel-episodes__time {
    color: var(--show-muted, #b3b3b3);
    font-size: 0.82rem;
}

.novel-episodes__badge {
    justify-self: end;
    color: var(--show-accent, var(--primary-color));
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.novel-episodes__empty {
    margin: 0;
    padding: 24px 16px;
    border-radius: 12px;
    background: var(--show-card, #1c1c1c);
    color: var(--show-muted, #b3b3b3);
    text-align: center;
}

.novel-episodes__pages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 14px 0 0;
}

.novel-episodes__pages button {
    min-width: 36px;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid var(--show-line, #2a2a2a);
    border-radius: 8px;
    background: var(--show-card, #1c1c1c);
    color: var(--show-surface, #fff);
    cursor: pointer;
}

.novel-episodes__pages button.is-current,
.novel-episodes__pages button:hover:not(:disabled) {
    border-color: var(--show-accent, var(--primary-color));
    color: var(--show-accent, var(--primary-color));
}

.novel-episodes__pages button:disabled {
    opacity: 0.45;
    cursor: default;
}

.novel-episodes__pages .novel-episodes__gap {
    display: inline-flex;
    align-items: center;
    color: var(--show-muted, #b3b3b3);
}

@media (max-width: 1024px) {
    .novel-show {
        grid-template-columns: 180px minmax(0, 1fr);
        gap: 22px 24px;
        padding: 28px 20px 22px;
    }

    .novel-page .col-inner:has(.novel-info--show) > .novel-episodes,
    .novel-page:has(.novel-info--show) #myRating,
    .novel-page .col-inner:has(.novel-info--show) > .novel-rail {
        padding-left: 20px;
        padding-right: 20px;
    }

    .novel-page .col-inner:has(.novel-info--show) > .novel-episodes {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 720px) {
    .novel-info--show {
        margin: 0 -15px;
    }

    .novel-show__backdrop {
        height: min(88vw, 420px);
    }

    .novel-show__backdrop::after {
        background:
            linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--show-ink) 55%, transparent) 55%, var(--show-ink) 100%);
    }

    .novel-show {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 16px;
        padding: 24px 16px 18px;
        text-align: center;
    }

    .novel-show__topline {
        flex-direction: column;
        align-items: center;
    }

    .novel-show__topline .novel-theme-toggle {
        order: -1;
    }

    .novel-show__poster {
        width: min(148px, 42vw);
    }

    .novel-show__body {
        align-items: center;
        width: 100%;
        gap: 12px;
    }

    h1.novel-show__title {
        font-size: clamp(1.2rem, 5.2vw, 1.55rem);
    }

    .novel-show__stats {
        justify-content: center;
        gap: 6px 14px;
    }

    .novel-show__stats li {
        font-size: 0.86rem;
    }

    .novel-show__stats svg {
        width: 16px;
        height: 16px;
    }

    .novel-show__actions {
        width: 100%;
        justify-content: stretch;
        gap: 8px;
    }

    .novel-show__play,
    .novel-show__latest {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .novel-show__quiet {
        flex: 1 1 100%;
        min-width: 0;
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .novel-show__facts {
        width: 100%;
        text-align: left;
        gap: 6px;
    }

    .novel-show__fact {
        grid-template-columns: 78px minmax(0, 1fr);
        gap: 8px;
    }

    .novel-show__fact dt,
    .novel-show__fact dd,
    .novel-show__desc {
        font-size: 0.9rem;
    }

    .novel-show__desc.is-collapsed {
        -webkit-line-clamp: 4;
    }

    .novel-page .col-inner:has(.novel-info--show) > .novel-episodes,
    .novel-page:has(.novel-info--show) #myRating,
    .novel-page .col-inner:has(.novel-info--show) > .novel-rail {
        padding-left: 16px;
        padding-right: 16px;
    }

    .novel-page .col-inner:has(.novel-info--show) > .novel-episodes {
        margin-top: 4px;
        margin-bottom: 18px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .novel-page:has(.novel-info--show) #myRating {
        margin-top: 4px;
        margin-bottom: 18px;
        padding: 14px 16px;
        border-radius: 10px;
    }

    .novel-episodes__head {
        padding: 12px 12px 6px;
    }

    .novel-episodes__list {
        padding: 4px 6px 10px;
    }

    .novel-episodes__item a {
        grid-template-columns: 48px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 8px 6px;
    }

    .novel-episodes__thumb {
        width: 48px;
    }

    .novel-episodes__name {
        font-size: 0.9rem;
    }

    .novel-episodes__time {
        font-size: 0.78rem;
    }
}

@media (max-width: 480px) {
    .novel-show {
        padding: 20px 12px 16px;
        gap: 14px;
    }

    .novel-show__poster {
        width: min(132px, 40vw);
    }

    .novel-show__play,
    .novel-show__latest,
    .novel-show__quiet {
        letter-spacing: 0;
    }

    .novel-show__fact {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .novel-page .col-inner:has(.novel-info--show) > .novel-episodes,
    .novel-page:has(.novel-info--show) #myRating,
    .novel-page .col-inner:has(.novel-info--show) > .novel-rail {
        padding-left: 12px;
        padding-right: 12px;
    }

    .novel-page .col-inner:has(.novel-info--show) > .novel-episodes {
        padding-left: 12px;
        padding-right: 12px;
    }

    .novel-episodes__item a {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .novel-episodes__thumb {
        width: 44px;
    }

    .novel-episodes__badge {
        grid-column: 2;
        justify-self: start;
    }
}
