﻿:root {
    --primary-color: #5c6ac4;
    --primary-dark: #4b58a8;
    --accent-color: #f76c6c;
    --bg-color: #f7f9fc;
    --text-color: #222;
    --muted-text: #666;
    --border-color: #e1e5ee;
    --card-bg: #fff;
    --shadow-light: rgba(0, 0, 0, 0.06);
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #f97316;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;

    --bg-color: #f3f4fb;
    --surface-color: #ffffff;
    --glass-surface: rgba(255, 255, 255, 0.75);

    --text-color: #1f2937;
    --muted-text: #6b7280;
    --subtle-text: #94a3b8;

    --border-color: #e2e8f0;
    --border-strong: #cbd5f5;

    --card-bg: var(--surface-color);
    --card-alt-bg: #f8f9ff;

    --shadow-light: rgba(15, 23, 42, 0.08);
    --shadow-medium: rgba(15, 23, 42, 0.16);
    --shadow-strong: rgba(15, 23, 42, 0.28);

    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --gradient-accent: linear-gradient(135deg, #14b8a6 0%, #22d3ee 100%);
    --gradient-warm: linear-gradient(135deg, #f97316 0%, #f43f5e 100%);

    --reader-top-offset: 96px;

    color-scheme: light;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover,
a:focus-visible {
    color: var(--primary-dark);
}

header {
    background: rgba(248, 250, 255, 0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    box-shadow: 0 18px 28px -20px var(--shadow-medium);
    padding: 16px 32px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    /*position: sticky;  取消置顶顶部菜单*/
    top: 0;
    z-index: 120;
    transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}

.logo {
    display: flex;
    flex-direction: column;
    justify-content: center;
}


.header-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.header-panel-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-panel-row .header-controls {
    flex: 1;
}

.header-panel-row .header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.header-panel-categories {
    width: 100%;
    display: flex;
}

.header-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 12px 28px -18px rgba(15, 23, 42, 0.18);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-toggle:hover,
.header-toggle:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px -18px rgba(15, 23, 42, 0.24);
    background: rgba(255, 255, 255, 0.9);
}

.header-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: var(--text-color);
    transition: transform 0.2s ease;
}

.header-toggle-bar + .header-toggle-bar {
    margin-top: 4px;
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo img {
    max-height: 42px;
    object-fit: contain;
}

.logo-tagline {
    font-size: 16px;
    color: var(--subtle-text);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

nav {
    display: flex;
    align-items: center;
    gap: 10px 15px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-brand-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

.header-controls nav {
    flex-wrap: nowrap;
    gap: 18px;
}

.header-search {
    flex: 0 0 auto;
    min-width: 280px;
    max-width: 320px;
}

nav a {
    position: relative;
    font-size: 15px;
    font-weight: 600;
    color: var(--muted-text);
    padding: 4px 2px;
    transition: color 0.2s ease;
}

nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 2px;
    border-radius: var(--radius-pill);
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s ease;
}

nav a:hover,
nav a:focus-visible {
    color: var(--primary-color);
}

nav a:hover::after,
nav a:focus-visible::after,
nav a.active::after {
    transform: scaleX(1);
}

nav a.active {
    color: var(--primary-color);
}

.header-categories {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    overflow-x: auto;
    padding: 6px 6px 10px;
    margin: 0 auto;
    width: 100%;
    max-width: 1180px;
}

.header-categories a {
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(99, 102, 241, 0.15);
    background: rgba(255, 255, 255, 0.7);
    color: var(--muted-text);
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 8px 18px -16px var(--shadow-medium);
}

.header-categories a:hover,
.header-categories a:focus-visible,
.header-categories a.active {
    color: var(--primary-color);
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 24px -18px var(--shadow-medium);
}

.header-categories::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.2);
    border-radius: 999px;
}

@media (max-width: 960px) {
    .site-header {
        padding: 12px 18px 10px;
        gap: 8px;
    }

    .site-header .header-main {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .site-header .header-brand {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 10px;
        padding-right: 0;
    }

    .site-header .header-brand-name {
        font-size: 15px;
    }



    .header-toggle {
        display: inline-flex;
        position: relative;
        right: auto;
        top: auto;
        margin-left: auto;
        width: 42px;
        height: 42px;
    }

    .site-header .header-panel {
        display: none;
        width: 100%;
        max-width: none;
        align-self: stretch;
        padding: 14px 16px 16px;
        flex-direction: column;
        gap: 14px;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid rgba(148, 163, 184, 0.26);
        border-radius: 20px;
        box-shadow: 0 20px 42px -28px rgba(15, 23, 42, 0.38);
        margin-top: 8px;
    }

    .site-header.is-expanded .header-panel {
        display: flex;
        animation: header-panel-pop 0.18s ease;
    }

    .site-header .header-panel-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        align-items: flex-start;
        gap: 16px;
    }

    .site-header .header-controls {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .site-header .header-controls nav,
    .site-header .site-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 10px 18px;
        overflow: visible;
        padding-bottom: 0;
        margin: 0;
    }

    .site-header .site-nav a {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 15px;
        padding: 4px 0;
    }

    .site-header .header-search,
    .site-search {
        width: 100%;
        min-width: 0;
    }

    .site-header .header-search .site-search {
        padding: 8px 12px;
        border-radius: var(--radius-pill);
        background: rgba(248, 250, 255, 0.98);
        border: 1px solid rgba(148, 163, 184, 0.28);
        box-shadow: none;
    }

    .site-header .header-search .site-search button {
        padding: 6px 18px;
        background: var(--primary-color);
        box-shadow: none;
    }

    .site-header .header-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }

    .site-header .header-actions .btn,
    .site-header .header-actions .logout-link {
        padding: 8px 14px;
        border-radius: var(--radius-pill);
        flex: 1 1 calc(50% - 6px);
        justify-content: center;
    }

    .site-header .header-actions .logout-link {
        border: 1px solid rgba(99, 102, 241, 0.28);
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .site-header .header-panel-categories {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .site-header .header-panel-categories .header-categories {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 0 2px 2px;
        margin: 0 -2px;
    }

    .site-header .header-panel-categories .header-categories::-webkit-scrollbar {
        display: none;
    }

    .site-header .header-panel-categories .header-categories a {
        white-space: nowrap;
        font-size: 13px;
    }

    .container {
        padding: 20px;
    }

    .card {
        padding: 18px;
    }

    .grid {
        gap: 20px;
    }

    .home-hot-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .home-wrapper {
        padding: 0 24px 56px;
    }
}

@keyframes header-panel-pop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.header-categories::-webkit-scrollbar {
    height: 6px;
}

@media (max-width: 640px) {
    .site-header {
        padding: 10px 14px;
        gap: 10px;
    }

    .site-header .header-main {
        position: relative;
        gap: 10px;
        padding-right: 0;
    }

    .header-toggle {
        width: 38px;
        height: 38px;
    }

    .header-toggle-bar {
        width: 18px;
    }

    .site-header .header-panel {
        padding: 12px 14px;
        gap: 14px;
        border-radius: 18px;
    }

    .site-header .header-panel-row {
        gap: 12px;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .site-header .header-brand {
        gap: 8px;
    }

    .site-header .header-brand-name {
        font-size: 15px;
    }

    .site-header .header-actions {
        gap: 8px;
    }

    .site-header .header-actions .btn,
    .site-header .header-actions .logout-link {
        padding: 6px 12px;
        font-size: 13px;
        flex: 1 1 100%;
    }

    .site-header .header-actions .avatar-small {
        width: 32px;
        height: 32px;
    }

    .site-header .header-controls {
        gap: 10px;
    }

    .site-header .site-nav {
        gap: 12px;
    }

    .site-header .site-nav a {
        font-size: 13px;
        padding: 5px 0;
    }

    .site-header .header-panel-categories .header-categories {
        gap: 10px;
    }

    .site-header .site-search input[type="search"] {
        width: 100%;
    }

    .logo img {
        max-height: 36px;
    }

    .site-main {
        padding: 0 14px;
        margin: 6px auto 40px;
    }

    .category-hero-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .category-latest {
        gap: 16px;
    }

    .category-latest-list {
        gap: 16px;
    }

    .category-novel {
        padding: 12px;
    }

    .category-novel-cover {
        flex: 0 0 auto;
    }

    .category-novel-cover .cover-placeholder,
    .category-novel-cover img {
        height: 180px;
    }

    .category-toolbar {
        gap: 10px;
        width: 100%;
    }

    .category-per-page {
        width: 100%;
        justify-content: space-between;
    }

    .category-recommend-list li {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    .category-recommend-list .cover {
        width: 52px;
        height: 72px;
    }

    .user-profile-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .user-avatar-preview img,
    .user-avatar-preview .avatar-placeholder {
        width: 80px;
        height: 80px;
    }

    .user-profile-meta h3 {
        font-size: 17px;
    }

    .user-profile-form label,
    .user-profile-form .full-row {
        width: 100%;
    }

    .user-profile-form input[type="text"],
    .user-profile-form input[type="file"],
    .user-profile-form textarea {
        width: 100%;
    }

    .user-profile-form .user-checkbox {
        display: flex;
        width: 100%;
        gap: 10px;
    }

    .user-profile-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .user-profile-actions .btn {
        width: 100%;
    }

    .user-shelf-create {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .user-shelf-create input[type="text"] {
        width: 100%;
    }

    .user-shelf-actions {
        gap: 16px;
    }

    .user-shelf-controls {
        width: 100%;
        gap: 10px;
    }

    .user-shelf-controls select {
        width: 100%;
    }

    .user-shelf-controls .btn {
        flex: 1 1 100%;
        justify-content: center;
    }

    .user-shelf-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .user-shelf-list label {
        align-items: flex-start;
        gap: 10px;
        line-height: 1.5;
    }

    .user-history-card .list li {
        gap: 10px;
    }
}

/* --- Modern theme overrides --- */

.home-wrapper {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 32px 64px;
}

.home-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid rgba(99, 102, 241, 0.12);
    box-shadow: 0 36px 64px -40px rgba(79, 70, 229, 0.35);
    margin-bottom: 36px;
    position: relative;
    overflow: hidden;
}

.home-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.22), transparent 55%), radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.18), transparent 60%);
    opacity: 0.55;
    pointer-events: none;
}

