:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #14b8a6;
    --primary-bg: #ecfdf5;
    --accent: #d97706;
    --accent-light: #fbbf24;
    --bg: #f8f6f2;
    --bg-card: #ffffff;
    --text: #1c1917;
    --text-muted: #78716c;
    --border: #e7e5e4;
    --shadow: 0 1px 3px rgba(28,25,23,.06), 0 4px 16px rgba(28,25,23,.04);
    --shadow-lg: 0 8px 32px rgba(28,25,23,.1);
    --radius: 14px;
    --radius-sm: 8px;
    --font-reading: "Noto Serif SC", "Source Han Serif SC", "SimSun", Georgia, serif;
    --font-ui: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    --header-h: 64px;
    --reading-font-size: 18px;
    --reading-line-height: 2;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-ui);
    background: var(--bg);
    background-image: radial-gradient(circle at 20% 0%, rgba(13,148,136,.04) 0%, transparent 50%),
                      radial-gradient(circle at 80% 100%, rgba(217,119,6,.04) 0%, transparent 50%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }

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

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header — 固定浅色，不受阅读主题影响 */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid #e7e5e4;
    height: var(--header-h);
    color: #1c1917;
}

.header-inner {
    display: flex; align-items: center; gap: 20px;
    height: var(--header-h);
}

.logo {
    display: flex; align-items: center; gap: 8px;
    font-size: 1.2rem; font-weight: 700; color: #1c1917;
    white-space: nowrap; flex-shrink: 0;
}
.logo:hover { color: var(--primary); }
.logo-icon { font-size: 1.4rem; }

.main-nav {
    display: flex; gap: 2px; flex: 1; overflow-x: auto;
    scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
    padding: 6px 12px; border-radius: 20px;
    color: #57534e; font-size: .875rem; white-space: nowrap;
    transition: all .2s;
}
.main-nav a:hover { background: var(--primary-bg); color: var(--primary); }
.main-nav a.active {
    background: var(--primary); color: #fff; font-weight: 500;
}

