:root {
    --ink: #241d2b;
    --muted: #746b78;
    --paper: #fffdf9;
    --paper-2: #f7f0e8;
    --brand: #7a3f62;
    --brand-deep: #4c2440;
    --brand-soft: #efe0e9;
    --line: #e5d9df;
    --success: #2f7d5d;
    --warning: #a96519;
    --danger: #a53b4b;
    --shadow: 0 18px 55px rgba(63, 36, 55, .13);
    --radius: 22px;
    --shell: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 15% 10%, rgba(122, 63, 98, .08), transparent 32%),
        linear-gradient(180deg, #fffdf9 0%, #fbf7f3 100%);
    font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
    line-height: 1.75;
}

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

img {
    max-width: 100%;
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
.button {
    white-space: nowrap;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(122, 63, 98, .1);
    background: rgba(255, 253, 249, .88);
    backdrop-filter: blur(16px);
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: .06em;
}

.brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    flex-wrap: wrap;
}

.main-nav > a:not(.button) {
    color: var(--muted);
    font-weight: 700;
}

.nav-user {
    max-width: 180px;
    overflow: hidden;
    color: var(--brand-deep);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #fff;
    background: var(--brand);
    font-weight: 800;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(122, 63, 98, .24);
}

.button-small {
    min-height: 38px;
    padding: 7px 15px;
    font-size: .92rem;
}

.button-secondary {
    color: var(--brand-deep);
    border-color: var(--line);
    background: #fff;
}

.button-ghost {
    color: var(--brand-deep);
    border-color: rgba(122, 63, 98, .2);
    background: transparent;
}

.button-line {
    color: #fff;
    background: #06c755;
}

.button-danger {
    background: var(--danger);
}

.hero {
    padding: 72px 0 50px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
    align-items: center;
    gap: 54px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 4px 13px;
    border-radius: 999px;
    color: var(--brand-deep);
    background: var(--brand-soft);
    font-size: .9rem;
    font-weight: 800;
    letter-spacing: .08em;
}

.hero h1 {
    max-width: 760px;
    margin: 18px 0;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: clamp(2.4rem, 5vw, 5rem);
    line-height: 1.14;
    letter-spacing: -.025em;
}

.hero p {
    max-width: 680px;
    color: var(--muted);
    font-size: 1.1rem;
}

.hero-actions,
.toolbar-row,
.form-actions,
.filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-art {
    position: relative;
    min-height: 460px;
    padding: 24px;
    border: 1px solid rgba(122, 63, 98, .12);
    border-radius: 40px;
    background: linear-gradient(145deg, #f4e7ee, #fffaf4);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hero-art::after {
    position: absolute;
    right: -60px;
    bottom: -70px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(122, 63, 98, .12);
    content: "";
}

.hero-art img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-height: 410px;
    object-fit: contain;
}

.section {
    padding: 54px 0;
}

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

.section-heading h2,
.page-heading h1 {
    margin: 0;
    font-family: Georgia, "Noto Serif TC", serif;
    line-height: 1.25;
}

.section-heading p,
.page-heading p {
    color: var(--muted);
}

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

.story-card,
.panel,
.stat-card,
.comment-card,
.policy-card,
.admin-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 10px 32px rgba(54, 35, 49, .07);
}

.story-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.story-cover {
    aspect-ratio: 2 / 3;
    background: linear-gradient(135deg, #ead6e3, #f7ede0);
    overflow: hidden;
}

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

.story-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 22px;
}

.story-content h3 {
    margin: 8px 0;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: 1.35rem;
}

.story-content p {
    color: var(--muted);
}

.meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    color: var(--muted);
    font-size: .9rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 10px;
    border-radius: 999px;
    color: var(--brand-deep);
    background: var(--brand-soft);
    font-size: .82rem;
    font-weight: 800;
}

.badge-success {
    color: #225c45;
    background: #dff2e9;
}

.badge-warning {
    color: #7f4d14;
    background: #fff0d8;
}

.badge-danger {
    color: #812d3b;
    background: #f9dfe4;
}

.page-heading {
    padding: 48px 0 20px;
}

.panel {
    padding: 26px;
}

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

.field {
    display: grid;
    gap: 8px;
}

.field-full {
    grid-column: 1 / -1;
}

.field label {
    font-weight: 800;
}

.field small {
    color: var(--muted);
}

.input,
.textarea,
.select {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--ink);
    background: #fff;
    outline: none;
}

.input:focus,
.textarea:focus,
.select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(122, 63, 98, .09);
}

.textarea {
    min-height: 130px;
    resize: vertical;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 13px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: .88rem;
    letter-spacing: .04em;
}

.click-row {
    cursor: pointer;
}

.click-row:hover {
    background: #fffafc;
}

.empty-state {
    padding: 64px 24px;
    text-align: center;
}

.empty-state h1,
.empty-state h2 {
    font-family: Georgia, "Noto Serif TC", serif;
}

.novel-hero {
    display: grid;
    grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
    gap: 42px;
    align-items: start;
}

.novel-cover {
    overflow: hidden;
    border-radius: 28px;
    background: var(--paper-2);
    box-shadow: var(--shadow);
}

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

.chapter-list {
    display: grid;
    gap: 12px;
}

.chapter-item {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

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

.reader-header {
    padding: 48px 0 26px;
    text-align: center;
}

.cms-content {
    padding: 40px clamp(20px, 5vw, 64px);
    border: 1px solid var(--line);
    border-radius: 26px;
    background: #fff;
    box-shadow: var(--shadow);
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: clamp(1.08rem, 2vw, 1.22rem);
    line-height: 2.05;
    overflow-wrap: anywhere;
}

.cms-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 24px auto;
    border-radius: 14px;
}

.cms-content blockquote {
    margin: 24px 0;
    padding: 10px 20px;
    border-left: 4px solid var(--brand);
    color: var(--muted);
    background: var(--paper-2);
}

.comments-wrap {
    margin-top: 42px;
}

.comment-form {
    display: grid;
    gap: 12px;
    margin-bottom: 24px;
}

.comment-card {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 14px;
    padding: 18px;
}

.comment-card.is-reply {
    margin-left: 54px;
    background: #fffcfd;
}

.comment-card.is-pinned {
    border-color: rgba(122, 63, 98, .42);
    background: linear-gradient(120deg, #fff, #fbf2f7);
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--brand-soft);
}

.comment-head,
.comment-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.comment-head {
    justify-content: space-between;
}

.comment-text {
    margin: 8px 0 10px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.link-button {
    padding: 0;
    border: 0;
    color: var(--brand);
    background: transparent;
    font-weight: 800;
    cursor: pointer;
}

.policy-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 28px;
}

.policy-nav {
    position: sticky;
    top: 100px;
    align-self: start;
}

.policy-nav a {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
}

.policy-nav a:hover {
    background: var(--brand-soft);
}

.policy-scroll {
    max-height: 58vh;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    overflow-y: auto;
}

.policy-scroll h2,
.policy-scroll h3 {
    font-family: Georgia, "Noto Serif TC", serif;
}

.consent-box {
    margin-top: 18px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--paper-2);
}

.consent-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 1.08rem;
    font-weight: 800;
}

.consent-check input {
    width: 22px;
    height: 22px;
    margin-top: 4px;
}

.editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 24px;
    align-items: start;
}

.editor-main,
.editor-side {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.editor-main {
    overflow: hidden;
}

.editor-side {
    position: sticky;
    top: 100px;
    padding: 22px;
}

#editor {
    min-height: 560px;
    font-size: 1.08rem;
}

.ql-toolbar.ql-snow {
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    background: #fffafc;
}

.ql-container.ql-snow {
    border: 0 !important;
}

.ql-editor {
    min-height: 560px;
    line-height: 1.9;
}

.site-footer {
    margin-top: 68px;
    padding: 42px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    background: #f7f1ec;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    gap: 32px;
}

.footer-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.admin-shell {
    --admin-sidebar-width: 260px;
    display: grid;
    grid-template-columns: var(--admin-sidebar-width) minmax(0, 1fr);
    min-height: calc(100vh - 76px);
    transition: grid-template-columns .24s ease;
}

.admin-shell.is-sidebar-collapsed {
    --admin-sidebar-width: 86px;
}

.admin-sidebar {
    position: sticky;
    top: 76px;
    height: calc(100vh - 76px);
    padding: 18px;
    border-right: 1px solid var(--line);
    background: #2f2030;
    overflow-x: hidden;
    overflow-y: auto;
    transition: padding .24s ease;
}

.admin-sidebar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-height: 64px;
    margin-bottom: 14px;
}