.home-section h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 24px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--primary-dark);
}

.home-section h2::after {
    content: "";
    flex: 1;
    height: 2px;
    border-radius: var(--radius-pill);
    background: rgba(99, 102, 241, 0.22);
}

.novel-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.popular-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.home-topic-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.home-topic-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(99, 102, 241, 0.18);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 20px 40px -32px rgba(79, 70, 229, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-topic-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 56px -30px rgba(79, 70, 229, 0.4);
}

.home-topic-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.home-topic-card h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
}

.home-topic-count {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-dark);
}

.home-topic-card p {
    margin: 0;
    font-size: 14px;
    color: var(--muted-text);
    line-height: 1.6;
    flex: 1;
}

.home-topic-card time {
    font-size: 12px;
    color: var(--subtle-text);
}

.popular-card {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 18px;
    box-shadow: 0 18px 36px -24px rgba(79, 70, 229, 0.28);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.popular-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 48px -28px rgba(79, 70, 229, 0.32);
}

.popular-card figure {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
}

.popular-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.popular-card:hover img {
    transform: scale(1.05);
}

.popular-card .badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary-color);
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

.popular-card .info {
    padding: 16px;
}

.popular-card .info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.popular-grid .info p {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--muted-text);
}


.popular-grid .info span {
  font-size: 16px; /* 大字体 */
  font-weight: 500; /* 可选：加粗 */
}


.popular-grid .info i {
  font-size: 12px; /* 小字体 */
  color: #666; /* 浅灰色，区分层级 */
  font-style: normal; /* 去掉i标签默认斜体 */
}


.popular-grid .info a {
  color: inherit; /* 继承父元素颜色 */
  text-decoration: none; /* 去掉下划线 */
}

.popular-card .info a:hover {
  color: #007bff; /*  hover变色，增强交互 */
}

.popular-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 24px;
    color: var(--primary-dark);
    background: rgba(148, 163, 184, 0.2);
}

.haoshu-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.haoshu-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.12);
    box-shadow: 0 26px 62px -38px rgba(79, 70, 229, 0.4);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.haoshu-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 32px 72px -40px rgba(79, 70, 229, 0.45);
}

.haoshu-cover {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    background: rgba(99, 102, 241, 0.08);
}

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

.haoshu-card .cover-placeholder {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 0.12em;
}

.haoshu-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    flex: 1;
}

.haoshu-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.haoshu-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    flex: 1;
}

.haoshu-card:hover .haoshu-title {
    color: var(--primary-dark);
}

.haoshu-category {
    font-size: 12px;
    color: var(--primary-dark);
    background: rgba(99, 102, 241, 0.12);
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    flex-shrink: 0;
}

.haoshu-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 13px;
    color: var(--muted-text);
}

.haoshu-author a {
    color: inherit;
    font-weight: 600;
}

.haoshu-author span {
    color: inherit;
}

.haoshu-status {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-dark);
}

.haoshu-desc {
    margin: 0;
    font-size: 13px;
    color: var(--muted-text);
    line-height: 1.6;
    min-height: 3.2em;
}

@media (min-width: 1100px) {
    .haoshu-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

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

@media (max-width: 540px) {
    .haoshu-grid {
        grid-template-columns: 1fr;
    }
}

.category-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.category-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 18px;
    padding: 18px;
    text-align: center;
    box-shadow: 0 16px 32px -24px rgba(79, 70, 229, 0.26);
    border: 1px solid rgba(148, 163, 184, 0.18);
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 40px -26px rgba(79, 70, 229, 0.3);
}

.category-card .icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: var(--primary-color);
}

.category-card h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.category-card p {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--muted-text);
}

.topic-page {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px 60px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.topic-hero {
    background: var(--card-bg);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 32px 60px -40px rgba(79, 70, 229, 0.35);
    position: relative;
    overflow: hidden;
}

.topic-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.18), transparent 60%);
    pointer-events: none;
}

.topic-hero-text {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.topic-hero-label {
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary-dark);
}

.topic-hero h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 800;
    color: var(--primary-dark);
}

.topic-hero-intro {
    margin: 0;
    font-size: 15px;
    color: var(--muted-text);
    line-height: 1.7;
}

.topic-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    font-size: 13px;
    color: var(--muted-text);
}

.topic-meta a {
    color: var(--primary-color);
}

.topic-novel-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.topic-novel-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 24px;
    box-shadow: 0 26px 48px -36px rgba(79, 70, 229, 0.35);
    display: flex;
    gap: 24px;
    align-items: stretch;
}

.topic-novel-cover {
    width: 160px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(99, 102, 241, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.14);
}

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

.topic-novel-placeholder {
    font-size: 34px;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 0.08em;
}

.topic-novel-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.topic-novel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.topic-novel-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.topic-novel-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
}

.topic-novel-title:hover {
    color: var(--primary-dark);
}

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

.topic-tag {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-dark);
}

.topic-tag.ghost {
    background: rgba(148, 163, 184, 0.2);
    color: var(--muted-text);
}

.topic-novel-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.topic-novel-author {
    font-size: 14px;
    color: var(--muted-text);
}

.topic-novel-desc {
    margin: 0;
    font-size: 14px;
    color: var(--text-color);
    line-height: 1.7;
}

.topic-chapter-block {
    margin-top: 18px;
    border-top: 1px dashed rgba(148, 163, 184, 0.4);
    padding-top: 16px;
}

.topic-chapter-title {
    margin: 0 0 10px;
    font-size: 13px;
    letter-spacing: 0.1em;
    color: var(--muted-text);
    text-transform: uppercase;
}

.topic-chapter-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 18px;
}

.topic-chapter-list li {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(248, 250, 255, 0.9);
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.topic-chapter-list a {
    font-size: 14px;
    color: var(--primary-dark);
    font-weight: 600;
}

.topic-chapter-meta {
    font-size: 12px;
    color: var(--muted-text);
}

.topic-novel-list .btn.small {
    padding: 6px 14px;
    font-size: 13px;
}

/* Topic list */
.topic-list {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.topic-list-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 18px 42px -30px rgba(79, 70, 229, 0.3);
}

.topic-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.topic-list-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
}

.topic-list-count {
    font-size: 13px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-dark);
}

.topic-list-desc {
    margin: 0;
    font-size: 14px;
    color: var(--muted-text);
    line-height: 1.5;
}

.topic-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 12px;
    color: var(--muted-text);
}