.search-form {
    display: flex; align-items: center;
    background: #f5f5f4; border-radius: 24px;
    padding: 4px 4px 4px 16px; min-width: 200px;
    border: 1px solid transparent; transition: border-color .2s;
}
.search-form:focus-within { border-color: var(--primary-light); background: #fff; }
.search-form input {
    border: none; background: none; outline: none;
    font-size: .875rem; flex: 1; color: #1c1917;
}
.search-form input::placeholder { color: #78716c; }
.search-form button {
    background: var(--primary); color: #fff; border: none;
    border-radius: 50%; width: 32px; height: 32px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.search-form button:hover { background: var(--primary-dark); }

.mobile-menu-btn {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 4px;
}
.mobile-menu-btn span {
    display: block; width: 22px; height: 2px;
    background: #1c1917; border-radius: 2px; transition: transform .2s;
}

/* Hero */
.hero {
    position: relative; color: #fff; padding: 72px 0 64px; overflow: hidden;
}
.hero-bg {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 40%, #0891b2 100%);
}
.hero-bg::after {
    content: ""; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-inner {
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: space-between; gap: 48px;
}
.hero-badge {
    display: inline-block; padding: 4px 12px; border-radius: 20px;
    background: rgba(255,255,255,.15); font-size: .8rem; margin-bottom: 16px;
    backdrop-filter: blur(4px);
}
.hero-text h1 { font-size: 2.75rem; font-weight: 800; margin-bottom: 14px; line-height: 1.15; letter-spacing: -.02em; }
.hero-text p { font-size: 1.05rem; opacity: .92; margin-bottom: 28px; max-width: 480px; }

.hero-search {
    display: flex; max-width: 480px;
    background: rgba(255,255,255,.12); border-radius: 12px;
    padding: 4px; backdrop-filter: blur(8px);
}
.hero-search input {
    flex: 1; border: none; background: rgba(255,255,255,.95);
    padding: 13px 16px; border-radius: 8px; font-size: 1rem; outline: none;
    color: #1c1917;
}
.hero-search input::placeholder { color: #78716c; }
.hero-search button {
    background: var(--accent); color: #fff; border: none;
    padding: 13px 28px; border-radius: 8px; font-weight: 600;
    cursor: pointer; margin-left: 4px; transition: background .2s;
}
.hero-search button:hover { background: #b45309; }

.hero-tags { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.hero-tags span {
    font-size: .8rem; padding: 4px 12px; border-radius: 16px;
    background: rgba(255,255,255,.12); opacity: .85;
}

.hero-stats {
    display: flex; gap: 20px; flex-shrink: 0;
}
.stat-item {
    text-align: center; padding: 20px 24px;
    background: rgba(255,255,255,.12); border-radius: var(--radius);
    backdrop-filter: blur(8px); min-width: 100px;
    border: 1px solid rgba(255,255,255,.15);
}
.stat-num { display: block; font-size: 1.75rem; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: .8rem; opacity: .85; margin-top: 4px; }

/* Page Banner */
.page-banner {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff; padding: 40px 0;
}
.page-banner h1, .page-banner-desc { color: #fff; }
.page-banner-rank { background: linear-gradient(135deg, #92400e, var(--accent)); }
.page-banner-search { background: linear-gradient(135deg, #4338ca, #6366f1); }
.page-banner-inner { display: flex; align-items: center; gap: 20px; }
.page-banner-icon { font-size: 2.5rem; line-height: 1; }
.page-banner h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 4px; }
.page-banner-desc { opacity: .88; font-size: .95rem; }

.page-banner[data-slug="xuanhuan"] { background: linear-gradient(135deg, #7c3aed, #6366f1); }
.page-banner[data-slug="wuxia"] { background: linear-gradient(135deg, #b45309, #d97706); }
.page-banner[data-slug="dushi"] { background: linear-gradient(135deg, #0369a1, #0ea5e9); }
.page-banner[data-slug="lishi"] { background: linear-gradient(135deg, #854d0e, #a16207); }
.page-banner[data-slug="kehuan"] { background: linear-gradient(135deg, #0e7490, #06b6d4); }
.page-banner[data-slug="youxi"] { background: linear-gradient(135deg, #be185d, #ec4899); }

/* Sections */
.section { padding: 48px 0; }
.featured-section {
    padding-top: 40px;
    padding-bottom: 8px;
}
.featured-section .section-header { margin-bottom: 16px; }
.home-updates-section {
    padding-top: 0;
    padding-bottom: 24px;
}
.section-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    margin-bottom: 28px; gap: 16px;
}
.section-header h1, .section-header h2 {
    font-size: 1.5rem; font-weight: 700;
}
.section-desc { color: var(--text-muted); font-size: .875rem; margin-top: 4px; }
.more-link {
    color: var(--primary); font-size: .9rem; font-weight: 500;
    white-space: nowrap; padding: 6px 0;
}
.more-link:hover { color: var(--primary-dark); }
.result-count { color: var(--text-muted); font-size: .875rem; }

.meta-tag {
    display: inline-block; padding: 1px 8px; border-radius: 4px;
    background: var(--primary-bg); color: var(--primary); font-size: .75rem;
}

/* Featured Scroll */
.featured-scroll {
    display: flex; gap: 20px; overflow-x: auto;
    padding-bottom: 8px; scroll-snap-type: x mandatory;
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.featured-scroll::-webkit-scrollbar { height: 6px; }
.featured-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.featured-scroll-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    overflow-x: visible;
    scroll-snap-type: none;
}
.featured-scroll-grid .featured-card {
    flex: none; scroll-snap-align: unset;
}

.featured-card {
    flex: 0 0 280px; scroll-snap-align: start;
    background: var(--bg-card); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
    transition: transform .25s, box-shadow .25s;
}
.featured-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.featured-cover { position: relative; display: block; overflow: hidden; }
.featured-cover img {
    width: 100%; height: 200px; object-fit: cover;
    transition: transform .3s;
}
.featured-card:hover .featured-cover img { transform: scale(1.05); }
.featured-info { padding: 16px; }
.featured-info h3 { font-size: 1rem; margin-bottom: 4px; }
.featured-info h3 a { color: var(--text); }
.featured-info h3 a:hover { color: var(--primary); }
.featured-author { color: var(--text-muted); font-size: .85rem; margin-bottom: 8px; }
.featured-desc {
    color: var(--text-muted); font-size: .8rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; margin-bottom: 12px; line-height: 1.5;
}
.featured-read {
    display: inline-block; font-size: .85rem; font-weight: 600;
    color: var(--primary); padding: 4px 0;
}
.featured-read:hover { color: var(--primary-dark); }

/* Novel Grid */
.novel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.novel-card {
    display: flex; gap: 16px;
    background: var(--bg-card); border-radius: var(--radius);
    padding: 16px; box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
    border: 1px solid transparent;
}
.novel-card:hover {
    transform: translateY(-3px); box-shadow: var(--shadow-lg);
    border-color: var(--primary-bg);
}

.novel-cover {
    position: relative; flex-shrink: 0;
    border-radius: var(--radius-sm); overflow: hidden;
}
.novel-cover img { width: 90px; height: 120px; object-fit: cover; }

.status-badge {
    position: absolute; top: 4px; left: 4px;
    font-size: .65rem; padding: 2px 6px; border-radius: 4px;
    color: #fff; font-weight: 600;
}
.status-badge.ongoing { background: var(--primary); }
.status-badge.completed { background: #059669; }

.novel-info { flex: 1; min-width: 0; }
.novel-title { font-size: 1rem; margin-bottom: 4px; }
.novel-title a { color: var(--text); }
.novel-title a:hover { color: var(--primary); }
.novel-author { color: var(--text-muted); font-size: .85rem; margin-bottom: 6px; }
.novel-desc {
    color: var(--text-muted); font-size: .8rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; margin-bottom: 8px; line-height: 1.5;
}
.novel-meta { display: flex; gap: 10px; align-items: center; font-size: .75rem; color: var(--text-muted); }

/* Category Grid */
.category-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px;
}
.category-grid-compact { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

.category-card {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 24px 16px; text-align: center; box-shadow: var(--shadow);
    transition: all .25s; border: 2px solid transparent;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.category-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}
.category-icon { font-size: 2rem; line-height: 1; }
.category-name { font-weight: 600; color: var(--text); font-size: .95rem; }
.category-arrow { font-size: .75rem; color: var(--text-muted); opacity: 0; transition: opacity .2s; }
.category-card:hover .category-arrow { opacity: 1; color: var(--primary); }

.category-card[data-slug="xuanhuan"] { background: linear-gradient(135deg, #faf5ff, #fff); }
.category-card[data-slug="wuxia"] { background: linear-gradient(135deg, #fffbeb, #fff); }
.category-card[data-slug="dushi"] { background: linear-gradient(135deg, #f0f9ff, #fff); }
.category-card[data-slug="lishi"] { background: linear-gradient(135deg, #fefce8, #fff); }
.category-card[data-slug="kehuan"] { background: linear-gradient(135deg, #ecfeff, #fff); }
.category-card[data-slug="youxi"] { background: linear-gradient(135deg, #fdf2f8, #fff); }

/* Home category blocks */
.home-category-block {
    padding: 32px 0;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    margin-bottom: 2px;
}
.category-block-title {
    display: flex; align-items: center; gap: 14px;
}
.category-block-icon {
    font-size: 2rem; line-height: 1;
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px; background: var(--primary-bg);
}
.home-category-block[data-slug="xuanhuan"] .category-block-icon { background: #f3e8ff; }
.home-category-block[data-slug="wuxia"] .category-block-icon { background: #fef3c7; }
.home-category-block[data-slug="dushi"] .category-block-icon { background: #e0f2fe; }
.home-category-block[data-slug="lishi"] .category-block-icon { background: #fef9c3; }
.home-category-block[data-slug="kehuan"] .category-block-icon { background: #cffafe; }
.home-category-block[data-slug="youxi"] .category-block-icon { background: #fce7f3; }

/* Content Split */
.content-split {
    display: grid; grid-template-columns: 1fr 280px; gap: 20px;
    padding-bottom: 32px;
}
.home-updates-section .main-column { padding: 0; }
.home-updates-section .section-header { margin-bottom: 14px; }
.home-updates-section .section { padding: 0; }
.home-updates-section .sidebar-block { padding: 16px; }

/* Latest feed */
.latest-feed {
    list-style: none;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}
.latest-feed > li { margin: 0; padding: 0; }
.latest-item {
    display: grid;
    grid-template-columns: 28px 52px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: inherit;
    border-bottom: 1px solid #f5f5f4;
    transition: background .15s;
}
.latest-feed > li:last-child .latest-item { border-bottom: none; }
.latest-item:hover {
    background: var(--primary-bg);
    color: inherit;
}
.latest-index {
    font-size: .8rem; font-weight: 700; color: #a8a29e;
    text-align: center;
}
.latest-feed > li:nth-child(-n+3) .latest-index { color: var(--primary); }
.latest-cover {
    flex-shrink: 0; border-radius: 6px; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.latest-cover img {
    width: 52px; height: 70px; object-fit: cover; display: block;
}
.latest-body {
    min-width: 0;
    display: flex; flex-direction: column; gap: 4px;
}
.latest-title {
    font-size: .95rem; font-weight: 600; color: #1c1917;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    line-height: 1.4;
}
.latest-item:hover .latest-title { color: var(--primary-dark); }
.latest-chapter {
    font-size: .85rem; color: var(--primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    line-height: 1.4;
}
.latest-meta {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: .78rem; color: #78716c;
    line-height: 1.4;
}
.latest-meta em { font-style: normal; }
.latest-meta .status.ongoing { color: var(--primary); }
.latest-meta .status.completed { color: #059669; }
.latest-time {
    font-size: .78rem; color: #a8a29e; white-space: nowrap;
    flex-shrink: 0;
}

.home-updates-section .sidebar-block {
    border: 1px solid var(--border);
}
.sidebar-block-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.sidebar-block-header h3 { margin: 0; padding: 0; border: none; }

/* Novel List */
.novel-list { display: flex; flex-direction: column; gap: 10px; }
.novel-list-item {
    display: flex; align-items: center; gap: 16px;
    background: var(--bg-card); padding: 14px 16px; border-radius: var(--radius-sm);
    box-shadow: var(--shadow); transition: all .2s;
    border-left: 3px solid transparent;
}
.novel-list-item:hover {
    box-shadow: var(--shadow-lg); border-left-color: var(--primary);
}
.list-cover img { width: 50px; height: 67px; border-radius: 4px; object-fit: cover; }
.list-info { flex: 1; min-width: 0; }
.list-info h3 { font-size: .95rem; margin-bottom: 4px; }
.list-info h3 a { color: var(--text); }
.list-meta { font-size: .8rem; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.list-meta .status.ongoing { color: var(--primary); }
.list-meta .status.completed { color: #059669; }
.list-last { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.list-time { font-size: .8rem; color: var(--text-muted); white-space: nowrap; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-block {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow);
}
.sidebar-block h3 { font-size: 1rem; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.sidebar-block-header + .rank-list { margin-top: 0; }
.sidebar-cta p { font-size: .875rem; color: var(--text-muted); margin-bottom: 14px; line-height: 1.6; }

.rank-list { list-style: none; }
.rank-list li {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 5px 0; border-bottom: 1px solid #f5f5f4;
}
.rank-list li:last-child { border-bottom: none; }
.rank-num {
    width: 22px; height: 22px; border-radius: 5px;
    background: #f5f5f4; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700; flex-shrink: 0; margin-top: 2px;
}
.rank-num.top { background: var(--accent); color: #fff; }
.rank-item-info { flex: 1; min-width: 0; }
.rank-item-info a {
    color: var(--text); font-size: .875rem;
    display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rank-item-info a:hover { color: var(--primary); }
.rank-views { font-size: .75rem; color: var(--text-muted); }

/* Breadcrumb */
.breadcrumb { padding: 14px 0; font-size: .875rem; color: var(--text-muted); background: var(--bg-card); border-bottom: 1px solid var(--border); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 8px; opacity: .4; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 24px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: .9rem; border: none; cursor: pointer;
    transition: all .2s; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline {
    background: transparent; color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-bg); color: var(--primary-dark); }
.btn-sm { padding: 6px 14px; font-size: .8rem; }

/* Novel Detail */
.novel-detail-header {
    display: flex; gap: 36px; margin-bottom: 40px;
    background: var(--bg-card); padding: 32px; border-radius: var(--radius); box-shadow: var(--shadow);
}
.detail-cover img {
    width: 180px; border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}
.detail-info h1 { font-size: 1.75rem; margin-bottom: 12px; line-height: 1.3; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: .9rem; color: var(--text-muted); margin-bottom: 16px; }
.detail-meta .status.ongoing { color: var(--primary); font-weight: 600; }
.detail-meta .status.completed { color: #059669; font-weight: 600; }
.detail-stats { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.stat-chip {
    display: flex; flex-direction: column; align-items: center;
    padding: 10px 18px; background: var(--primary-bg); border-radius: var(--radius-sm);
    min-width: 72px;
}
.stat-chip strong { font-size: 1.1rem; color: var(--primary-dark); }
.stat-chip span { font-size: .75rem; color: var(--text-muted); }
.detail-desc { color: var(--text-muted); line-height: 1.85; margin-bottom: 24px; max-width: 600px; }
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.chapter-list-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.chapter-list-section h2 { font-size: 1.25rem; }
.chapter-count { font-size: .875rem; color: var(--text-muted); font-weight: 400; }
.chapter-tools { display: flex; gap: 10px; align-items: center; }
.chapter-filter {
    padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: .875rem; outline: none; min-width: 180px; transition: border-color .2s;
}
.chapter-filter:focus { border-color: var(--primary); }

.chapter-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px;
}
.chapter-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; border-radius: var(--radius-sm);
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text); font-size: .875rem; transition: all .15s;
}
.chapter-item:hover { border-color: var(--primary); background: var(--primary-bg); color: var(--primary); }
.chapter-item.hidden { display: none; }
.ch-no { color: var(--text-muted); flex-shrink: 0; font-size: .8rem; }
.ch-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-words { color: var(--text-muted); font-size: .75rem; flex-shrink: 0; }

/* Reading Page */
.reading-page { flex: 1; }
.reading-progress {
    position: fixed; top: var(--header-h); left: 0; height: 3px;
    background: var(--primary); z-index: 200; width: 0;
    transition: width .1s linear;
}

.reading-header { background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 28px 0; }
.reading-header h1 { font-size: 1.4rem; text-align: center; line-height: 1.4; }
.reading-meta { text-align: center; color: var(--text-muted); font-size: .875rem; margin-top: 8px; }

.reading-toolbar {
    position: sticky; top: var(--header-h); z-index: 50;
    background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 8px 0;
}
.toolbar-inner { display: flex; justify-content: center; align-items: center; gap: 24px; flex-wrap: wrap; }
.font-controls, .theme-controls { display: flex; gap: 4px; align-items: center; }
.font-controls button, .theme-btn {
    background: #f5f5f4; border: 1px solid var(--border); border-radius: 6px;
    padding: 4px 12px; cursor: pointer; font-size: .875rem; transition: all .15s;
}
.font-controls button:hover, .theme-btn:hover { background: #e7e5e4; }
.theme-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.font-label { font-size: .75rem; color: var(--text-muted); min-width: 36px; text-align: center; }
.keyboard-hint { font-size: .75rem; color: var(--text-muted); opacity: .7; }

.reading-content {
    max-width: 720px; padding: 48px 20px 60px;
    font-family: var(--font-reading);
    font-size: var(--reading-font-size);
    line-height: var(--reading-line-height);
    color: var(--text);
    margin: 0 auto;
}
.reading-content p { margin-bottom: 1em; text-indent: 2em; }

.chapter-nav {
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; padding: 32px 20px 80px; max-width: 720px; margin: 0 auto;
}
.nav-btn {
    padding: 10px 16px; border-radius: var(--radius-sm);
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text); font-size: .875rem; transition: all .15s;
    max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.nav-btn.disabled { opacity: .4; pointer-events: none; }
.nav-btn.catalog { background: var(--primary); color: #fff; border-color: var(--primary); max-width: none; }
.nav-btn.catalog:hover { background: var(--primary-dark); color: #fff; }

.mobile-chapter-bar {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg-card); border-top: 1px solid var(--border);
    padding: 10px 16px; z-index: 100;
    justify-content: space-between; gap: 8px;
    box-shadow: 0 -4px 16px rgba(0,0,0,.08);
}
.mob-nav {
    flex: 1; text-align: center; padding: 10px 8px;
    border-radius: var(--radius-sm); font-size: .875rem; font-weight: 500;
    color: var(--text); background: #f5f5f4;
}
.mob-nav.catalog { background: var(--primary); color: #fff; }
.mob-nav.disabled { opacity: .4; pointer-events: none; }

/* Reading Themes — 仅作用于阅读页，不影响全站 */
.reading-page.theme-dark {
    --bg: #1c1917; --bg-card: #292524; --text: #fafaf9;
    --text-muted: #a8a29e; --border: #44403c; --primary-bg: #134e4a;
    background: #1c1917;
}
.reading-page.theme-sepia {
    --bg: #f4ecd8; --bg-card: #faf6eb; --text: #5c4b37;
    --text-muted: #8b7355; --border: #ddd0bc; --primary-bg: #e8f5e9;
    background: #f4ecd8;
}
.reading-page.theme-dark .font-controls button,
.reading-page.theme-dark .theme-btn:not(.active) {
    background: #44403c; border-color: #57534e; color: #fafaf9;
}

/* 表单元素默认文字色 */
input, textarea, select, button {
    font-family: inherit;
}
input[type="search"],
input[type="text"],
textarea,
.chapter-filter,
.search-page-form input {
    color: #1c1917;
    background-color: #fff;
}
input::placeholder,
textarea::placeholder {
    color: #78716c;
}

/* Rank Page */
.rank-table { display: flex; flex-direction: column; gap: 10px; }
.rank-row {
    display: flex; align-items: center; gap: 16px;
    background: var(--bg-card); padding: 16px 20px; border-radius: var(--radius-sm);
    box-shadow: var(--shadow); transition: all .2s;
}
.rank-row:hover { box-shadow: var(--shadow-lg); transform: translateX(4px); }
.rank-row .rank-num {
    width: 36px; height: 36px; font-size: .95rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px; background: #f5f5f4; font-weight: 700; flex-shrink: 0;
}
.rank-row .rank-num.top-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.rank-row .rank-num.top-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.rank-row .rank-num.top-3 { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }
.rank-cover img { border-radius: 6px; width: 56px; height: 75px; object-fit: cover; }
.rank-info { flex: 1; min-width: 0; }
.rank-info h3 { font-size: .95rem; margin-bottom: 4px; }
.rank-info h3 a { color: var(--text); }
.rank-info p { font-size: .8rem; color: var(--text-muted); }
.rank-stats { display: flex; flex-direction: column; align-items: flex-end; font-size: .8rem; color: var(--text-muted); gap: 2px; }
.rank-stat-highlight { color: var(--primary); font-weight: 600; }
.rank-action {
    padding: 8px 20px; border-radius: var(--radius-sm);
    background: var(--primary-bg); color: var(--primary);
    font-size: .85rem; font-weight: 600; white-space: nowrap;
    transition: all .2s;
}
.rank-action:hover { background: var(--primary); color: #fff; }

/* Search */
.search-page-form {
    display: flex; gap: 10px; margin-bottom: 32px; max-width: 560px;
}
.search-page-form input {
    flex: 1; padding: 12px 16px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 1rem; outline: none;
    transition: border-color .2s;
}
.search-page-form input:focus { border-color: var(--primary); }
.search-suggestions h3 { font-size: 1rem; margin-bottom: 16px; color: var(--text-muted); }

.empty-state { text-align: center; color: var(--text-muted); padding: 48px; grid-column: 1 / -1; }
.empty-state-box {
    grid-column: 1 / -1; text-align: center; padding: 60px 20px;
    background: var(--bg-card); border-radius: var(--radius);
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-hint { font-size: .875rem; color: var(--text-muted); margin-top: 8px; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 32px; flex-wrap: wrap; }
.page-num, .page-btn {
    padding: 8px 14px; border-radius: var(--radius-sm);
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text); font-size: .875rem; transition: all .15s;
}
.page-num.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-num:hover, .page-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Back to top */
.back-to-top {
    position: fixed; bottom: 24px; right: 24px; z-index: 90;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--primary); color: #fff; border: none;
    font-size: 1.2rem; cursor: pointer; box-shadow: var(--shadow-lg);
    transition: all .25s; opacity: 0; transform: translateY(10px);
}
.back-to-top.visible { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* Footer */
.site-footer {
    background: #1c1917; color: #a8a29e; padding: 48px 0 24px; margin-top: auto;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.footer-brand h3 { color: #fafaf9; margin-bottom: 8px; }
.footer-brand p { font-size: .875rem; line-height: 1.7; }
.footer-links h4 { color: #fafaf9; font-size: .9rem; margin-bottom: 12px; }
.footer-links a { display: block; color: #a8a29e; font-size: .875rem; padding: 4px 0; transition: color .2s; }
.footer-links a:hover { color: #fafaf9; }
.footer-bottom { border-top: 1px solid #44403c; padding-top: 20px; text-align: center; font-size: .8rem; }

main { flex: 1; }

/* Responsive */
@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-menu-btn { display: flex; }
    .hero { padding: 48px 0 40px; }
    .hero-inner { flex-direction: column; text-align: center; }
    .hero-text h1 { font-size: 1.85rem; }
    .hero-text p { margin-left: auto; margin-right: auto; }
    .hero-stats { justify-content: center; width: 100%; }
    .stat-item { flex: 1; min-width: 0; padding: 16px 12px; }
    .hero-search { margin: 0 auto; width: 100%; }
    .hero-tags { justify-content: center; }
    .content-split { grid-template-columns: 1fr; }
    .sidebar { order: -1; }
    .novel-detail-header { flex-direction: column; align-items: center; text-align: center; }
    .detail-stats { justify-content: center; }
    .detail-actions { justify-content: center; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .chapter-nav { display: none; }
    .mobile-chapter-bar { display: flex; }
    .reading-content { padding-bottom: 100px; }
    .search-form { display: none; }
    .keyboard-hint { display: none; }
    .rank-action { display: none; }
    .rank-row:hover { transform: none; }
    .page-banner-inner { flex-direction: column; text-align: center; }
    .chapter-list-header { flex-direction: column; align-items: stretch; }
    .chapter-tools { flex-direction: column; }
    .chapter-filter { min-width: 0; width: 100%; }
    .latest-item {
        grid-template-columns: 24px 44px 1fr;
        grid-template-rows: auto auto;
        gap: 10px 12px;
    }
    .latest-time {
        grid-column: 3; justify-self: start;
        font-size: .75rem;
    }
    .back-to-top { bottom: 80px; }
    .main-nav.open {
        display: flex; flex-direction: column;
        position: absolute; top: var(--header-h); left: 0; right: 0;
        background: var(--bg-card); padding: 16px; box-shadow: var(--shadow-lg);
        border-bottom: 1px solid var(--border);
    }
}