.admin-sidebar-heading {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

.admin-sidebar-title-text {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.admin-sidebar h2 {
    margin: 0;
    color: #fff;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: 1.35rem;
}

.admin-role-label {
    margin-top: 3px;
    color: #cdbfca;
    font-size: .82rem;
    white-space: nowrap;
}

.admin-sidebar-compact-title {
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 11px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    font-weight: 900;
}

.admin-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 11px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.admin-sidebar-toggle:hover,
.admin-sidebar-toggle:focus-visible {
    background: rgba(255, 255, 255, .17);
}

.admin-sidebar-toggle-icon {
    display: block;
    font-size: 1.7rem;
    line-height: 1;
    transform: translateY(-1px);
}

.admin-sidebar-nav {
    display: grid;
    gap: 6px;
}

.admin-sidebar a {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 46px;
    padding: 8px 10px;
    border-radius: 12px;
    color: #e8dce4;
    overflow: hidden;
}

.admin-nav-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 9px;
    color: #f5edf2;
    background: rgba(255, 255, 255, .08);
    font-size: .88rem;
    font-weight: 900;
}

.admin-nav-text {
    min-width: 0;
    margin-left: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.admin-sidebar a.active .admin-nav-mark {
    color: #2f2030;
    background: #f6eaf1;
}

.admin-shell.is-sidebar-collapsed .admin-sidebar {
    padding-right: 14px;
    padding-left: 14px;
}

.admin-shell.is-sidebar-collapsed .admin-sidebar-head {
    align-items: center;
    flex-direction: column;
}

.admin-shell.is-sidebar-collapsed .admin-sidebar-title-text {
    display: none;
}

.admin-shell.is-sidebar-collapsed .admin-sidebar-compact-title {
    display: inline-flex;
}

.admin-shell.is-sidebar-collapsed .admin-sidebar-toggle-icon {
    transform: translateY(-1px) rotate(180deg);
}

.admin-shell.is-sidebar-collapsed .admin-sidebar a {
    justify-content: center;
    padding-right: 8px;
    padding-left: 8px;
}

.admin-shell.is-sidebar-collapsed .admin-nav-text {
    width: 0;
    margin-left: 0;
    opacity: 0;
}

.admin-content {
    min-width: 0;
    min-height: calc(100vh - 76px);
    padding: 34px 34px 64px;
}

.copy-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch;
}

.copy-field .input {
    min-width: 0;
    font-family: Consolas, "SFMono-Regular", monospace;
    font-size: .94rem;
}

.copy-help {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: .92rem;
}

.button.is-copy-success {
    color: #fff;
    border-color: var(--success);
    background: var(--success);
}

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

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

.stat-card {
    padding: 22px;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
}

.risk-meter {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #eee5e9;
    overflow: hidden;
}

.risk-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #d8a83a, #a53b4b);
}

.login-shell {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 76px);
    padding: 30px;
}

.login-card {
    width: min(100%, 520px);
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: #fff;
    box-shadow: var(--shadow);
}

.notice {
    padding: 14px 16px;
    border-radius: 14px;
    color: #65420f;
    background: #fff0d8;
}

@media (max-width: 980px) {
    .hero-grid,
    .novel-hero,
    .editor-layout,
    .policy-layout,
    .admin-shell {
        grid-template-columns: 1fr;
    }

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

    .admin-sidebar,
    .editor-side,
    .policy-nav {
        position: static;
        height: auto;
    }

    .admin-shell,
    .admin-shell.is-sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .admin-sidebar,
    .admin-shell.is-sidebar-collapsed .admin-sidebar {
        display: block;
        padding: 12px;
        border-right: 0;
        overflow-x: auto;
    }

    .admin-sidebar-head {
        display: none;
    }

    .admin-sidebar-nav {
        display: flex;
        gap: 8px;
        width: max-content;
    }

    .admin-sidebar a,
    .admin-shell.is-sidebar-collapsed .admin-sidebar a {
        flex: 0 0 auto;
        justify-content: flex-start;
        margin: 0;
        padding-right: 12px;
        padding-left: 10px;
        white-space: nowrap;
    }

    .admin-shell.is-sidebar-collapsed .admin-nav-text {
        width: auto;
        margin-left: 10px;
        opacity: 1;
    }
}

@media (max-width: 720px) {
    .header-inner,
    .footer-grid,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .main-nav {
        width: 100%;
        justify-content: flex-start;
        padding-bottom: 14px;
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .story-grid,
    .stats-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-top: 42px;
    }

    .hero-art {
        min-height: 340px;
    }

    .hero-art img {
        min-height: 300px;
    }

    .comment-card.is-reply {
        margin-left: 20px;
    }

    .copy-field {
        grid-template-columns: 1fr;
    }

    .copy-field .button {
        width: 100%;
    }

    .admin-content {
        padding: 22px 16px;
    }

    .cms-content {
        padding: 26px 20px;
    }
}

/* v0.3.0 小說分卷與大型工作視窗 */
.volume-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.volume-summary-card {
    display: grid;
    gap: 4px;
    padding: 22px;
}

.volume-summary-card strong {
    font-size: 2rem;
}

.volume-manager-list,
.volume-chapter-groups {
    display: grid;
    gap: 18px;
}

.volume-manager-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    padding: 22px;
}

.volume-manager-main {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 18px;
}

.volume-order-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    padding: 10px;
    border-radius: 16px;
    color: var(--brand);
    background: var(--brand-soft);
    font-weight: 900;
    text-align: center;
}

.volume-title-row,
.volume-group-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.volume-title-row h2,
.volume-group-heading h3 {
    margin: 0;
    font-family: Georgia, "Noto Serif TC", serif;
}

.volume-description {
    margin: 8px 0 12px;
    color: var(--muted);
}

.volume-description.is-empty {
    font-style: italic;
}

.volume-meta-row {
    justify-content: flex-start;
}

.volume-manager-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.volume-manager-actions form,
.volume-order-actions form {
    margin: 0;
}

.volume-order-actions {
    display: flex;
    gap: 6px;
}

.volume-group-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
}

.volume-group-heading {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: #fffafc;
}

.volume-group-heading p {
    width: 100%;
    margin: 4px 0 0;
    color: var(--muted);
}

.volume-group-card .table-wrap {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.workspace-modal[hidden] {
    display: none;
}

.workspace-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
}

.workspace-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(34, 22, 34, .62);
    backdrop-filter: blur(4px);
}

.workspace-modal-panel {
    position: relative;
    width: min(100%, 760px);
    max-height: min(88vh, 860px);
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, .36);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(35, 20, 35, .28);
    overflow-y: auto;
}

.workspace-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.workspace-modal-head h2 {
    margin: 4px 0 0;
    font-family: Georgia, "Noto Serif TC", serif;
}

.modal-close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--ink);
    background: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.workspace-modal-actions {
    justify-content: flex-end;
    margin-top: 24px;
}

body.has-workspace-modal {
    overflow: hidden;
}

@media (max-width: 900px) {
    .volume-summary-grid {
        grid-template-columns: 1fr;
    }

    .volume-manager-card {
        grid-template-columns: 1fr;
    }

    .volume-manager-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .volume-manager-main {
        grid-template-columns: 1fr;
    }

    .volume-order-mark {
        min-height: 0;
        justify-content: flex-start;
    }

    .workspace-modal {
        align-items: end;
        padding: 0;
    }

    .workspace-modal-panel {
        width: 100%;
        max-height: 92vh;
        padding: 22px 18px;
        border-radius: 24px 24px 0 0;
    }
}

.table-action-row {
    justify-content: flex-end;
    min-width: 250px;
}

.table-action-row .button {
    white-space: nowrap;
}

@media (max-width: 720px) {
    .table-action-row {
        justify-content: flex-start;
        min-width: 0;
    }
}

/* v0.3.0 封面、閱讀器、版本紀錄與段落評論 */
.novel-edit-grid {
    display: grid;
    grid-template-columns: minmax(220px, 310px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.cover-editor-card {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 14px;
    min-width: 0;
}

.cover-preview,
.author-novel-cover {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(135deg, #ead6e3, #f7ede0);
}

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

.cover-remove-option {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--muted);
    line-height: 1.55;
}

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

.author-novel-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 22px;
    padding: 18px;
    overflow: hidden;
}

.author-novel-card-body {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.author-novel-card-heading h2 {
    margin: 10px 0 8px;
    font-family: Georgia, "Noto Serif TC", serif;
}

.author-novel-card-body > p {
    color: var(--muted);
}

.author-novel-meta {
    justify-content: flex-start;
    margin: auto 0 10px;
}

.author-novel-actions {
    margin-top: 16px;
}

.novel-public-title {
    margin: 12px 0;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: clamp(2rem, 5vw, 3.7rem);
    line-height: 1.15;
}

.novel-synopsis {
    color: var(--muted);
    line-height: 1.9;
}

.novel-author-block {
    justify-content: flex-start;
    margin: 26px 0 18px;
}

.novel-public-meta {
    justify-content: flex-start;
}

.novel-start-actions {
    margin-top: 22px;
}

.public-volume-list {
    display: grid;
    gap: 22px;
}

.public-volume-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 10px 32px rgba(54, 35, 49, .06);
}

.public-volume-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--line);
    background: #fffafc;
}