.topic-list-actions {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 640px) {
    .topic-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .topic-page {
        padding: 0 18px 48px;
    }
    .topic-hero {
        padding: 24px;
    }
    .topic-novel-card {
        padding: 20px;
        flex-direction: column;
    }
    .topic-novel-cover {
        width: 100%;
        height: 220px;
    }
    .topic-novel-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .topic-chapter-list {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

.category-filter-card {
    max-width: 1180px;
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.15);
    background: var(--card-bg);
}

.category-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.category-filter-head h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
}

.category-filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.category-filter-item {
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    background: rgba(255, 255, 255, 0.92);
    color: var(--muted-text);
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
    box-shadow: 0 10px 24px -20px rgba(15, 23, 42, 0.2);
}

.category-filter-item:hover,
.category-filter-item:focus-visible {
    color: var(--primary-color);
    border-color: rgba(99, 102, 241, 0.55);
    box-shadow: 0 16px 28px -20px rgba(99, 102, 241, 0.38);
    transform: translateY(-1px);
}

.category-filter-item.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(99, 102, 241, 1) 0%, rgba(128, 90, 213, 1) 100%);
    border-color: transparent;
    box-shadow: 0 16px 30px -18px rgba(79, 70, 229, 0.45);
}

.home-list {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 20px 40px -28px rgba(15, 23, 42, 0.28);
    overflow: hidden;
}

.home-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.home-list-item:last-child {
    border-bottom: none;
}

.home-list-item:hover {
    background: rgba(99, 102, 241, 0.06);
}

.home-list-item .thumb {
    width: 64px;
    height: 84px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(99, 102, 241, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--primary-dark);
}

.home-list-item .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-list-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.home-list-content h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.home-list-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--muted-text);
}

.home-list-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-color);
    font-size: 12px;
}

.home-recommend-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: stretch;
}

.novel-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px 22px;
    border-radius: var(--radius-md);
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.9));
    border: 1px solid rgba(99, 102, 241, 0.1);
    box-shadow: 0 32px 60px -40px rgba(15, 23, 42, 0.35);
    color: inherit;
    text-decoration: none;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    overflow: hidden;
}

.novel-card::after {
    content: "";
    position: absolute;
    inset: 16px;
    border-radius: calc(var(--radius-md) - 12px);
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.18), transparent 60%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.novel-card:hover {
    transform: translateY(-6px) scale(1.005);
    box-shadow: 0 42px 70px -36px rgba(79, 70, 229, 0.35);
}

.novel-card:hover::after {
    opacity: 1;
}

.novel-card-cover {
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(236, 72, 153, 0.18));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary-dark);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
    aspect-ratio: 3 / 4;
    min-height: 0;
}

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

.novel-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.novel-card-body strong {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
}

.novel-card-body .meta {
    font-size: 13px;
    color: var(--muted-text);
}

.home-hot-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.home-hot-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(236, 233, 255, 0.9));
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 24px 48px -30px rgba(79, 70, 229, 0.32);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    color: inherit;
}

.home-hot-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 32px 58px -32px rgba(79, 70, 229, 0.4);
}

.home-hot-cover {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(236, 72, 153, 0.18));
}

.home-hot-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.home-hot-card:hover .home-hot-cover img {
    transform: scale(1.04);
}

.home-hot-info {
    padding: 0 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.home-hot-badge {
    align-self: flex-start;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-dark);
}

.home-hot-info strong {
    font-size: 17px;
    color: var(--text-color);
    margin: 0;
}

.home-hot-info p {
    margin: 0;
    font-size: 13px;
    color: var(--muted-text);
}

.home-category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.home-category-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.18);
    color: var(--primary-dark);
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-category-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -16px rgba(79, 70, 229, 0.32);
}

.home-category-pill .count {
    font-size: 12px;
    color: var(--muted-text);
}

.home-new-grid,
.home-new-list {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: stretch;
}

.home-new-card,
.home-new-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    border-radius: 18px;
    background: var(--surface-color);
    border: 1px solid rgba(148, 163, 184, 0.18);
    text-decoration: none;
    color: inherit;
    box-shadow: 0 18px 36px -28px rgba(15, 23, 42, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-new-card:hover,
.home-new-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 28px 48px -30px rgba(79, 70, 229, 0.26);
}

.home-new-cover {
    flex: 0 0 96px;
    width: 96px;
    height: 132px;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(99, 102, 241, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary-dark);
}

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

.home-new-info {
    flex: 1;
    display：inline-flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.home-new-info strong {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.4;
}

.home-new-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--muted-text);
}

.home-new-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.home-new-meta a {
    color: inherit;
    font-weight: 600;
}

.home-new-time {
    margin-top: auto;
    font-size: 12px;
    color: var(--subtle-text);
}

.home-recommend-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.home-recommend-item {
    display: flex;
    align-items: stretch;
    gap: 18px;
    padding: 18px 22px;
    border-radius: 20px;
    background: var(--surface-color);
    border: 1px solid rgba(148, 163, 184, 0.18);
    text-decoration: none;
    color: inherit;
    box-shadow: 0 24px 44px -32px rgba(79, 70, 229, 0.26);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.home-recommend-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 32px 56px -30px rgba(79, 70, 229, 0.32);
}

.home-recommend-cover {
    flex: 0 0 110px;
    width: 110px;
    height: 148px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(99, 102, 241, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary-dark);
}

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

.home-recommend-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.home-recommend-info strong {
    font-size: 18px;
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
}

.home-recommend-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--muted-text);
}

.home-recommend-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.home-recommend-meta a {
    color: inherit;
    font-weight: 600;
}

.home-recommend-desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--muted-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.home-update-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.2fr) auto;
    grid-template-areas: "title author chapter time";
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--surface-color);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 18px 32px -26px rgba(15, 23, 42, 0.18);
    font-size: 13px;
    align-items: center;
}

.home-update-row .update-title {
    grid-area: title;
    font-weight: 600;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-update-row .update-author {
    grid-area: author;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted-text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-update-row .update-author a {
    color: inherit;
    font-weight: 600;
}

.home-update-row .update-chapter {
    grid-area: chapter;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-update-time {
    grid-area: time;
    text-align: right;
    color: var(--subtle-text);
    font-size: 12px;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .home-new-grid,
    .home-new-list {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }

    .home-recommend-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .home-update-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "title time"
            "chapter chapter"
            "author author";
        align-items: flex-start;
    }

    .home-update-row .update-title,
    .home-update-row .update-chapter {
        white-space: normal;
    }

    .home-update-time {
        text-align: right;
    }
}

@media (max-width: 680px) {
    .home-new-card,
    .home-new-item,
    .home-recommend-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-new-cover,
    .home-recommend-cover {
        width: 100%;
        height: auto;
        aspect-ratio: 3 / 4;
    }

    .home-update-row {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "author"
            "chapter"
            "time";
    }

    .home-update-row .update-title,
    .home-update-row .update-author,
    .home-update-row .update-chapter {
        white-space: normal;
    }

    .home-update-time {
        text-align: left;
    }
}

.btn,
.button,
button.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    border: 0;
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 18px 32px -22px rgba(99, 102, 241, 0.6);
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.btn:hover,
.button:hover,
button.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 40px -24px rgba(99, 102, 241, 0.65);
    filter: saturate(1.05);
}

.btn.secondary,
.button.secondary,
button.btn.secondary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 255, 0.92));
    color: var(--primary-color);
    border: 1px solid rgba(99, 102, 241, 0.32);
    box-shadow: 0 16px 30px -26px rgba(99, 102, 241, 0.4);
}

.btn.secondary:hover,
.button.secondary:hover,
button.btn.secondary:hover {
    color: var(--primary-dark);
}

.btn.small,
.button.small,
button.btn.small {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 999px;
}

.btn.ghost,
.button.ghost,
button.btn.ghost {
    background: transparent;
    color: var(--primary-color);
    border: 1px dashed rgba(99, 102, 241, 0.4);
    box-shadow: none;
}

.btn.ghost:hover,
.button.ghost:hover,
button.btn.ghost:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-dark);
}

.card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.92));
    border-radius: var(--radius-lg);
    padding: 26px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 28px 48px -32px rgba(15, 23, 42, 0.35);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 2px;
}

.section-head h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: -0.01em;
}

.section-head .tag {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: var(--radius-pill);
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-dark);
    border: 1px solid rgba(99, 102, 241, 0.22);
    text-decoration: none;
}

.section-head .tag:hover {
    background: rgba(99, 102, 241, 0.18);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

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

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.admin-table th,
.admin-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    text-align: left;
    font-size: 14px;
}

