
:root {
    --primary-color: #1a56db;
    --secondary-color: #2563eb;
    --light-bg: #f8fafc;
    --dark-bg: #0f172a;
    --text-color: #1e293b;
    --light-text: #64748b;
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    --content-width: 800px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f1f5f9;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 10px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-bg));
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.logo i {
    font-size: 2.2rem;
    color: #ffd43b;
}

/* 左侧分类导航 */
.sidebar {
    flex: 0 0 260px;
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    height: fit-content;
    transition: all 0.3s ease;
    /*max-height: 300vh;*/
    /*overflow-y: auto;*/
}

.sidebar h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.book-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border-color);
}

.book-info img {
    width: 120px;
    height: 160px;
    border-radius: 6px;
    object-fit: cover;
    margin-bottom: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.book-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.book-info .author {
    color: var(--light-text);
    font-size: 0.9rem;
}

.chapters {
    list-style: none;
}

.chapters li {
    margin-bottom: 5px;
}

.chapters a {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    padding: 5px 5px;
    border-radius: 5px;
    background: var(--light-bg);
}

.chapters a:hover, .chapters a.active {
    background-color: #dbeafe;
    color: var(--primary-color);
    transform: translateX(5px);
}
#bookCataBg{
    background: #dbeafe;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.chapters i {
    width: 20px;
    text-align: center;
    color: var(--light-text);
}

.progress {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--light-text);
}

.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 45%;
    background: var(--primary-color);
    border-radius: 4px;
}

/* 右侧内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* 阅读控制栏 */
.reading-controls {
    background: white;
    border-radius: 12px;
    padding: 15px 25px;
    box-shadow: var(--card-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chapter-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-color);
}

.reading-actions {
    display: flex;
    gap: 15px;
}

.action-btn {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.action-btn:hover {
    background: #dbeafe;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.action-btn i {
    font-size: 0.9rem;
}

/* 文章内容 */
.article-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    line-height: 1.8;
}

.article-content h2 {
    color: var(--dark-bg);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.article-content p {
    margin-bottom: 10px;
    text-align: justify;
    font-size: 1.05rem;
    text-indent: 2em;
}

.article-content blockquote {
    background: #f1f5f9;
    border-left: 4px solid var(--primary-color);
    padding: 15px 20px;
    margin: 25px 0;
    border-radius: 0 6px 6px 0;
    font-style: italic;
}

.article-content img {
    border-radius: 8px;
    margin: 20px auto;
    display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* 导航按钮 */
.article-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.nav-btn {
    padding: 12px 25px;
    border-radius: 6px;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.nav-btn.prev {
    margin-right: auto;
}

.nav-btn.next {
    margin-left: auto;
}

/* 页脚 */
footer {
    background: var(--dark-bg);
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid #334155;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        flex: 0 0 auto;
        width: 100%;
        max-height: 0;
        opacity: 0;
        padding: 0 25px;
        overflow: auto;
        margin-bottom: 0;
    }

    .sidebar.sidebar-active {
        max-height: 1000px;
        opacity: 1;
        padding: 25px;
        margin-bottom: 20px;
    }

    .article-content {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }

    .logo h1 {
        font-size: 1.4rem;
    }

    .reading-controls {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .reading-actions {
        width: 100%;
        justify-content: space-between;
    }

    .article-content {
        padding: 20px;
    }

    .article-content h2 {
        font-size: 1.6rem;
    }

    .article-navigation {
        flex-direction: column;
        gap: 15px;
    }

    .nav-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .logo h1 {
        font-size: 1.2rem;
    }

    nav {
        display: none;
    }

    .article-content h2 {
        font-size: 1.4rem;
    }

    .article-content p {
        font-size: 1rem;
    }
}

/* 移动端目录切换按钮 */
.mobile-toc-toggle {
    display: none;
    position: fixed;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 24px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgb(0 0 0 / 20%);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-toc-toggle:hover {
    background: var(--secondary-color);
    transform: translateX(-50%) scale(1.05);
}

@media (max-width: 992px) {
    .mobile-toc-toggle {
        display: block;
    }
}

/* 目录标题上的关闭按钮 */
.close-sidebar {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--light-text);
    cursor: pointer;
}

@media (max-width: 992px) {
    .close-sidebar {
        display: block;
    }
}

/* 阅读模式切换 */
.reading-modes {
    display: flex;
    gap: 5px;
    margin-left: 15px;
}

.mode-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.mode-btn:hover {
    background: #dbeafe;
}

/* 夜间模式 */
body.dark-mode {
    background-color: #0f172a;
    color: #cbd5e1;
}

body.dark-mode .sidebar,
body.dark-mode .reading-controls,
body.dark-mode .article-content {
    background-color: #1e293b;
    color: #e2e8f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

body.dark-mode .chapters a {
    background: #1e293b;
}

body.dark-mode .chapters a:hover,
body.dark-mode .chapters a.active {
    background: #1e3a8a;
}

body.dark-mode .article-content h2 {
    color: #dbeafe;
    border-color: #334155;
}

body.dark-mode .article-content blockquote {
    background: #1e293b;
}

body.dark-mode .nav-btn,
body.dark-mode .action-btn {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .nav-btn:hover,
body.dark-mode .action-btn:hover {
    background: var(--primary-color);
    color: white;
}

/*logo*/
.logo img {
    width: 45%;
}
.book-footer {
    text-align: center;
    font-size: 14px;
    padding: 10px;
}

.cate-crumbs{
    background: white;
    border-radius: 12px;
    padding: 10px;
    box-shadow: var(--card-shadow);
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}
.cate-crumbs a{
    text-decoration: none;
    color: var(--text-color);
}
.content-crumbs a{
    text-decoration: none;
    color: #ffffff;
}
/*内容章节*/
.content-title{
    margin-bottom: 10px;
}
.content-title h1 {
    color: var(--dark-bg);

    padding-bottom: 5px;
    border-bottom: 2px solid var(--border-color);
    text-align: center;
}

body.dark-mode .chapter-item {
    border-left-color: var(--primary-color);
}

.chapter-item {
    background: #dbeafb;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 8px rgb(0 0 0 / 5%);
    transition: all 0.3s ease;
    border: 1px solid var(--primary-color);
}

.chapter-title-container {
    display: flex;
    align-items: center;
}

.chapter-status {
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 20px;
    background: #e0f2fe;
    color: #0369a1;
}

.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 20px;
}
.chapter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}
.chapter-number {
    background: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    margin-right: 15px;
}
.chapter-meta {
    display: flex;
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--light-text);
    flex-direction: row;
    align-content: stretch;
    justify-content: center;
}
.chapter-pages {
    display: flex;
    align-items: center;
    gap: 5px;
}
.chapter-actions {
    display: flex;
    gap: 10px;
}
.toggle-details {
    background: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}
.read-btn {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}
.chapter-btn {
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
body.dark-mode .chapter-btn.bookmark-btn:hover {
    background: var(--primary-color);
    color: white;
}
.read-btn {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.read-btn:hover {
    background: #1e40af;
    border-color: #1e40af;
}
.banquan{
    border: 1px solid #9fbdff;
    color: white;
    padding: 0 2px;
    border-radius: 4px;
    text-align: center;
}
/*内容章节结束*/
b, em, i, u, strong {
    font-weight: normal;
    /* font-style: normal; */
    text-decoration: none;
}