.public-volume-heading h3 {
    margin: 4px 0 0;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: 1.42rem;
}

.public-volume-heading p {
    margin: 8px 0 0;
    color: var(--muted);
}

.public-volume-card .chapter-list {
    padding: 16px;
}

.revision-list {
    display: grid;
    gap: 12px;
}

.revision-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.revision-item p {
    margin: 4px 0 0;
    color: var(--muted);
}

.reader-page {
    background: #f5f2ef;
}

.reader-page .site-header,
.reader-page .site-footer {
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.reader-shell {
    position: relative;
    padding-bottom: 30px;
}

.reader-breadcrumbs,
.reader-top-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.reader-header h1 {
    margin: 18px 0 10px;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: clamp(1.8rem, 5vw, 3rem);
}

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

.reader-settings-panel {
    margin-bottom: 20px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shadow);
}

.reader-settings-panel[hidden] {
    display: none;
}

.reader-settings-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.reader-settings-heading p {
    margin: 4px 0 0;
    color: var(--muted);
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--ink);
    background: #fff;
    font-size: 1.65rem;
    line-height: 1;
    cursor: pointer;
}

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

.reader-settings-grid label {
    display: grid;
    gap: 8px;
    font-weight: 800;
}

.reader-settings-grid input[type="range"] {
    width: 100%;
}

.reader-speech-status {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--muted);
    background: var(--paper-2);
}

.reader-content {
    font-size: var(--reader-font-size, 21px);
    line-height: var(--reader-line-height, 2);
    transition: color .2s ease, background .2s ease, border-color .2s ease;
}

.reader-shell[data-reader-theme="sepia"] .reader-content,
.reader-shell[data-reader-theme="sepia"] .reader-settings-panel {
    color: #3f3228;
    border-color: #d7c7b5;
    background: #f5ead8;
}

.reader-shell[data-reader-theme="dark"] .reader-content,
.reader-shell[data-reader-theme="dark"] .reader-settings-panel {
    color: #e9e6e8;
    border-color: #4c444c;
    background: #252125;
}

.reader-shell[data-reader-theme="dark"] .reader-content blockquote,
.reader-shell[data-reader-theme="dark"] .reader-speech-status {
    color: #cdc4cb;
    background: #332d33;
}

.reader-shell[data-reader-theme="dark"] .select,
.reader-shell[data-reader-theme="dark"] .icon-button {
    color: #ece8eb;
    border-color: #5e555e;
    background: #332d33;
}

.story-segment {
    position: relative;
    padding-right: 54px;
}

.story-segment .segment-comment-trigger {
    position: absolute;
    top: .25em;
    right: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 30px;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--muted);
    background: transparent;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    opacity: .58;
    transition: opacity .2s ease, color .2s ease, border-color .2s ease, background .2s ease;
}

.story-segment:hover .segment-comment-trigger,
.segment-comment-trigger:focus-visible,
.segment-comment-trigger:has([data-segment-count]:not(:empty)) {
    opacity: 1;
}

.segment-comment-trigger:hover,
.segment-comment-trigger:focus-visible {
    color: var(--brand);
    border-color: var(--line);
    background: #fff7fb;
}

.segment-comment-trigger [data-segment-count] {
    min-width: 18px;
    text-align: center;
}

.reader-chapter-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.reader-nav-link {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.reader-nav-link span {
    color: var(--muted);
    font-size: .86rem;
}

.reader-nav-link strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reader-nav-link.is-next {
    text-align: right;
}

.reader-nav-link.is-disabled {
    opacity: .55;
}

.reader-floating-listen {
    position: fixed;
    right: max(20px, calc((100vw - 900px) / 2));
    bottom: 26px;
    z-index: 760;
    width: 66px;
    height: 66px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: #5d555b;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .2);
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: 1.35rem;
    font-weight: 900;
    cursor: pointer;
}

.segment-comment-layer[hidden] {
    display: none;
}

.segment-comment-layer {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: grid;
    align-items: end;
}

.segment-comment-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(22, 17, 21, .58);
    backdrop-filter: blur(3px);
}

.segment-comment-drawer {
    position: relative;
    width: min(100%, 880px);
    max-height: 86vh;
    margin: 0 auto;
    padding: 24px clamp(18px, 4vw, 34px) 28px;
    border-radius: 26px 26px 0 0;
    background: #fff;
    box-shadow: 0 -20px 60px rgba(30, 20, 29, .24);
    overflow-y: auto;
}

.segment-comment-drawer-head {
    position: sticky;
    top: -24px;
    z-index: 4;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin: -24px clamp(-34px, -4vw, -18px) 18px;
    padding: 22px clamp(18px, 4vw, 34px) 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(8px);
}

.segment-comment-drawer-head h2 {
    margin: 4px 0 0;
    font-family: Georgia, "Noto Serif TC", serif;
}

.segment-comment-quote {
    margin: 0 0 20px;
    padding: 14px 18px;
    border-left: 4px solid var(--brand);
    border-radius: 0 12px 12px 0;
    color: var(--muted);
    background: var(--paper-2);
    white-space: pre-wrap;
}

.segment-comment-list {
    min-height: 120px;
}

.segment-comment-list .comment-card {
    box-shadow: none;
}

.segment-comment-form {
    position: sticky;
    bottom: -28px;
    z-index: 5;
    display: grid;
    gap: 10px;
    margin: 20px clamp(-34px, -4vw, -18px) -28px;
    padding: 18px clamp(18px, 4vw, 34px) 24px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .98);
}

.segment-login-box {
    margin-top: 18px;
    padding: 18px;
    border-radius: 16px;
    text-align: center;
    background: var(--paper-2);
}

.compact-empty {
    padding: 30px 18px;
}

body.segment-comments-open,
body.manual-copy-open {
    overflow: hidden;
}

.manual-copy-layer {
    position: fixed;
    inset: 0;
    z-index: 1900;
    display: grid;
    place-items: center;
    padding: 18px;
}

.manual-copy-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(25, 17, 24, .62);
}

.manual-copy-dialog {
    position: relative;
    width: min(100%, 640px);
    padding: 24px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 22px 70px rgba(0, 0, 0, .24);
}

.manual-copy-dialog h2 {
    margin-top: 0;
    font-family: Georgia, "Noto Serif TC", serif;
}

.manual-copy-dialog textarea {
    min-height: 150px;
    font-family: Consolas, "SFMono-Regular", monospace;
}

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

    .cover-editor-card {
        position: static;
        grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
        align-items: start;
    }

    .cover-editor-card > label:first-child,
    .cover-editor-card > small,
    .cover-editor-card > .notice,
    .cover-remove-option {
        grid-column: 2;
    }

    .cover-preview {
        grid-row: 1 / span 5;
    }

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

@media (max-width: 720px) {
    .cover-editor-card,
    .author-novel-card,
    .reader-settings-grid,
    .reader-chapter-navigation {
        grid-template-columns: 1fr;
    }

    .cover-editor-card > label:first-child,
    .cover-editor-card > small,
    .cover-editor-card > .notice,
    .cover-remove-option,
    .cover-preview {
        grid-column: auto;
        grid-row: auto;
    }

    .cover-preview {
        width: min(100%, 280px);
        margin: 0 auto;
    }

    .author-novel-cover {
        width: min(100%, 220px);
        margin: 0 auto;
    }

    .reader-shell {
        width: min(calc(100% - 20px), 820px);
    }

    .reader-header {
        padding-top: 28px;
    }

    .reader-content {
        padding: 28px 18px;
        border-radius: 20px;
    }

    .story-segment {
        padding-right: 0;
        padding-bottom: 18px;
    }

    .story-segment .segment-comment-trigger {
        top: auto;
        right: 0;
        bottom: -2px;
        opacity: .82;
    }

    .reader-nav-link.is-next {
        text-align: left;
    }

    .reader-floating-listen {
        right: 18px;
        bottom: 20px;
        width: 58px;
        height: 58px;
    }

    .segment-comment-drawer {
        max-height: 92vh;
        border-radius: 22px 22px 0 0;
    }

    .segment-comment-drawer .comment-card {
        grid-template-columns: 40px minmax(0, 1fr);
        padding: 14px 10px;
    }

    .segment-comment-drawer .avatar {
        width: 40px;
        height: 40px;
    }

    .revision-item,
    .public-volume-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* v0.3.1 作者作品頁固定儲存按鈕 */
.novel-edit-form {
    padding-bottom: 112px;
}

.novel-save-dock {
    position: fixed;
    right: clamp(18px, 3vw, 38px);
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    z-index: 1080;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
}

.novel-save-button {
    min-width: 168px;
    min-height: 52px;
    padding-inline: 24px;
    border: 1px solid rgba(255, 255, 255, .55);
    box-shadow: 0 16px 38px rgba(72, 24, 44, .28);
    white-space: nowrap;
    pointer-events: auto;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.novel-save-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 46px rgba(72, 24, 44, .34);
}

.novel-save-button:disabled,
.novel-save-button.is-saving {
    cursor: wait;
    opacity: .78;
    transform: none;
}

.button-spinner {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, .42);
    border-top-color: #fff;
    border-radius: 50%;
    animation: novel-save-spin .75s linear infinite;
}