.admin-table th {
    font-weight: 600;
    color: var(--primary-dark);
}

.admin-table .table-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-color);
}

.admin-table .table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-search-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-search-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: var(--radius-md);
    background: rgba(248, 250, 255, 0.9);
    flex-wrap: wrap;
}

.admin-search-list .inline-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.form-field label {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-dark);
}

.form-field input,
.form-field textarea,
.form-field select {
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-color);
}

.form-field textarea {
    resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.meta-list {
    margin: 0;
    padding-left: 20px;
    color: var(--muted-text);
}

.topic-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topic-picker .btn.is-added {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-dark);
}
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(34, 197, 94, 0.18);
    color: #15803d;
}

.badge-muted {
    background: rgba(148, 163, 184, 0.2);
    color: var(--muted-text);
}

.home-hero {
    position: relative;
    max-width: 1180px;
    margin: 16px auto 36px;
    padding: 12px 32px 0;
}

.home-hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, 1fr);
    align-items: center;
    gap: 32px;
    padding: 40px 44px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(236, 72, 153, 0.18));
    border: 1px solid rgba(99, 102, 241, 0.18);
    box-shadow: 0 42px 80px -48px rgba(79, 70, 229, 0.4);
    overflow: hidden;
}

.home-hero-inner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.45), transparent 55%), radial-gradient(circle at 80% 85%, rgba(236, 72, 153, 0.28), transparent 60%);
    pointer-events: none;
    opacity: 0.7;
}

.home-hero-text,
.home-hero-visual {
    position: relative;
    z-index: 1;
}

.home-hero-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.35);
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.home-hero-title {
    margin: 16px 0 12px;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #111827;
}

.home-hero-summary {
    margin: 0 0 20px;
    font-size: 16px;
    line-height: 1.7;
    color: rgba(17, 24, 39, 0.86);
    max-width: 520px;
}

.home-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 18px;
    font-size: 13px;
    color: rgba(17, 24, 39, 0.72);
    margin-bottom: 22px;
}

.home-hero-actions {
    display: flex;
    gap: 14px;
}

.home-hero-actions .btn {
    min-width: 140px;
}

.home-hero-visual {
    display: flex;
    justify-content: center;
}

.home-hero-visual img {
    width: 260px;
    height: 360px;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: 0 32px 60px -38px rgba(17, 24, 39, 0.45);
}

.home-hero-placeholder {
    width: 260px;
    height: 360px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-dark);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(148, 163, 184, 0.2));
    box-shadow: 0 32px 60px -38px rgba(17, 24, 39, 0.45);
}


.tag,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 600;
}

.table-wrapper {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 18px 32px -26px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}

.table-wrapper table thead {
    background: rgba(99, 102, 241, 0.08);
}

.flash {
    border-radius: var(--radius-md);
    padding: 16px 20px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 20px 36px -30px rgba(15, 23, 42, 0.25);
}


.site-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 14px 28px -24px rgba(15, 23, 42, 0.35);
}

.site-search input[type="search"] {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    min-width: 140px;
    font-size: 14px;
    color: var(--text-color);
}

.site-search input[type="search"]::placeholder {
    color: var(--subtle-text);
}

.site-search button {
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    border: none;
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.site-search button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px -20px rgba(99, 102, 241, 0.45);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--subtle-text);
    white-space: nowrap;
}

.header-actions .avatar-small {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 12px 24px -18px rgba(99, 102, 241, 0.45);
}

.header-actions a {
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

.header-actions .btn {
    padding: 6px 16px;
    font-size: 13px;
}

.header-actions a.logout-link {
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-dark);
}

.header-actions a.logout-link:hover {
    background: rgba(99, 102, 241, 0.18);
}

.header-actions .meta {
    font-size: 13px;
    color: var(--muted-text);
}
footer {
    margin-top: 0px;
    padding: 36px 0 40px;
    background: rgba(15, 23, 42, 0.92);
    color: rgba(255, 255, 255, 0.72);
    text-align: center;
    font-size: 14px;
    letter-spacing: 0.04em;
}
@media (max-width: 1080px) {
    .category-layout {
        grid-template-columns: 1fr;
    }

    .category-aside {
        gap: 18px;
    }

    .discover-layout {
        grid-template-columns: 1fr;
    }

    .discover-aside {
        gap: 18px;
    }

    .user-dashboard {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 18px 16px;
    }

    .card {
        padding: 16px;
    }

    .grid {
        gap: 18px;
    }

    .tag {
        padding: 4px 10px;
    }

    .flex-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .chapter-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .chapter-tools {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
    }

    .chapter-sort {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .chapter-search {
        flex: 1 1 100%;
    }

    .chapter-tools input[type="search"] {
        width: 100%;
    }

    .category-toolbar {
        justify-content: flex-start;
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .category-per-page {
        width: 100%;
        justify-content: space-between;
    }

    .category-per-page select {
        min-width: 130px;
    }

    .category-layout {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .category-main,
    .category-aside,
    .category-aside .card {
        width: 100%;
    }

    .category-aside,
    .discover-aside,
    .novel-aside {
        flex-direction: column;
        width: 100%;
    }

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

    .category-latest-list {
        grid-template-columns: 1fr;
    }

    .category-novel {
        flex-direction: column;
    }

    .category-novel-cover {
        flex: 0 0 auto;
    }

    .category-novel-cover img,
    .category-novel-cover .cover-placeholder {
        width: 100%;
        height: 200px;
    }

    .discover-novel-list li {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .user-dashboard {
        grid-template-columns: 1fr;
        margin-top: 16px;
    }

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

    .user-shelf-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-history-card .list li {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    header {
        padding: 10px 14px;
    }

    .container {
        padding: 16px 14px;
    }

    .card {
        padding: 14px;
        border-radius: 12px;
    }

    .discover-ranking-list li {
        padding: 12px;
    }

    .discover-novel-list li {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .discover-novel-list .cover {
        width: 42px;
        height: 56px;
    }

    .category-recommend-list li {
        grid-template-columns: 56px minmax(0, 1fr);
    }

    .category-recommend-list .cover {
        width: 56px;
        height: 74px;
    }

    .chapter-list li {
        padding: 14px;
    }

    .category-toolbar label {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }

    .category-per-page select {
        flex: 0 0 140px;
    }

    .chapter-tools {
        gap: 8px;
    }
}

.avatar-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.avatar-small img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
}

.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px var(--shadow-light);
}

.card h2 {
    
    margin-top: 0;
    margin-left: 0;
    font-size: 18px;
    color: var(--primary-color);
}

.category-hero {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.category-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.category-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--muted-text);
}

.category-per-page select {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: #fff;
}

.category-latest-list {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.category-novel {
    display: flex;
    gap: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    background: #fff;
    box-shadow: 0 1px 2px var(--shadow-light);
}

.category-novel-cover {
    flex: 0 0 100px;
    margin:0 auto;
}

.category-novel-cover img {
    width: 96px;
    height: 128px;
    border-radius: 10px;
    object-fit: cover;
}

.category-novel-cover .cover-placeholder {
    width: 96px;
    height: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-novel-main h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.category-novel-main .meta {
    margin-bottom: 6px;
    color: var(--muted-text);
}

.category-novel-main .summary {
    margin: 0;
    color: var(--muted-text);
    line-height: 1.6;
}

.category-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: flex-start;
    margin-top: 24px;
}

.category-main,
.category-aside {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.category-aside .card {
    margin: 0;
}

.category-recommend-list,
.category-hot-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 16px;
}

.category-recommend-list li {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.category-recommend-list .cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 84px;
    border-radius: 8px;
    background: rgba(92, 106, 196, 0.18);
    font-weight: 600;
    color: var(--primary-color);
    overflow: hidden;
}

.category-recommend-list .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-recommend-list .cover.cover-placeholder {
    background: linear-gradient(135deg, rgba(92, 106, 196, 0.18), rgba(247, 108, 108, 0.16));
}

.category-recommend-list .info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-recommend-list .title {
    font-weight: 600;
    color: var(--text-color);
}

.category-recommend-list .title:hover {
    color: var(--primary-color);
}

.category-hot-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.category-hot-list li a {
    flex: 1;
    font-weight: 600;
    color: var(--text-color);
}

.category-hot-list li a:hover {
    color: var(--primary-color);
}

.discover-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: flex-start;
    margin-top: 24px;
}

.discover-main,
.discover-aside {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.discover-aside .card {
    margin: 0;
}

.discover-board-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.discover-board-tabs,
.discover-period-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.discover-period-tabs {
    margin-top: 12px;
}

.discover-ranking-list {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.discover-ranking-list li {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    padding: 14px 16px;
    background: #fff;
}

.discover-ranking-list strong a {
    font-weight: 700;
    color: var(--text-color);
}

.discover-ranking-list strong a:hover {
    color: var(--primary-color);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.discover-novel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 16px;
}

.discover-novel-list li {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.discover-novel-list .cover {
    width: 56px;
    height: 72px;
    border-radius: 8px;
    background: rgba(92, 106, 196, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary-color);
    overflow: hidden;
}

.discover-novel-list .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discover-novel-list .cover.cover-placeholder {
    background: linear-gradient(135deg, rgba(92, 106, 196, 0.18), rgba(247, 108, 108, 0.16));
}

.discover-novel-list .info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.discover-novel-list .title {
    font-weight: 600;
    color: var(--text-color);
}

.discover-novel-list .title:hover {
    color: var(--primary-color);
}

.pagination-bar {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.user-dashboard {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
    align-items: flex-start;
    margin-top: 24px;
}

.user-sidebar,
.user-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.user-profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.user-avatar-preview img,
.user-avatar-preview .avatar-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-preview .avatar-placeholder {
    background: var(--primary-color);
    color: #fff;
    font-size: 32px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile-meta h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.user-profile-meta .meta {
    margin: 0 0 6px;
}

.user-profile-meta .signature {
    margin: 0;
    color: var(--muted-text);
    line-height: 1.5;
}

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

.user-profile-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: var(--muted-text);
}

.user-profile-form input[type="text"],
.user-profile-form input[type="file"],
.user-profile-form textarea {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

.user-profile-form textarea {
    resize: vertical;
}

.user-profile-form .full-row {
    grid-column: 1 / -1;
}

.user-profile-form .user-checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    grid-column: 1 / -1;
}

.user-profile-actions {
    display: flex;
    justify-content: flex-end;
}

.user-shelf-create {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.user-shelf-create input[type="text"] {
    flex: 1 1 50px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.user-shelf {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    background: #fff;
}

.user-shelf-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 28px -24px var(--shadow-medium);
}

.user-shelf-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted-text);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.user-shelf-tab:hover,
.user-shelf-tab:focus-visible {
    color: var(--primary-color);
    border-color: rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.08);
    outline: none;
}

.user-shelf-tab.is-active {
    color: #fff;
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 10px 22px -16px rgba(99, 102, 241, 0.4);
}

.user-shelf-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
}

.user-shelf-tab.is-active .user-shelf-count {
    background: rgba(255, 255, 255, 0.32);
}

.user-shelf-panes {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.user-shelf-pane {
    display: none;
}

.user-shelf-pane.is-active {
    display: block;
}

.user-shelf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.user-shelf-header h3 {
    margin: 0;
    font-size: 17px;
}

.user-shelf-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-shelf-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.user-shelf-controls select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.user-shelf-list label {
    display: flex;
    gap: 8px;
    align-items: center;
}

.user-history-card .list li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.user-history-card .list li > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-history-card .list li .meta {
    color: var(--muted-text);
}

.user-history-list a {
    font-weight: 600;
}

.card h3 {
    margin-top: 0;
    font-size: 16px;
    color: var(--text-color);
}

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

.list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
}

.list li:last-child {
    border-bottom: none;
}

.novel-item {
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
}

.novel-item img {
    width: 84px;
    height: 118px;
    border-radius: 8px;
    object-fit: cover;
}

.cover-placeholder {
    width: 84px;
    height: 118px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(92, 106, 196, 0.15), rgba(247, 108, 108, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-weight: 600;
}

.novel-info {
    flex: 1;
}

.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(92, 106, 196, 0.12);
    color: var(--primary-color);
    font-size: 12px;
    border-radius: 999px;
    padding: 4px 12px;
    margin-right: 8px;
    margin-bottom: 6px;
}

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

.discover-board-tabs .tag,
.discover-period-tabs .tag {
    margin-bottom: 4px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    background: var(--primary-color);
    color: #fff;
    cursor: pointer;
    font-size: 15px;
}

.btn.secondary {
    background: #fff;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn.danger {
    background: #f6685e;
    border: 1px solid #f6685e;
    color: #fff;
}

.btn.danger:hover {
    background: #e35248;
    border-color: #e35248;
}

.btn + .btn {
    margin-left: 12px;
}

form.grid label {
    display: block;
}

form.grid input[type="text"],
form.grid input[type="password"],
form.grid input[type="email"],
form.grid input[type="time"],
form.grid select,
form.grid textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-family: inherit;
    margin-top: 6px;
    margin-bottom: 12px;
}

textarea {
    resize: vertical;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meta {
    font-size: 13px;
    color: var(--muted-text);
}

.flash {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.flash-success {
    background: #e6f7f1;
    border-color: #9de0c6;
    color: #0f8a5f;
}

.flash-error {
    background: #fdecea;
    border-color: #f5b5af;
    color: #c0392b;
}

.flash-info {
    background: #eef2ff;
    border-color: #cdd5ff;
    color: #3949ab;
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

.reading-content {
    border-radius: 14px;
    padding: 15px;
    line-height: 1;
    font-size: 18px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
    transition: background 0.25s ease, color 0.25s ease;
}

.reading-content article {
    /*white-space: pre-wrap;*/
}

.font-songti {
    font-family: "SimSun", "Songti SC", serif;
}

.font-heiti {
    font-family: "Microsoft YaHei", "PingFang SC", "Heiti SC", sans-serif;
}

.font-kaiti {
    font-family: "DFKai-SB", "STKaiti", "KaiTi", serif;
}

.font-size-small {
    font-size: 16px;
    line-height: 1.2;
}

.font-size-medium {
    font-size: 18px;
    line-height: 1.3;
}

.font-size-large {
    font-size: 20px;
    line-height: 1.4;
}

.font-size-xlarge {
    font-size: 22px;
    line-height: 1.5;
}

.bg-light {
    background: linear-gradient(180deg, #fffdf6 0%, #fef3dd 100%);
    color: #2c241b;
    border: 1px solid rgba(240, 228, 204, 0.8);
    box-shadow: 0 18px 46px rgba(240, 220, 170, 0.28);
}

.bg-sepia {
    background: linear-gradient(180deg, #f7f1e3 0%, #f0e2c9 100%);
    color: #3a3023;
    border: 1px solid rgba(234, 216, 184, 0.8);
    box-shadow: 0 18px 48px rgba(234, 216, 184, 0.3);
}

.bg-cream {
    background: linear-gradient(180deg, #fdf8f1 0%, #f6eadc 100%);
    color: #342b21;
    border: 1px solid rgba(241, 228, 208, 0.75);
    box-shadow: 0 18px 48px rgba(241, 228, 208, 0.28);
}

.bg-gray {
    background: linear-gradient(180deg, #f2f4f7 0%, #e5ecf4 100%);
    color: #1f2937;
    border: 1px solid rgba(203, 213, 225, 0.8);
    box-shadow: 0 18px 48px rgba(148, 163, 184, 0.26);
}

.bg-dark {
    background: linear-gradient(180deg, #111827 0%, #0b1120 100%);
    color: #e8f0ff;
    border: 1px solid rgba(59, 72, 99, 0.7);
    box-shadow: 0 24px 56px rgba(2, 6, 23, 0.65);
}

.bg-dark a {
    color: #c7d2fe;
}

.bg-dark a:hover {
    color: #e0e7ff;
}

.reading-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.bookmark-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.bookmark-form input[type="text"] {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 220px;
}

.reader-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin: 18px 0;
}

.reading-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 16px 0;
}

.reading-meta-line {
    font-size: 14px;
    color: var(--muted-text);
}

.reader-group {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f5f6fb;
    border-radius: 12px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
}

.reader-group-label {
    font-size: 12px;
    color: var(--muted-text);
    margin-right: 4px;
}

.reader-btn {
    background: transparent;
    border: none;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--muted-text);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.reader-btn:hover {
    background: rgba(92, 106, 196, 0.12);
    color: var(--primary-color);
}

.reader-btn.is-active {
    background: var(--primary-color);
    color: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background: #fff;
}

table th,
table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: middle;
}

table th {
    background: #f3f5fb;
    font-weight: 600;
}

table tr:last-child td {
    border-bottom: none;
}

details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-color);
}

details form {
    margin-top: 16px;
}

footer {
    text-align: center;
    padding: 24px;
    color: var(--muted-text);
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    nav a {
        margin-left: 0;
    }

    .container {
        padding: 16px;
    }

    .grid-3,
    .grid-2 {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .site-search {
        width: 100%;
        justify-content: center;
    }

    .site-search input[type="search"] {
        min-width: 0;
        width: 70%;
    }
}


.site-search {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card .site-search {
    margin-top: 12px;
}

.site-search input[type="search"] {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 14px;
    min-width: 200px;
}

.site-search button {
    padding: 6px 14px;
    border: none;
    border-radius: 999px;
    background: var(--primary-color);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

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

.site-header .site-search {
    padding: 8px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 14px 28px -24px rgba(15, 23, 42, 0.35);
    background: rgba(255, 255, 255, 0.85);
}

.site-header .site-search input[type="search"] {
    min-width: 0;
    width: 100%;
    border: none;
    padding: 0;
    background: transparent;
    font-size: 14px;
}

.site-header .site-search button {
    padding: 8px 16px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    margin-left: auto;
}

.header-actions .avatar-small {
    margin-right: 0;
}

.header-actions .logout-link {
    color: var(--primary-color);
    font-weight: 600;
}

.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    padding: 32px;
    align-items: flex-start;
}

.admin-workspace {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.admin-sidebar {
    width: 240px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.admin-sidebar-header {
    margin-bottom: 18px;
}

.admin-sidebar-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.admin-sidebar .admin-logout {
    display: inline-flex;
    margin-top: 6px;
    font-size: 13px;
    color: var(--accent-color);
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-nav-link {
    display: block;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--text-color);
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.admin-nav-link:hover {
    text-decoration: none;
    background: rgba(92, 106, 196, 0.12);
}

.admin-nav-link.active {
    background: var(--primary-color);
    color: #fff;
}

.admin-main {
    flex: 1;
    min-width: 0;
}

.home-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 1px solid rgba(99, 102, 241, 0.12);
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.home-section::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.55;
    background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.16), transparent 55%), radial-gradient(circle at bottom right, rgba(236, 72, 153, 0.12), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.home-section > * {
    position: relative;
    z-index: 1;
}

.home-section h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 12px;
}

.home-section h2::after {
    content: "";
    flex: 1;
    height: 2px;
    border-radius: var(--radius-pill);
    background: rgba(99, 102, 241, 0.22);
}

.novel-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.novel-card {
    display: flex;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.novel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px var(--shadow-light);
    text-decoration: none;
}

.author-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.author-header-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 600;
    color: var(--subtle-text);
}

.author-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-header-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.author-header-info h1 {
    margin: 0;
    font-size: 24px;
}

.author-header-info .meta {
    white-space: pre-wrap;
    line-height: 1.6;
}

.author-novel-card {
    margin-top: 24px;
}

.author-novel-card .meta {
    line-height: 1.5;
}

@media (max-width: 720px) {
    .author-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
    }

    .author-header-info {
        align-items: center;
    }

    .author-header-info h1 {
        font-size: 20px;
    }
}

.novel-card-cover {

    height: 102px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(92, 106, 196, 0.18), rgba(247, 108, 108, 0.22));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-weight: 600;
    margin:0 auto;
}


.novel-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.novel-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.novel-card-body strong {
    font-size: 15px;
    color: var(--text-color);
}

.novel-card-body .meta {
    font-size: 13px;
    color: var(--muted-text);
}

.home-author-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.home-author-list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
}

.author-alpha-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 20px;
}

.author-alpha-nav a {
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(99, 102, 241, 0.25);
    background: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 600;
    color: var(--muted-text);
    transition: all 0.2s ease;
}

.author-alpha-nav a:hover,
.author-alpha-nav a:focus-visible {
    color: var(--primary-color);
    border-color: rgba(99, 102, 241, 0.55);
    box-shadow: 0 10px 22px -18px rgba(99, 102, 241, 0.4);
}

.author-alpha-section {
    margin-top: 24px;
}

.author-alpha-section h2 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--primary-dark);
}

.author-index {
    margin-top: 18px;
}

.author-index-name {
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
}

.author-index-name:hover,
.author-index-name:focus-visible {
    color: var(--primary-color);
}

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

.home-update-item {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(0, 2fr) auto;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
    align-items: center;
}

.home-update-item:last-child {
    border-bottom: none;
}

.home-update-item > * {
    min-width: 0;
}

.home-update-item .update-title,
.home-update-item .update-chapter {
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-update-item .update-title:hover,
.home-update-item .update-chapter:hover {
    color: var(--primary-color);
}

.home-update-item .update-author {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: var(--muted-text);
}

.home-update-item .update-author a {
    color: inherit;
    font-weight: 500;
    text-decoration: none;
}

.home-update-item .update-author a:hover {
    color: var(--primary-color);
}

.home-update-item .update-time {
    font-size: 0.85rem;
    color: var(--muted-text);
    justify-self: end;
}



.site-main {
    width: 100%;
    max-width: 1180px;
    margin: 10px auto 10px;
    padding: 0 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.admin-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.admin-workspace {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.footer-meta {
    font-size: 13px;
    letter-spacing: 0.04em;
    opacity: 0.85;
}

.avatar-placeholder {
    background: rgba(99, 102, 241, 0.18);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
@media (max-width: 720px) {
    .home-update-item {
        grid-template-columns: 1fr;
        row-gap: 6px;
        padding: 14px 0;
    }

    .home-update-item .update-title,
    .home-update-item .update-chapter {
        white-space: normal;
    }

    .home-update-item .update-author {
        font-size: 0.9rem;
    }

    .home-update-item .update-time {
        justify-self: flex-start;
    }
}

.home-category-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.home-category-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn.ghost {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid rgba(92, 106, 196, 0.4);
}

.btn.ghost:hover {
    background: rgba(92, 106, 196, 0.08);
    color: var(--primary-color);
}

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: #eef0ff;
    color: var(--muted-text);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.chip.is-active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 10px 18px rgba(92, 106, 196, 0.28);
}

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

.novel-hero-grid {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px;
}

.novel-hero-cover {
    width: 100%;
    min-height: 260px;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(92, 106, 196, 0.18), rgba(247, 108, 108, 0.24));
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.cover-large {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 36px;
    font-weight: 600;
}

.novel-hero-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.novel-hero-title {
    margin: 0;
    font-size: 30px;
    color: var(--text-color);
}

.novel-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    font-size: 13px;
    color: var(--muted-text);
}

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

.novel-hero-summary {
    font-size: 14px;
    line-height: 1.8;
    color: var(--muted-text);
}

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

.novel-hero-tip {
    font-size: 13px;
    color: var(--muted-text);
    background: rgba(92, 106, 196, 0.08);
    padding: 10px 14px;
    border-radius: 12px;
}

.novel-shelf-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.novel-shelf-form select {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #fff;
}

.novel-layout {
    margin-top: 28px;
    /*display: grid;*/
    gap: 24px;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.novel-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.novel-aside {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.chapter-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
}

.chapter-card-header h2 {
    margin-bottom: 4px;
}

.chapter-meta {
    font-size: 13px;
    color: var(--muted-text);
    margin: 0;
}

.chapter-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chapter-search {
    display: inline-flex;
    align-items: center;
}

.chapter-search input {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: #f6f7ff;
    font-size: 13px;
    min-width: 200px;
}

.chapter-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(92, 106, 196, 0.18);
}

.chapter-list {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.chapter-list li {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    background: #fff;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    
}

.chapter-list li:hover {
    box-shadow: 0 10px 26px rgba(92, 106, 196, 0.16);
    transform: translateY(-2px);
}

.chapter-list .chapter-seq {
    font-size: 13px;
    color: var(--muted-text);
}

.chapter-list .chapter-title {
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chapter-list .chapter-title:hover {
    color: var(--primary-color);
}

.chapter-list .chapter-time {
    font-size: 12px;
    color: var(--muted-text);
    margin-top: auto;
}

.chapter-empty {
    margin-top: 14px;
    text-align: center;
    font-size: 13px;
    color: var(--muted-text);
}
.chapter-heading{
    background: none;
}
article h1{
    margin:0;
    padding:0;
}

.review-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

.review-form select,
.review-form textarea {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    background: #fff;
}

.review-form textarea {
    resize: vertical;
    min-height: 90px;
}

.review-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-item {
    background: #f7f8ff;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.review-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--muted-text);
}

.review-head strong {
    color: var(--text-color);
}

.tag-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.tag-form input {
    flex: 1;
    min-width: 220px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.tag-form input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(92, 106, 196, 0.16);
}

.bookmark-list {
    margin-top: 12px;
}

.bookmark-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 6px;
}

.bookmark-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bookmark-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.bookmark-list li span {
    color: var(--muted-text);
}

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

.novel-related-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.novel-related-list span {
    color: var(--muted-text);
}

.chapter-page {
    width: 100%;
    margin: 0;
}

.chapter-page.reader-shell {
    position: relative;
    min-height: calc(100vh - var(--reader-top-offset));
    padding: calc(var(--reader-top-offset) + 120px) clamp(16px, 6vw, 48px) clamp(220px, 30vh, 260px);
    background: linear-gradient(180deg, #eef2ff 0%, #f4f7ff 48%, #ffffff 100%);
    transition: background 0.3s ease, color 0.3s ease;
}

.chapter-page.reader-shell[data-theme="sepia"] {
    background: linear-gradient(180deg, #fbf0dc 0%, #fdf6e9 52%, #fff9ef 100%);
}

.chapter-page.reader-shell[data-theme="cream"] {
    background: linear-gradient(180deg, #fdf7ee 0%, #fffdf7 45%, #ffffff 100%);
}

.chapter-page.reader-shell[data-theme="gray"] {
    background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 55%, #ffffff 100%);
}

.chapter-page.reader-shell[data-theme="dark"] {
    background: linear-gradient(180deg, #0f172a 0%, #111827 45%, #1e293b 100%);
    color: #e2e8f0;
}

.chapter-page.reader-shell[data-theme="dark"] .reader-breadcrumb {
    color: rgba(148, 163, 184, 0.82);
}

.chapter-page.reader-shell[data-theme="dark"] .reader-breadcrumb span:last-child {
    color: #a5b4fc;
}

.chapter-page.reader-shell[data-theme="dark"] .reader-meta {
    color: rgba(226, 232, 240, 0.75);
}

.chapter-page.reader-shell[data-theme="dark"] .reader-meta a {
    color: #a5b4fc;
}

.chapter-page.reader-shell[data-theme="dark"] .chapter-info-cards .card {
    background: rgba(17, 24, 39, 0.72);
    border-color: rgba(59, 72, 99, 0.6);
    box-shadow: 0 24px 48px rgba(2, 6, 23, 0.45);
}

.chapter-page.reader-shell[data-theme="sepia"] .chapter-info-cards .card {
    background: rgba(250, 243, 228, 0.85);
    border-color: rgba(234, 216, 184, 0.6);
}

.chapter-page.reader-shell[data-theme="cream"] .chapter-info-cards .card {
    background: rgba(253, 247, 238, 0.85);
    border-color: rgba(241, 228, 208, 0.6);
}

.chapter-page.reader-shell[data-theme="gray"] .chapter-info-cards .card {
    background: rgba(241, 245, 249, 0.85);
    border-color: rgba(203, 213, 225, 0.6);
}

.chapter-page.reader-shell[data-theme="dark"] .chapter-hotkeys-tip {
    background: rgba(148, 163, 184, 0.18);
    color: rgba(226, 232, 240, 0.78);
}

.chapter-page.reader-shell[data-theme="dark"] .chapter-bookmark-card textarea {
    background: rgba(30, 41, 59, 0.72);
    border-color: rgba(59, 72, 99, 0.55);
}

.reader-main {
    width: 100%;
}

.reader-main-inner {
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.reader-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    letter-spacing: 0.04em;
    color: var(--subtle-text);
    text-transform: uppercase;
}

.reader-breadcrumb a {
    color: inherit;
    opacity: 0.85;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.reader-breadcrumb a:hover {
    opacity: 1;
    color: var(--primary-color);
}

.reader-breadcrumb span:last-child {
    color: var(--primary-dark);
    opacity: 1;
}

.reader-breadcrumb .breadcrumb-sep {
    opacity: 0.6;
}

.reader-heading h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    letter-spacing: -0.01em;
    color: inherit;
}

.reader-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    font-size: 13px;
    color: var(--muted-text);
}

.reader-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.reader-meta a {
    color: var(--primary-color);
}

.reader-extras {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 18px;
}

.reading-wrapper {
    position: relative;
    padding: 0;
}

.reading-content {
    border-radius: clamp(20px, 3vw, 32px);
    padding: clamp(32px, 6vw, 10px);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.5);
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.08);
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.reading-content article {
    font-size: 1em;
    line-height: 1.9;
    color: currentColor;
    word-break: break-word;
    text-align: justify;
}

.chapter-hotkeys-tip {
    align-self: center;
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    color: var(--muted-text);
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.chapter-info-cards {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.chapter-info-cards .card {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    padding: 22px 24px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.chapter-info-cards .card h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 18px;
    color: var(--text-color);
}

.chapter-detail-card p {
    margin: 8px 0;
    font-size: 14px;
    color: var(--muted-text);
}

.chapter-bookmark-card textarea {
    width: 100%;
    min-height: 100px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.72);
    padding: 12px 14px;
    font-size: 14px;
    resize: vertical;
    color: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chapter-bookmark-card textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22);
}

.reader-hud {
    position: fixed;
    left: 50%;
    width: min(94%, 860px);
    pointer-events: none;
    opacity: 0;
    transform: translate3d(-50%, -16px, 0);
    transition: opacity 0.25s ease, transform 0.25s ease;
    border-radius: 20px;
    z-index: 130;
    backdrop-filter: blur(18px);
}

.reader-hud.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.reader-hud[data-reader-hud="top"] {
    top: var(--reader-top-offset);
    background: rgba(15, 23, 42, 0.82);
    color: #f8fafc;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
}

.reader-hud[data-reader-hud="bottom"] {
    bottom: 40px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-color);
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 40px 80px rgba(15, 23, 42, 0.22);
    transform: translate3d(-50%, 24px, 0);
}

.reader-hud[data-reader-hud="bottom"].is-visible {
    transform: translate3d(-50%, 0, 0);
}

.reader-hud[data-reader-hud="bottom"][data-theme="sepia"] {
    background: rgba(250, 243, 228, 0.95);
    color: #3a3023;
    border-color: rgba(234, 216, 184, 0.7);
}

.reader-hud[data-reader-hud="bottom"][data-theme="cream"] {
    background: rgba(253, 247, 238, 0.95);
    color: #342b21;
    border-color: rgba(241, 228, 208, 0.7);
}

.reader-hud[data-reader-hud="bottom"][data-theme="gray"] {
    background: rgba(241, 245, 249, 0.94);
    color: #1f2937;
    border-color: rgba(203, 213, 225, 0.7);
}

.reader-hud[data-reader-hud="bottom"][data-theme="dark"] {
    background: rgba(15, 23, 42, 0.94);
    color: #e2e8f0;
    border-color: rgba(59, 72, 99, 0.6);
    box-shadow: 0 40px 90px rgba(2, 6, 23, 0.6);
}

.reader-hud-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 24px;
    width: 100%;
}

.reader-hud-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.reader-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
    font-size: 22px;
    transition: background 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

.reader-back:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.reader-back-icon {
    line-height: 1;
}

.reader-hud-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.reader-hud-overline {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.7;
}

.reader-hud-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    color: inherit;
}

.reader-hud-sub {
    font-size: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    color: rgba(248, 250, 252, 0.78);
}

.reader-hud-sub a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.35);
}

.reader-hud[data-reader-hud="bottom"] .reader-hud-sub {
    color: inherit;
    opacity: 0.7;
}

.reader-hud-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.reader-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: transparent;
    color: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.reader-icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.reader-hud-actions .reader-btn.is-active {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    color: inherit;
}

.reader-progress {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.reader-progress-label {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0.75;
}

.reader-progress-sub {
    font-size: 12px;
    opacity: 0.6;
}

.reader-nav {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
}

.reader-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 76px;
    padding: 12px 16px;
    border-radius: 18px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    border: 1px solid transparent;
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 20px 38px rgba(99, 102, 241, 0.32);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.reader-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 26px 48px rgba(99, 102, 241, 0.38);
}

.reader-nav-btn.is-ghost {
    background: rgba(99, 102, 241, 0.14);
    color: var(--primary-dark);
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: none;
}

.reader-nav-btn.is-outline {
    background: rgba(255, 255, 255, 0.7);
    color: var(--primary-color);
    border-style: dashed;
    border-color: rgba(148, 163, 184, 0.45);
    box-shadow: none;
}

.reader-nav-btn.is-disabled {
    background: rgba(148, 163, 184, 0.22);
    color: rgba(148, 163, 184, 0.9);
    border-color: rgba(148, 163, 184, 0.4);
    cursor: default;
    box-shadow: none;
    transform: none;
}

.reader-hud[data-reader-hud="bottom"][data-theme="dark"] .reader-nav-btn.is-ghost,
.reader-hud[data-reader-hud="bottom"][data-theme="dark"] .reader-nav-btn.is-outline {
    background: rgba(148, 163, 184, 0.12);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.4);
}

.reader-nav-label {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.72;
}

.reader-nav-title {
    margin-top: 6px;
    font-size: 15px;
    line-height: 1.35;
    color: inherit;
}

.reader-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(13, 19, 45, 0.35);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 90;
}

.reader-panel-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.reader-panel {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background: #fff;
    box-shadow: -18px 0 40px rgba(9, 12, 44, 0.12);
    padding: 26px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: right 0.25s ease;
    z-index: 91;
}

.reader-panel.is-open {
    right: 0;
}

.reader-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reader-panel-close {
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    color: var(--muted-text);
}

.reader-panel-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.reader-floating {
    position: fixed;
    right: 28px;
    bottom: 90px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 120;
}

.reader-floating.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.floating-btn {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(15, 23, 42, 0.88);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.floating-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.42);
}