@keyframes novel-save-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 720px) {
    .novel-edit-form {
        padding-bottom: 106px;
    }

    .novel-save-dock {
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    }

    .novel-save-button {
        min-width: 152px;
        min-height: 50px;
        padding-inline: 20px;
    }
}


/* v0.4.0 章節防複製、前台身分與簡介收合 */
.reader-content.is-copy-protected {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.reader-content.is-copy-protected img {
    -webkit-user-drag: none;
    user-drag: none;
}

.reader-content.is-copy-protected .segment-comment-trigger,
.reader-content.is-copy-protected a,
.reader-content.is-copy-protected button {
    -webkit-user-select: none;
    user-select: none;
}

.novel-synopsis-wrap.is-collapsible .novel-synopsis {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    max-height: calc(1.9em * 4);
}

.novel-synopsis-wrap.is-collapsible.is-expanded .novel-synopsis {
    display: block;
    overflow: visible;
    max-height: none;
    -webkit-line-clamp: unset;
}

.synopsis-toggle {
    margin-top: 8px;
    font-weight: 700;
}

.public-profile-grid {
    align-items: start;
}

.public-profile-preview {
    text-align: center;
}

.public-profile-avatar {
    width: 118px;
    height: 118px;
    margin: 18px auto 12px;
    border: 4px solid #fff;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 12px 32px rgba(72, 24, 44, .16);
}

.admin-user-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 260px;
}

.admin-user-identity .avatar {
    flex: 0 0 auto;
}

@media (max-width: 720px) {
    .novel-synopsis-wrap.is-collapsible .novel-synopsis {
        -webkit-line-clamp: 3;
        max-height: calc(1.9em * 3);
    }

    .public-profile-grid {
        grid-template-columns: 1fr;
    }
}


/* v0.4.0 會員個人語音 API */
.personal-tts-form [hidden] {
    display: none !important;
}

.password-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-field .input {
    min-width: 0;
    flex: 1 1 auto;
}

.personal-tts-reader-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 12px 14px;
    border: 1px solid rgba(126, 67, 88, .15);
    border-radius: 12px;
    background: rgba(255, 255, 255, .55);
    font-size: .92rem;
}

.personal-tts-reader-note a {
    font-weight: 700;
}

@media (max-width: 720px) {
    .personal-tts-reader-note {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* =========================================================
 * v0.4.0：固定編輯工具列、收合評論、閱讀菜單與首頁輪播
 * 修改日期：2026/07/25 12:21（UTC+8）
 * ========================================================= */

.editor-main {
    overflow: visible;
}

.editor-main .ql-toolbar.ql-snow {
    position: sticky;
    top: 74px;
    z-index: 120;
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 8px 20px rgba(52, 36, 48, .08);
}

.editor-main .ql-container.ql-snow {
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
}

.chapter-image-tools .button {
    width: 100%;
    justify-content: center;
}

.segment-comment-composer {
    position: sticky;
    bottom: -28px;
    z-index: 5;
    margin: 20px clamp(-34px, -4vw, -18px) -28px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .98);
}

.segment-comment-composer-toggle {
    display: flex;
    width: 100%;
    min-height: 70px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px clamp(18px, 4vw, 34px) 22px;
    border: 0;
    color: var(--ink);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.segment-comment-composer-toggle span {
    font-weight: 900;
}

.segment-comment-composer-toggle small {
    color: var(--muted);
}

.segment-comment-form {
    position: static;
    margin: 0;
    padding: 18px clamp(18px, 4vw, 34px) 24px;
}

.segment-comment-form[hidden],
.segment-comment-composer-toggle[hidden] {
    display: none;
}

.reader-shell {
    width: min(calc(100% - 32px), var(--reader-content-width, 820px));
    transition: width .2s ease;
}

.reader-settings-panel {
    position: fixed;
    top: 88px;
    left: 18px;
    z-index: 920;
    width: min(390px, calc(100vw - 36px));
    max-height: calc(100vh - 112px);
    margin: 0;
    overflow-y: auto;
}

.reader-color-input {
    width: 100%;
    min-height: 46px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.reader-floating-settings {
    position: fixed;
    left: max(20px, calc((100vw - var(--reader-content-width, 820px)) / 2 - 92px));
    bottom: 26px;
    z-index: 760;
    min-width: 66px;
    height: 66px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: var(--brand);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .2);
    font-size: .92rem;
    font-weight: 900;
    cursor: pointer;
}

.reader-shell[data-reader-font="serif"] .reader-content {
    font-family: Georgia, "Noto Serif TC", "Times New Roman", serif;
}

.reader-shell[data-reader-font="sans"] .reader-content {
    font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}

.reader-shell[data-reader-font="kai"] .reader-content {
    font-family: "DFKai-SB", "BiauKai", "KaiTi", serif;
}

.reader-shell[data-reader-font="system"] .reader-content {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.reader-content p,
.reader-content blockquote,
.reader-content ul,
.reader-content ol {
    margin-top: 0;
    margin-bottom: var(--reader-paragraph-gap, 1.2em);
}

.reader-shell.reader-indent-enabled .reader-content p {
    text-indent: 2em;
}

.reader-shell[data-reader-theme="custom"] .reader-content {
    color: var(--reader-custom-text, #1f1720);
    background: var(--reader-custom-background, #fff);
}

.reader-shell.reader-hide-segment-comments .segment-comment-trigger {
    display: none !important;
}

.reader-shell.reader-hide-segment-comments .story-segment {
    padding-right: 0;
    padding-bottom: 0;
}

.reader-shell.reader-hide-chapter-comments [data-chapter-comments-section] {
    display: none;
}

.homepage-carousel {
    position: relative;
    min-height: clamp(480px, 56vw, 720px);
    overflow: hidden;
    color: #fff;
    background: #2b2028;
}

.homepage-carousel-track,
.homepage-carousel-slide {
    position: absolute;
    inset: 0;
}

.homepage-carousel-slide {
    display: grid;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    background-image:
        linear-gradient(
            rgba(24, 16, 22, var(--homepage-slide-overlay, .35)),
            rgba(24, 16, 22, var(--homepage-slide-overlay, .35))
        ),
        var(--homepage-slide-image);
    background-position: center;
    background-size: cover;
    transition: opacity .55s ease, visibility .55s ease;
}

.homepage-carousel-slide.is-active {
    opacity: 1;
    visibility: visible;
}

.homepage-carousel-content {
    display: flex;
    max-width: 780px;
    min-height: clamp(480px, 56vw, 720px);
    flex-direction: column;
    justify-content: center;
    padding-top: 80px;
    padding-bottom: 80px;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .42);
}

.homepage-carousel-position-center .homepage-carousel-content {
    align-items: center;
    margin: 0 auto;
    text-align: center;
}

.homepage-carousel-position-right .homepage-carousel-content {
    align-items: flex-end;
    margin-left: auto;
    text-align: right;
}

.homepage-carousel-content h1 {
    margin: 14px 0 16px;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: clamp(2.25rem, 6vw, 5rem);
    line-height: 1.08;
}

.homepage-carousel-content p {
    max-width: 720px;
    margin: 0;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.8;
}

.homepage-carousel-arrow {
    position: absolute;
    top: 50%;
    z-index: 5;
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 50%;
    color: #fff;
    background: rgba(20, 14, 18, .38);
    font-size: 2rem;
    cursor: pointer;
    transform: translateY(-50%);
}

.homepage-carousel-arrow.is-previous {
    left: 22px;
}

.homepage-carousel-arrow.is-next {
    right: 22px;
}

.homepage-carousel-dots {
    position: absolute;
    left: 50%;
    bottom: 24px;
    z-index: 5;
    display: flex;
    gap: 9px;
    transform: translateX(-50%);
}

.homepage-carousel-dot {
    width: 11px;
    height: 11px;
    padding: 0;
    border: 1px solid #fff;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.homepage-carousel-dot.is-active {
    background: #fff;
}

.homepage-slide-admin-list {
    display: grid;
    gap: 22px;
    margin-top: 22px;
}

.homepage-slide-admin-card {
    position: relative;
    overflow: hidden;
}

.homepage-slide-admin-preview {
    display: block;
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

.homepage-slide-delete-form {
    padding: 0 24px 24px;
}

.compact-heading {
    margin-bottom: 18px;
}

@media (max-width: 720px) {
    .editor-main .ql-toolbar.ql-snow {
        top: 62px;
        overflow-x: auto;
        white-space: nowrap;
    }

    .reader-settings-panel {
        top: auto;
        right: 10px;
        bottom: 10px;
        left: 10px;
        width: auto;
        max-height: 82vh;
        border-radius: 24px;
    }

    .reader-floating-settings,
    .reader-floating-listen {
        bottom: max(18px, env(safe-area-inset-bottom));
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
        transition:
            opacity .18s ease,
            transform .18s ease,
            visibility 0s linear 0s;
        will-change: opacity, transform;
    }

    .reader-floating-settings {
        left: 14px;
        height: 58px;
        min-width: 58px;
    }

    .reader-floating-listen {
        right: 14px;
        width: 58px;
        height: 58px;
    }

    .reader-shell.reader-mobile-controls-hidden .reader-floating-settings,
    .reader-shell.reader-mobile-controls-hidden .reader-floating-listen {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(18px) scale(.94);
        transition:
            opacity .18s ease,
            transform .18s ease,
            visibility 0s linear .18s;
    }

    .homepage-carousel,
    .homepage-carousel-content {
        min-height: 560px;
    }

    .homepage-carousel-content {
        align-items: flex-start !important;
        padding-right: 30px;
        padding-left: 30px;
        text-align: left !important;
    }

    .homepage-carousel-arrow {
        top: auto;
        bottom: 18px;
        width: 44px;
        height: 44px;
    }

    .homepage-carousel-arrow.is-previous {
        left: 18px;
    }

    .homepage-carousel-arrow.is-next {
        right: 18px;
    }

    .homepage-carousel-dots {
        bottom: 34px;
    }

    .segment-comment-composer-toggle {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}

.chapter-schedule-time {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    white-space: nowrap;
}

/* v0.5.0 小說探索首頁、分類、收藏、評分、搜尋與排行榜 */
.discovery-hero {
    padding: 56px 0 28px;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(circle at 10% 15%, rgba(191, 133, 166, .16), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(250, 246, 244, .72));
}

.discovery-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 620px);
    align-items: end;
    gap: 34px;
}

.discovery-hero h1 {
    margin: 10px 0 12px;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: clamp(2.1rem, 4vw, 4rem);
    line-height: 1.08;
}

.discovery-hero p {
    max-width: 680px;
    margin: 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.8;
}

.discovery-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 12px 34px rgba(54, 35, 49, .08);
}

.discovery-search-form .input {
    border: 0;
    background: transparent;
}

.category-chip-row {
    display: flex;
    gap: 10px;
    margin-top: 26px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.category-chip {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    background: rgba(255, 255, 255, .84);
    font-weight: 750;
    white-space: nowrap;
}

.category-chip:hover,
.category-chip.is-active {
    border-color: var(--brand);
    color: #fff;
    background: var(--brand);
}

.category-chip.is-search {
    margin-left: auto;
}

.homepage-carousel-compact {
    width: min(1320px, calc(100% - 40px));
    min-height: 280px;
    margin: 28px auto 0;
    border-radius: 28px;
    box-shadow: 0 18px 48px rgba(45, 28, 40, .12);
}

.homepage-carousel-compact .homepage-carousel-content {
    min-height: 280px;
    padding-top: 42px;
    padding-bottom: 42px;
}

.homepage-carousel-compact .homepage-carousel-content h2 {
    max-width: 760px;
    margin: 8px 0 10px;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: clamp(1.75rem, 3vw, 3rem);
    line-height: 1.15;
}

.homepage-carousel-compact .homepage-carousel-content p {
    max-width: 680px;
    font-size: 1rem;
}

.discovery-dashboard {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 34px;
}

.discovery-story-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.discovery-story-card {
    position: relative;
}

.story-status-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 5px 10px;
    border-radius: 999px;
    color: #fff;
    background: rgba(31, 23, 32, .78);
    font-size: .76rem;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.story-card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.rating-summary {
    color: #9a6225;
    font-size: .86rem;
    font-weight: 850;
    white-space: nowrap;
}

.rating-summary.is-empty {
    color: var(--muted);
    font-weight: 650;
}

.story-card-metrics {
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 16px;
}

.latest-chapter-link {
    display: block;
    margin-top: 12px;
    color: var(--brand-deep);
    font-size: .88rem;
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-board {
    position: sticky;
    top: 92px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 12px 36px rgba(54, 35, 49, .08);
}

.ranking-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
    padding: 5px;
    border-radius: 16px;
    background: var(--brand-soft);
}

.ranking-tab {
    min-height: 42px;
    padding: 8px 10px;
    border: 0;
    border-radius: 12px;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.ranking-tab.is-active {
    color: #fff;
    background: var(--brand);
    box-shadow: 0 6px 18px rgba(127, 55, 96, .2);
}

.ranking-explain {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: .84rem;
}

.ranking-panel {
    min-height: 420px;
}

.ranking-item {
    display: grid;
    grid-template-columns: 34px 48px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    color: inherit;
}

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

.ranking-item:hover strong {
    color: var(--brand-deep);
}

.ranking-position {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    color: var(--muted);
    background: #f4eff2;
    font-weight: 900;
}

.ranking-position.is-top {
    color: #fff;
    background: var(--brand);
}

.ranking-item img {
    width: 48px;
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    object-fit: cover;
}

.ranking-copy {
    min-width: 0;
}

.ranking-copy strong,
.ranking-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-copy small {
    margin-top: 4px;
    color: var(--muted);
}

.ranking-empty {
    padding: 48px 18px;
    color: var(--muted);
    text-align: center;
}

.section-soft {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: rgba(246, 240, 244, .58);
}

.text-link {
    color: var(--brand-deep);
    font-weight: 800;
    white-space: nowrap;
}

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

.recent-update-item {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 13px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    color: inherit;
    background: rgba(255, 255, 255, .9);
}

.recent-update-item img {
    grid-row: 1 / span 2;
    width: 54px;
    aspect-ratio: 2 / 3;
    border-radius: 9px;
    object-fit: cover;
}

.recent-update-copy {
    min-width: 0;
}

.recent-update-copy strong,
.recent-update-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-update-copy span,
.recent-update-meta {
    margin-top: 4px;
    color: var(--muted);
    font-size: .85rem;
}

.recent-update-meta {
    grid-column: 2;
}

.discovery-completed-grid,
.search-story-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.member-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 28px 32px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: linear-gradient(135deg, #fff, var(--brand-soft));
}

.member-callout h2 {
    margin: 7px 0 0;
    font-family: Georgia, "Noto Serif TC", serif;
}

.discovery-filter-form {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(150px, 1fr)) auto;
    align-items: end;
    gap: 14px;
    padding: 20px;
    margin-bottom: 28px;
}

.filter-submit-field .button {
    width: 100%;
}

.search-result-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 20px;
}

.search-result-heading h2 {
    margin: 0;
}

.search-result-heading span {
    color: var(--muted);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination a {
    display: grid;
    min-width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: #fff;
    font-weight: 800;
}

.pagination a.active,
.pagination a:hover {
    border-color: var(--brand);
    color: #fff;
    background: var(--brand);
}

.novel-interactions {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(280px, 1fr);
    align-items: center;
    gap: 20px;
    margin: 22px 0 4px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, .72);
}

.novel-favorite-block,
.novel-rating-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.novel-rating-block {
    justify-content: flex-end;
    flex-wrap: wrap;
}

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

.interaction-count,
.novel-rating-summary span,
.novel-rating-block small {
    color: var(--muted);
    font-size: .86rem;
}

.novel-rating-summary strong,
.novel-rating-summary span {
    display: block;
}

.rating-stars {
    display: flex;
    gap: 3px;
}

.rating-stars button {
    padding: 2px;
    border: 0;
    color: #c9bec5;
    background: transparent;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.rating-stars button.is-active {
    color: #d79932;
}

.rating-stars button:disabled {
    cursor: wait;
    opacity: .65;
}

.category-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
    gap: 24px;
}

.category-list-card,
.category-edit-card {
    padding: 24px;
}

.category-edit-card {
    position: sticky;
    top: 24px;
}

.category-action-row {
    flex-wrap: wrap;
}

.category-action-row form {
    margin: 0;
}

@media (max-width: 1120px) {
    .discovery-completed-grid,
    .search-story-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

@media (max-width: 980px) {
    .discovery-hero-grid,
    .discovery-dashboard,
    .category-admin-grid {
        grid-template-columns: 1fr;
    }

    .ranking-board,
    .category-edit-card {
        position: static;
    }

    .category-chip.is-search {
        margin-left: 0;
    }

    .discovery-completed-grid,
    .search-story-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .discovery-hero {
        padding-top: 34px;
    }

    .discovery-search-form {
        grid-template-columns: 1fr;
    }

    .discovery-search-form .button {
        width: 100%;
    }

    .homepage-carousel-compact,
    .homepage-carousel-compact .homepage-carousel-content {
        min-height: 340px;
    }

    .homepage-carousel-compact {
        width: calc(100% - 24px);
        border-radius: 22px;
    }

    .homepage-carousel-compact .homepage-carousel-content {
        padding: 44px 28px 74px;
    }

    .discovery-story-grid,
    .discovery-completed-grid,
    .search-story-grid,
    .recent-update-list,
    .discovery-filter-form {
        grid-template-columns: 1fr;
    }

    .ranking-board {
        padding: 18px;
    }

    .ranking-tabs {
        overflow-x: auto;
    }

    .ranking-tab {
        min-width: 88px;
    }

    .member-callout,
    .novel-interactions,
    .novel-favorite-block,
    .novel-rating-block {
        align-items: stretch;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .member-callout .button,
    .novel-favorite-block .button,
    .novel-favorite-block a {
        width: 100%;
    }

    .novel-rating-block {
        justify-content: flex-start;
    }

    .search-result-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

.discovery-hero-actions {
    margin-top: 18px;
}

.discovery-dashboard.is-ranking-only {
    grid-template-columns: minmax(360px, 760px);
    justify-content: center;
}

.section-intro-text {
    margin: -6px 0 18px;
    color: var(--muted);
}

/* v0.6.0 資料庫空間監測與章節版本保留 */
.stat-card-link {
    display: block;
    color: inherit;
    transition: transform .18s ease, box-shadow .18s ease;
}

.stat-card-link:hover,
.stat-card-link:focus-visible {
    color: inherit;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card-link small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.database-warning-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 14px;
    border-radius: 999px;
    font-weight: 900;
    white-space: nowrap;
}

.database-warning-badge.is-safe,
.database-warning-badge.is-notice {
    color: #225c45;
    background: #dff2e9;
}

.database-warning-badge.is-warning {
    color: #7f4d14;
    background: #fff0d8;
}

.database-warning-badge.is-danger,
.database-warning-badge.is-critical {
    color: #812d3b;
    background: #f9dfe4;
}

.database-capacity-card {
    padding: 26px;
}

.database-capacity-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.database-capacity-heading strong {
    font-size: 1.25rem;
}

.database-capacity-heading p {
    margin: 6px 0 0;
    color: var(--muted);
}

.database-capacity-number {
    flex: 0 0 auto;
    font-size: 1.25rem;
    font-weight: 900;
    white-space: nowrap;
}

.database-capacity-number span {
    color: var(--muted);
    font-size: .95rem;
    font-weight: 700;
}

.database-capacity-meter {
    width: 100%;
    height: 18px;
    margin-top: 22px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f5eff2;
    overflow: hidden;
}

.database-capacity-meter span {
    display: block;
    min-width: 2px;
    height: 100%;
    border-radius: inherit;
    background: #6d9f86;
    transition: width .3s ease;
}

.database-capacity-meter.is-warning span,
.database-capacity-meter.is-notice span {
    background: #d89c47;
}

.database-capacity-meter.is-danger span,
.database-capacity-meter.is-critical span {
    background: #c94f65;
}

.database-capacity-scale {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 9px;
    color: var(--muted);
    font-size: .9rem;
}

.database-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.database-control-grid {
    margin-top: 26px;
}

.database-revision-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.database-revision-summary > div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--paper-2);
}

.database-revision-summary span,
.database-revision-summary strong {
    display: block;
}

.database-revision-summary span {
    color: var(--muted);
    font-size: .86rem;
}

.database-revision-summary strong {
    margin-top: 5px;
    font-size: 1.25rem;
}

.database-cleanup-details {
    margin-top: 16px;
}

.database-cleanup-details > summary {
    width: fit-content;
    list-style: none;
    cursor: pointer;
}

.database-cleanup-details > summary::-webkit-details-marker {
    display: none;
}

.database-cleanup-form {
    margin-top: 14px;
    padding: 18px;
}

.database-table-list tr.is-growth-table td:first-child strong::after {
    content: "需留意";
    display: inline-flex;
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    color: #7f4d14;
    background: #fff0d8;
    font-size: .72rem;
    font-weight: 800;
    vertical-align: middle;
}

@media (max-width: 900px) {
    .database-capacity-heading {
        flex-direction: column;
    }

    .database-capacity-number {
        white-space: normal;
    }

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

@media (max-width: 560px) {
    .database-capacity-card {
        padding: 20px;
    }

    .database-capacity-scale {
        flex-direction: column;
        gap: 3px;
    }

    .database-stats-grid,
    .database-revision-summary {
        grid-template-columns: 1fr;
    }
}

/* v0.6.0 段落私人筆記 */
.story-segment {
    padding-right: 108px;
}

.story-segment .segment-action-stack {
    position: absolute;
    top: .25em;
    right: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.story-segment .segment-action-stack .segment-comment-trigger,
.story-segment .segment-action-stack .segment-note-trigger {
    position: static;
}

.story-segment .segment-note-trigger {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--muted);
    background: transparent;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    opacity: .58;
    transition: opacity .2s ease, color .2s ease, border-color .2s ease, background .2s ease;
}

.story-segment:hover .segment-note-trigger,
.segment-note-trigger:focus-visible {
    opacity: 1;
}

.segment-note-trigger:hover,
.segment-note-trigger:focus-visible {
    color: var(--brand);
    border-color: var(--line);
    background: #fff7fb;
}

.reader-content.is-copy-protected .segment-note-trigger {
    -webkit-user-select: none;
    user-select: none;
}

.reader-shell.reader-hide-segment-comments .story-segment {
    padding-right: 54px;
}

.reader-note-layer {
    position: fixed;
    inset: 0;
    z-index: 1880;
}

.reader-note-layer[hidden] {
    display: none;
}

.reader-note-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(26, 18, 25, .54);
}

.reader-note-drawer {
    position: absolute;
    top: 0;
    right: 0;
    width: min(100%, 520px);
    height: 100%;
    padding: 28px;
    background: #fff;
    box-shadow: -18px 0 50px rgba(30, 20, 28, .18);
    overflow-y: auto;
}

.reader-note-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.reader-note-heading h2 {
    margin: 5px 0;
    font-family: Georgia, "Noto Serif TC", serif;
}

.reader-note-heading p {
    margin: 0;
    color: var(--muted);
}

.reader-note-drawer blockquote {
    margin: 22px 0;
    padding: 16px 18px;
    border-left: 4px solid var(--brand);
    border-radius: 0 14px 14px 0;
    color: var(--muted);
    background: var(--paper-2);
}

body.reader-note-open {
    overflow: hidden;
}

@media (max-width: 720px) {
    .story-segment {
        padding-right: 0;
        padding-bottom: 38px;
    }

    .story-segment .segment-action-stack {
        top: auto;
        right: 0;
        bottom: -2px;
    }

    .reader-shell.reader-hide-segment-comments .story-segment {
        padding-right: 0;
        padding-bottom: 38px;
    }

    .reader-note-drawer {
        top: auto;
        bottom: 0;
        width: 100%;
        height: min(86vh, 760px);
        padding: 22px 18px;
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -18px 50px rgba(30, 20, 28, .18);
    }
}

/* ==========================================================
 * v0.6.1 緊急修正：前台入口、帳號抽屜與 v0.6.0 新增元件樣式
 * 修正 v0.6.0 共用頁首改用 portal-* 類別後，CSS 未一併交付造成的裸版畫面。
 * ========================================================== */

[hidden] {
    display: none !important;
}

.portal-site-header {
    position: sticky;
    top: 0;
    z-index: 120;
    border-bottom: 1px solid rgba(122, 63, 98, .1);
    background: rgba(255, 253, 249, .94);
    box-shadow: 0 8px 30px rgba(52, 35, 48, .04);
    backdrop-filter: blur(16px);
}

.portal-header-inner {
    display: grid;
    grid-template-columns: auto auto minmax(220px, 1fr) auto auto;
    align-items: center;
    width: min(calc(100% - 44px), 1540px);
    min-height: 82px;
    margin: 0 auto;
    gap: 22px;
}

.portal-brand {
    flex: 0 0 auto;
    min-width: max-content;
}

.portal-brand img {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    object-fit: contain;
}

.portal-primary-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.portal-primary-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 20px;
    border-radius: 999px;
    color: var(--muted);
    background: rgba(116, 107, 120, .07);
    font-weight: 800;
    transition: color .2s ease, background .2s ease, transform .2s ease;
}

.portal-primary-nav a:hover,
.portal-primary-nav a.is-active {
    color: #fff;
    background: var(--brand);
    transform: translateY(-1px);
}

.portal-header-search {
    display: flex;
    align-items: center;
    justify-self: stretch;
    min-width: 0;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid rgba(122, 63, 98, .12);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(68, 40, 59, .04);
}

.portal-header-search > span {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 1.55rem;
    line-height: 1;
}

.portal-header-search input {
    min-width: 0;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
}

.portal-header-search input::placeholder {
    color: #aaa1ad;
}

.portal-account-button {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    max-width: 250px;
    min-height: 54px;
    padding: 4px 5px 4px 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
    font-weight: 800;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.portal-account-button:hover,
.portal-account-button:focus-visible {
    border-color: var(--line);
    background: #fff;
    box-shadow: 0 10px 24px rgba(63, 36, 55, .08);
}

.portal-account-button span {
    max-width: 155px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-account-button img {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border: 2px solid #fff;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(122, 63, 98, .16);
}

.portal-login-button {
    justify-self: end;
}

.portal-mobile-menu {
    display: none;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--brand-deep);
    background: #fff;
    cursor: pointer;
    font-size: 1.35rem;
}

.portal-mobile-nav {
    position: sticky;
    top: 82px;
    z-index: 110;
    width: 100%;
    padding: 12px 18px 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 253, 249, .98);
    box-shadow: 0 12px 26px rgba(52, 35, 48, .08);
}

.portal-mobile-nav:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.portal-mobile-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    font-weight: 800;
}

.account-drawer-layer {
    position: fixed;
    inset: 0;
    z-index: 300;
}

.account-drawer-layer:not([hidden]) {
    display: block;
}

.account-drawer-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(28, 20, 27, .45);
    cursor: default;
    animation: accountBackdropIn .2s ease both;
}

.account-drawer {
    position: absolute;
    top: 0;
    right: 0;
    width: min(92vw, 410px);
    height: 100%;
    padding: 30px 26px;
    overflow-y: auto;
    background: #fffdf9;
    box-shadow: -24px 0 70px rgba(35, 22, 32, .22);
    animation: accountDrawerIn .24s ease both;
}

@keyframes accountBackdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes accountDrawerIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.account-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 15px;
    color: var(--ink);
    background: #fff;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
}