.reader-panel .reader-group {
    flex-direction: column;
    align-items: flex-start;
}

.reader-panel .reader-btn {
    width: 100%;
    justify-content: flex-start;
}

body.reader-panel-active {
    overflow: hidden;
}

@media (max-width: 1080px) {
    :root {
        --reader-top-offset: 88px;
    }

    .chapter-page.reader-shell {
        padding: calc(var(--reader-top-offset) + 96px) clamp(16px, 5vw, 40px) clamp(200px, 26vh, 230px);
    }

    .reader-hud {
        width: min(94%, 720px);
    }

    .reader-hud-inner {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    :root {
        --reader-top-offset: 72px;
    }

    .chapter-page.reader-shell {
        padding: calc(var(--reader-top-offset) + 80px) clamp(14px, 4vw, 28px) 184px;
    }

    .reader-main-inner {
        gap: 22px;
    }

    .reading-content {
        padding: clamp(28px, 8vw, 42px);
    }

    .reader-hud {
        width: min(96%, 640px);
    }

    .reader-hud-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .reader-hud-actions {
        width: 100%;
        justify-content: flex-start;
    }

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

@media (max-width: 600px) {
    :root {
        --reader-top-offset: 64px;
    }

    .chapter-page.reader-shell {
        padding: calc(var(--reader-top-offset) + 72px) 14px 168px;
    }

    .reader-breadcrumb {
        font-size: 12px;
    }

    .reading-content {
        padding: clamp(24px, 9vw, 36px);
    }

    .reader-icon-btn {
        flex: 1 1 calc(50% - 8px);
        min-width: auto;
        height: 42px;
        font-size: 13px;
        padding: 0 12px;
    }

    .reader-back {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .reader-hud {
        width: min(96%, 520px);
    }

    .reader-hud[data-reader-hud="bottom"] {
        bottom: 28px;
    }

    .reader-nav {
        grid-template-columns: 1fr;
    }

    .reader-nav-btn {
        min-height: 64px;
    }

    .chapter-hotkeys-tip {
        font-size: 11px;
    }

    .reader-hud-actions {
        gap: 8px;
    }

    .reader-floating {
        right: 18px;
        bottom: 74px;
    }

    .floating-btn {
        width: 44px;
        height: 44px;
    }
}


@media (max-width: 960px) {
    .admin-layout {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .admin-sidebar {
        position: static;
        width: 100%;
        max-height: none;
    }

    .admin-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .admin-nav-link {
        flex: 1 0 calc(50% - 8px);
        text-align: center;
    }

    .admin-workspace {
        gap: 20px;
    }

    .home-layout {
        grid-template-columns: 1fr;
        padding: 0 24px;
    }

    .home-sidebar {
        flex-direction: column;
    }

    .home-sidebar .home-widget {
        width: 100%;
    }

    .home-hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 32px;
        gap: 28px;
    }

    .home-hero-meta {
        justify-content: center;
    }

    .home-hero-actions {
        justify-content: center;
    }

    .home-hero-visual img,
    .home-hero-placeholder {
        width: 220px;
        height: 300px;
    }
}

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

    .novel-card-cover {
        
        magin:0 auto;
    }

    .home-hero {
        padding: 0 18px;
        margin: 12px auto 24px;
    }

    .home-hero-inner {
        padding: 26px;
    }

    .home-hero-title {
        font-size: 26px;
    }

    .home-hero-summary {
        font-size: 14px;
    }

    .home-wrapper {
        padding: 0 18px 48px;
    }

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

    .home-card-cover {
        height: 200px;
    }
}

@media (max-width: 540px) {
    .home-hero-actions {
        flex-direction: column;
    }

    .home-hero-visual img,
    .home-hero-placeholder {
        width: 200px;
        height: 260px;
    }

    .home-list-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-list-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .home-update-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .home-update-time {
        text-align: left;
    }
}

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

    .novel-aside {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
    }

    .novel-aside .card {
        flex: 1 1 300px;
    }
}

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

    .novel-hero-cover {
        min-height: 220px;
    }

    .chapter-container {
        padding: 22px 18px;
        border-radius: 16px;
    }


    .chapter-bottom-nav .btn {
        flex: 1 1 100%;
    }

    .reader-panel {
        width: 260px;
    }

    .reader-floating {
        right: 16px;
        bottom: 70px;
    }
}