.account-drawer-profile {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    margin: 22px 0 18px;
}

.account-drawer-profile img {
    width: 72px;
    height: 72px;
    border: 3px solid #fff;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px var(--brand-soft);
}

.account-drawer-profile strong,
.account-drawer-profile span {
    display: block;
}

.account-drawer-profile strong {
    overflow: hidden;
    font-size: 1.15rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-drawer-profile span {
    margin-top: 4px;
    color: var(--muted);
    font-size: .92rem;
}

.account-drawer-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 22px;
}

.account-drawer-stats a {
    display: grid;
    place-items: center;
    min-height: 72px;
    padding: 10px 6px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.account-drawer-stats strong,
.account-drawer-stats span {
    display: block;
}

.account-drawer-stats strong {
    color: var(--brand-deep);
    font-size: 1.15rem;
}

.account-drawer-stats span {
    color: var(--muted);
    font-size: .82rem;
}

.account-drawer-nav {
    display: grid;
    gap: 8px;
}

.account-drawer-nav a {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    min-height: 52px;
    padding: 9px 14px;
    border-radius: 15px;
    color: var(--ink);
    font-weight: 750;
    transition: background .18s ease, color .18s ease;
}

.account-drawer-nav a:hover {
    color: var(--brand-deep);
    background: var(--brand-soft);
}

.account-drawer-nav a span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

body.account-drawer-open {
    overflow: hidden;
}

.portal-account-page {
    min-height: calc(100vh - 180px);
}

.button-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.muted-text {
    color: var(--muted);
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-row input {
    margin-top: .42em;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
}

.field-search-wide {
    grid-column: span 2;
}

.discovery-recommendations {
    min-width: 0;
}

.note-filter-form {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(220px, .8fr) auto;
    align-items: end;
    gap: 16px;
    margin-bottom: 24px;
}

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

.private-note-card {
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(63, 36, 55, .06);
}

.private-note-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.private-note-card-heading p,
.private-note-card-heading time {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: .9rem;
}

.note-novel-title {
    color: var(--brand-deep);
    font-size: 1.05rem;
    font-weight: 850;
}

.private-note-card blockquote {
    margin: 18px 0;
    padding: 14px 16px;
    border-left: 4px solid var(--brand);
    border-radius: 0 14px 14px 0;
    color: var(--muted);
    background: var(--paper-2);
}

.private-note-text {
    min-height: 3.5em;
    overflow-wrap: anywhere;
}

.history-list {
    display: grid;
    gap: 14px;
}

.history-item {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    transition: transform .18s ease, box-shadow .18s ease;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(63, 36, 55, .08);
}

.history-item img {
    width: 76px;
    aspect-ratio: 2 / 3;
    border-radius: 10px;
    object-fit: cover;
}

.history-item span,
.history-item strong,
.history-item small,
.history-item em {
    display: block;
}

.history-item small,
.history-item em {
    margin-top: 4px;
    color: var(--muted);
    font-style: normal;
}

.category-multi-select {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.category-check-chip {
    position: relative;
    cursor: pointer;
}

.category-check-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.category-check-chip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: #fff;
    font-weight: 750;
    transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.category-check-chip input:checked + span {
    border-color: var(--brand);
    color: #fff;
    background: var(--brand);
}

.category-check-chip input:focus-visible + span {
    outline: 3px solid rgba(122, 63, 98, .2);
    outline-offset: 2px;
}

.revision-panel {
    overflow: hidden;
}

.revision-preview-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    color: var(--muted);
}

.responsive-table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.homepage-slide-form,
.admin-card-heading {
    min-width: 0;
}

.author-bio {
    color: var(--muted);
    white-space: pre-line;
}

/* 排行榜獨立頁 */
.rankings-page-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.rankings-page-column {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(63, 36, 55, .06);
}

.rankings-page-column .section-heading {
    margin-bottom: 14px;
}

.rankings-page-column .ranking-item {
    padding-left: 0;
    padding-right: 0;
}

@media (max-width: 1180px) {
    .portal-header-inner {
        grid-template-columns: auto auto minmax(180px, 1fr) auto;
        gap: 14px;
    }

    .portal-account-button span {
        display: none;
    }

    .portal-account-button {
        padding-left: 5px;
    }

    .portal-mobile-menu {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .portal-primary-nav {
        display: none;
    }
}

@media (max-width: 900px) {
    .portal-header-inner {
        grid-template-columns: auto minmax(0, 1fr) auto auto;
        width: min(calc(100% - 28px), 1540px);
        min-height: 72px;
    }

    .portal-brand span {
        display: none;
    }

    .portal-brand img {
        width: 42px;
        height: 42px;
    }

    .portal-mobile-nav {
        top: 72px;
    }

    .note-filter-form {
        grid-template-columns: 1fr 1fr;
    }

    .note-filter-form .button {
        grid-column: 1 / -1;
    }

    .private-note-grid,
    .rankings-page-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .portal-header-inner {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 10px;
    }

    .portal-header-search {
        min-height: 44px;
        padding: 0 10px;
    }

    .portal-header-search > span {
        font-size: 1.25rem;
    }

    .portal-header-search input {
        padding: 8px;
        font-size: .92rem;
    }

    .portal-account-button {
        display: none;
    }

    .portal-mobile-nav:not([hidden]) {
        grid-template-columns: 1fr;
    }

    .account-drawer {
        width: 100%;
        padding: 22px 18px;
    }

    .note-filter-form {
        grid-template-columns: 1fr;
    }

    .note-filter-form .button {
        grid-column: auto;
    }

    .private-note-card-heading {
        display: grid;
        gap: 6px;
    }

    .history-item {
        grid-template-columns: 62px minmax(0, 1fr);
        gap: 14px;
    }

    .history-item img {
        width: 62px;
    }

    .field-search-wide {
        grid-column: auto;
    }
}

@media (max-width: 680px) {
    .portal-header-inner {
        grid-template-columns: auto minmax(0, 1fr) auto auto;
    }

    .portal-account-button {
        display: inline-flex;
        min-height: 44px;
        padding: 2px;
    }

    .portal-account-button img {
        width: 40px;
        height: 40px;
    }
}


/*
 * v0.6.2 緊急修正：管理中心頁尾與左側選單邊界
 * 公開網站頁尾不在管理中心輸出；此處確保管理內容區至少填滿可視高度。
 */
.admin-shell > .admin-content {
    align-self: stretch;
}


/* v0.7.0 統一列表、AJAX 大型懸浮編輯、十分制評分與閱讀器稽核 */
.admin-list-heading { align-items: flex-end; }
.admin-list-card { padding: 24px; }
.admin-list-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; margin-bottom: 20px; }
.admin-list-toolbar label { display: grid; gap: 7px; min-width: 180px; }
.admin-list-search { flex: 1 1 320px; }
.admin-list-count { margin-left: auto; padding-bottom: 10px; white-space: nowrap; }
.drag-column { width: 76px; text-align: center; }
.drag-handle { border: 0; background: transparent; cursor: grab; font-size: 22px; line-height: 1; padding: 12px; border-radius: 12px; user-select: none; -webkit-user-select: none; }
.drag-handle:hover, .drag-handle:focus-visible { background: rgba(120, 48, 91, .1); }
[data-sortable-item].is-dragging { opacity: .45; }
[data-sortable-item].is-saving { pointer-events: none; }
.table-description { margin: 6px 0 0; color: var(--muted); max-width: 560px; }
.admin-modal-layer[hidden], .reader-settings-backdrop[hidden] { display: none !important; }
.admin-modal-layer { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 24px; }
.admin-modal-backdrop { position: absolute; inset: 0; border: 0; background: rgba(22, 15, 20, .58); }
.admin-modal { position: relative; width: min(920px, 100%); max-height: calc(100vh - 48px); overflow: hidden; display: flex; flex-direction: column; background: var(--surface, #fff); border-radius: 24px; box-shadow: 0 28px 80px rgba(0,0,0,.28); }
.admin-modal-medium { width: min(720px, 100%); }
.admin-modal-header, .admin-modal-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.admin-modal-footer { justify-content: flex-end; border-top: 1px solid var(--border); border-bottom: 0; }
.admin-modal-body { padding: 24px; overflow: auto; max-height: calc(100vh - 220px); }
body.admin-modal-open { overflow: hidden; }
.move-source-summary { margin: 0 0 20px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: #faf6f8; }
.move-target-grid { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 16px; margin-top: 16px; align-items: end; }
.move-position-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.move-position-fieldset legend { margin-bottom: 7px; font-weight: 700; }
.move-position-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.move-position-option { position: relative; display: block; cursor: pointer; }
.move-position-option input { position: absolute; opacity: 0; pointer-events: none; }
.move-position-option span { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; font-weight: 800; transition: border-color .2s ease, background .2s ease, color .2s ease; }
.move-position-option input:checked + span { border-color: var(--brand); color: #fff; background: var(--brand); }
.move-position-option input:focus-visible + span { outline: 3px solid rgba(122, 63, 98, .22); outline-offset: 2px; }
.field-hint { margin: 14px 0 0; color: var(--muted); font-size: .92rem; }
.rating-score-panel { margin-top: 12px; }
.rating-score-grid { display: grid; grid-template-columns: repeat(10, minmax(34px, 1fr)); gap: 7px; }
.rating-score-grid button { min-height: 40px; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; font-weight: 700; }
.rating-score-grid button.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.reader-settings-backdrop { position: fixed; inset: 0; z-index: 1090; border: 0; background: rgba(25,18,23,.42); }
.reader-settings-panel { z-index: 1100; }
.reader-settings-heading { position: sticky; top: 0; z-index: 2; background: inherit; padding-bottom: 12px; }
.reader-settings-actions { position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: 12px; padding: 16px 0 4px; background: inherit; }
.reader-shell.reader-hide-notes .segment-note-trigger { display: none !important; }
body.reader-settings-open { overflow: hidden; }
@media (max-width: 760px) {
    .admin-modal-layer { padding: 0; }
    .admin-modal { width: 100%; height: 100%; max-height: none; border-radius: 0; }
    .admin-modal-body { max-height: none; flex: 1; }
    .move-target-grid { grid-template-columns: 1fr; }
    .rating-score-grid { grid-template-columns: repeat(5, 1fr); }
    .reader-settings-panel { position: fixed !important; inset: auto 0 0 !important; width: 100% !important; max-height: 88vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 20px; }
}


@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
    .reader-floating-settings,
    .reader-floating-listen {
        transition: none;
    }
}


/* v0.7.3 小說平台介面密度修正 */
/*
 * 修改日期：2026/07/25 20:15（UTC+8）
 * 目的：移除形象網站式的大型頁首與過量留白，讓前台、會員區、作者區及管理中心回到小說平台的操作密度。
 */
.section {
    padding-top: 30px;
    padding-bottom: 30px;
}

.shell.section {
    padding-top: 24px;
}

.section-heading {
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.section-heading > div > .eyebrow,
.section-heading > .eyebrow {
    display: none;
}

.section-heading h1,
.section-heading h2,
.page-heading h1 {
    margin: 0;
    font-family: inherit;
    letter-spacing: 0;
}

.section-heading h1 {
    font-size: clamp(1.45rem, 2.2vw, 1.85rem);
    line-height: 1.3;
}

.section-heading h2 {
    font-size: clamp(1.2rem, 1.7vw, 1.45rem);
    line-height: 1.35;
}

.section-heading p,
.page-heading p {
    margin: 5px 0 0;
    font-size: .94rem;
    line-height: 1.55;
}

.compact-heading {
    margin-bottom: 12px;
}

.page-heading {
    padding-top: 24px;
    padding-bottom: 14px;
}

/* 首頁改為小說平台探索列，不再使用形象網站的大型 Hero。 */
.discovery-library-intro {
    padding-top: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 253, 249, .96);
}

.discovery-library-intro .discovery-hero-grid {
    grid-template-columns: minmax(260px, 420px) minmax(420px, 1fr);
    align-items: center;
    gap: 24px;
}

.discovery-library-intro .eyebrow {
    display: none;
}

.discovery-library-intro h1 {
    margin: 0 0 5px;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: clamp(1.65rem, 2.4vw, 2.25rem);
    line-height: 1.25;
}

.discovery-library-intro p {
    max-width: none;
    font-size: .95rem;
    line-height: 1.55;
}

.discovery-library-intro .discovery-hero-actions {
    margin-top: 10px;
}

.discovery-library-intro .discovery-search-form {
    padding: 7px;
    border-radius: 16px;
    box-shadow: none;
}

.discovery-library-intro .category-chip-row {
    gap: 8px;
    margin-top: 14px;
}

.discovery-library-intro .category-chip {
    min-height: 36px;
    padding: 6px 14px;
}

.homepage-carousel-compact {
    min-height: 220px;
    margin-top: 18px;
    border-radius: 20px;
}

.homepage-carousel-compact .homepage-carousel-content {
    min-height: 220px;
    padding-top: 30px;
    padding-bottom: 30px;
}

.homepage-carousel-compact .homepage-carousel-content h2 {
    font-size: clamp(1.45rem, 2.4vw, 2.15rem);
}

/* 管理中心採應用程式工作區密度，不以大標題區塊占用首屏。 */
.admin-content {
    padding: 18px 24px 42px;
}

.admin-content > .section-heading:first-child {
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.admin-content > .section-heading:first-child h1 {
    font-family: inherit;
    font-size: clamp(1.45rem, 2vw, 1.75rem);
    line-height: 1.3;
}

.admin-content > .section-heading:first-child p {
    margin-top: 4px;
    font-size: .92rem;
    line-height: 1.5;
}

.admin-content .section-heading h2 {
    font-family: inherit;
}

.admin-content .admin-card .section-heading {
    margin-bottom: 12px;
}

.admin-list-card {
    padding: 20px;
}

.admin-list-toolbar {
    margin-bottom: 16px;
}

.portal-account-page {
    min-height: calc(100vh - 154px);
}

@media (max-width: 980px) {
    .discovery-library-intro .discovery-hero-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

@media (max-width: 720px) {
    .section,
    .shell.section {
        padding-top: 18px;
        padding-bottom: 24px;
    }

    .section-heading {
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 13px;
    }

    .section-heading h1 {
        font-size: 1.42rem;
    }

    .section-heading h2 {
        font-size: 1.22rem;
    }

    .section-heading p {
        font-size: .9rem;
    }

    .discovery-library-intro {
        padding-top: 16px;
        padding-bottom: 10px;
    }

    .discovery-library-intro h1 {
        font-size: 1.5rem;
    }

    .discovery-library-intro .discovery-search-form {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .discovery-library-intro .discovery-search-form .button {
        width: auto;
    }

    .discovery-library-intro .category-chip-row {
        margin-top: 10px;
    }

    .homepage-carousel-compact,
    .homepage-carousel-compact .homepage-carousel-content {
        min-height: 210px;
    }

    .homepage-carousel-compact .homepage-carousel-content {
        padding-top: 28px;
        padding-bottom: 58px;
    }

    .admin-content {
        padding: 14px 14px 34px;
    }

    .admin-content > .section-heading:first-child {
        align-items: flex-start;
        margin-bottom: 12px;
        padding-bottom: 10px;
    }
}

@media (max-width: 520px) {
    .discovery-library-intro .discovery-search-form {
        grid-template-columns: 1fr;
    }

    .discovery-library-intro .discovery-search-form .button {
        width: 100%;
    }
}