@media (max-width: 640px) {
    .novel-hero-actions .btn {
        flex: 1 1 100%;
        justify-content: center;
    }

    .novel-shelf-form {
        flex-direction: column;
        align-items: stretch;
    }

    .chapter-search input {
        min-width: 0;
        width: 100%;
    }

    .chapter-actions .btn,
    .chapter-pagination .btn {
        flex: 1 1 100%;
        justify-content: center;
    }

    .chapter-info-strip {
        flex-direction: column;
        gap: 10px;
    }

    .chapter-container {
        padding: 20px 14px;
    }

    .reader-panel {
        width: 100%;
        right: -100%;
    }

    .reader-panel.is-open {
        right: 0;
    }

    .reader-floating {
        right: 12px;
        bottom: 60px;
    }

    .user-shelf-tabs {
        padding: 6px;
        gap: 6px;
    }

    .user-shelf-tab {
        font-size: 12px;
        padding: 6px 10px;
    }

    .user-shelf-count {
        min-width: 18px;
        padding: 2px 5px;
    }
}

@media (max-width: 960px) {
    .category-layout,
    .discover-layout,
    .user-dashboard {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .category-main,
    .category-aside,
    .discover-main,
    .discover-aside,
    .user-sidebar,
    .user-main {
        width: 100%;
    }

    .category-main,
    .discover-main,
    .user-main {
        order: 1;
    }

    .category-aside,
    .discover-aside,
    .user-sidebar {
        order: 2;
    }

    .category-aside .card,
    .discover-aside .card,
    .user-sidebar .card {
        width: 100%;
        margin: 0;
    }

    .user-shelf-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 6px 8px;
        gap: 8px;
    }

    .user-shelf-tabs::-webkit-scrollbar {
        display: none;
    }

    .user-shelf-tab {
        flex: 0 0 auto;
        font-size: 13px;
        padding: 6px 12px;
    }
}

@media (max-width: 768px) {
    .category-novel,
    .discover-ranking-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .user-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }

    .user-profile-meta {
        align-items: center;
    }

    .user-shelf-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
}

@media (max-width: 540px) {
    .discover-board-tabs,
    .discover-period-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }

    .discover-novel-list li {
        align-items: flex-start;
    }

    .category-latest-list {
        gap: 18px;
    }

    .category-novel-cover img,
    .discover-novel-list .cover img {
        width: 100%;
        height: 200px;
        object-fit: cover;
        border-radius: 12px;
    }
}
