* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

header {
    background: linear-gradient(135deg, #1a3c6e 0%, #0f2640 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo h1 {
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 4px;
    padding: 18px 0;
}

nav {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-left, .nav-right {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 15px;
    padding: 10px 0;
    transition: all 0.3s;
}

nav a:hover {
    color: #fff;
}

.nav-left li.active a {
    color: #f0c040;
    font-weight: 600;
    border-bottom: 2px solid #f0c040;
}

.nav-right a {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.main-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    display: flex;
    gap: 30px;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
}

.sidebar-content {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.sidebar-content h3 {
    font-size: 16px;
    padding: 18px 20px;
    color: #fff;
    background: linear-gradient(135deg, #1a3c6e 0%, #0f2640 100%);
    font-weight: 600;
}

.author-list {
    list-style: none;
}

.author-list > li > a {
    display: block;
    padding: 12px 20px;
    color: #444;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    border-bottom: 1px solid #f0f0f0;
}

.author-list > li > a:hover {
    background: #f8f9fa;
    color: #1a3c6e;
}

.author-list > li.active > a {
    background: linear-gradient(135deg, #f0c040 0%, #d8a830 100%);
    color: #333;
    font-weight: 600;
    border-left: 4px solid #1a3c6e;
    box-shadow: 2px 0 8px rgba(26, 60, 110, 0.15);
    padding-left: 16px;
}

.author-list > li.active > a .toggle-icon {
    color: #1a3c6e;
    font-weight: bold;
}

.author-list .sub-menu {
    list-style: none;
    background: #fafafa;
    display: none;
}

.author-list li.active .sub-menu {
    display: block;
}

.toggle-icon {
    display: inline-block;
    cursor: pointer;
}

.author-list .sub-menu li a {
    display: block;
    padding: 10px 20px 10px 35px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s;
    border-bottom: 1px solid #f0f0f0;
}

.author-list .sub-menu li a:hover {
    color: #1a3c6e;
    background: #f0f2f5;
}

.author-list .sub-menu li a.active {
    color: #1a3c6e;
    background: #e8edf5;
    font-weight: 600;
    border-left: 3px solid #f0c040;
    padding-left: 32px;
}

.author-list .sub-menu li a.active .toggle-icon {
    color: #1a3c6e;
    font-weight: bold;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.breadcrumb {
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
    padding-left: 5px;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #1a3c6e;
}

.content-section {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 40px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.category-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #1a3c6e;
}

.category-card-cover {
    height: 140px;
    background: linear-gradient(135deg, #1a3c6e 0%, #0f2640 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 40px;
}

.category-card-info {
    padding: 15px;
    text-align: center;
}

.category-card-title {
    font-size: 15px;
    color: #333;
    font-weight: 600;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
}

.book-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #1a3c6e;
}

.book-cover {
    height: 200px;
    background: linear-gradient(135deg, #1a3c6e 0%, #2a4c7e 50%, #1a3c6e 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-cover::before {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 100% 0 0 0;
}

.book-cover-text {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    padding: 10px;
    line-height: 1.5;
}

.book-info {
    padding: 15px;
}

.book-title {
    font-size: 14px;
    color: #333;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

.book-author {
    font-size: 12px;
    color: #888;
}

.article-page-title {
    font-size: 26px;
    color: #333;
    text-align: center;
    padding-bottom: 25px;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 30px;
    font-weight: 600;
}

.article-meta {
    text-align: center;
    color: #888;
    font-size: 14px;
    margin-bottom: 30px;
}

.article-body {
    font-size: 18px;
    line-height: 2.2;
    color: #2c2c2c;
    text-align: justify;
    letter-spacing: 0.5px;
    word-spacing: 1px;
}

.article-body p {
    margin-bottom: 28px;
    text-indent: 2em;
    text-align: justify;
    text-justify: inter-ideograph;
}

.article-body h1 {
    font-size: 28px;
    color: #1a3c6e;
    margin: 45px 0 28px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e8e8e8;
    font-weight: 700;
    text-align: center;
    letter-spacing: 2px;
}

.article-body h2 {
    font-size: 24px;
    color: #1a3c6e;
    margin: 40px 0 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8e8e8;
    font-weight: 600;
    letter-spacing: 1px;
}

.article-body h3 {
    font-size: 21px;
    color: #333;
    margin: 35px 0 22px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.article-body h4 {
    font-size: 19px;
    color: #444;
    margin: 30px 0 18px;
    font-weight: 600;
}

.article-body ul, .article-body ol {
    margin: 25px 0 25px 3em;
    padding-left: 0.5em;
}

.article-body li {
    margin-bottom: 12px;
    line-height: 2;
    text-align: justify;
}

.article-body blockquote {
    border-left: 5px solid #1a3c6e;
    padding: 20px 30px;
    margin: 30px 0;
    background: linear-gradient(to right, #f8f9fa, #fff);
    color: #444;
    font-style: normal;
    border-radius: 0 6px 6px 0;
    line-height: 2;
}

.article-body blockquote p {
    margin-bottom: 15px;
    text-indent: 0;
}

.article-body pre {
    background: #2d2d2d;
    color: #f0f0f0;
    padding: 25px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 30px 0;
    font-family: 'Consolas', 'Monaco', 'Microsoft YaHei', monospace;
    font-size: 15px;
    line-height: 1.8;
}

.article-body code {
    background: #f4f4f4;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Microsoft YaHei', monospace;
    font-size: 0.92em;
    color: #d63384;
}

.article-body a {
    color: #1a3c6e;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s;
}

.article-body a:hover {
    color: #0f2640;
    border-bottom-color: #1a3c6e;
}

.article-body strong {
    color: #1a3c6e;
    font-weight: 700;
}

.article-body em {
    font-style: italic;
    color: #555;
}

.article-body hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #e8e8e8, transparent);
    margin: 40px 0;
}



.section-title {
    font-size: 22px;
    color: #333;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #1a3c6e;
    font-weight: 600;
}

.article-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.search-box input {
    border: none;
    padding: 8px 12px;
    font-size: 14px;
    width: 200px;
    outline: none;
}

.search-box button {
    border: none;
    background: #1a3c6e;
    color: #fff;
    padding: 8px 15px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #0f2640;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.toolbar-btn:hover {
    background: #f0f2f5;
    color: #1a3c6e;
    border-color: #1a3c6e;
}

.toolbar-btn.active {
    background: #1a3c6e;
    color: #fff;
    border-color: #1a3c6e;
}

body.night-mode {
    background-color: #121212;
}

body.night-mode .content-section {
    background: #1e1e1e;
    color: #d0d0d0;
}

body.night-mode .article-page-title {
    color: #f0f0f0;
    border-bottom-color: #333;
}

body.night-mode .article-body {
    color: #c0c0c0;
}

body.night-mode .article-body h1 {
    color: #e0e0e0;
    border-bottom-color: #333;
}

body.night-mode .article-body h2 {
    color: #e0e0e0;
    border-bottom-color: #333;
}

body.night-mode .article-body h3,
body.night-mode .article-body h4 {
    color: #d0d0d0;
}

body.night-mode .article-body strong {
    color: #8ab4f8;
}

body.night-mode .article-body a {
    color: #8ab4f8;
}

body.night-mode .article-body a:hover {
    color: #aecbfa;
    border-bottom-color: #8ab4f8;
}

body.night-mode .article-body blockquote {
    border-left-color: #8ab4f8;
    background: linear-gradient(to right, #2a2a2a, #1e1e1e);
    color: #b0b0b0;
}

body.night-mode .article-toolbar {
    background: #2a2a2a;
    border-color: #333;
}

body.night-mode .search-box {
    border-color: #444;
}

body.night-mode .search-box input {
    background: #333;
    color: #d0d0d0;
}

body.night-mode .search-box button {
    background: #333;
}

body.night-mode .search-box button:hover {
    background: #444;
}

body.night-mode .toolbar-btn {
    background: #333;
    border-color: #444;
    color: #d0d0d0;
}

body.night-mode .toolbar-btn:hover {
    background: #444;
    color: #8ab4f8;
    border-color: #8ab4f8;
}

body.night-mode .toolbar-btn.active {
    background: #8ab4f8;
    color: #1e1e1e;
    border-color: #8ab4f8;
}

@media (max-width: 968px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .nav-container {
        flex-direction: column;
        padding: 10px 20px;
    }
    
    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }
    
    .logo h1 {
        padding: 10px 0;
    }
}

@media (max-width: 640px) {
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .content-section {
        padding: 20px;
    }
    
    .article-page-title {
        font-size: 20px;
    }
}

/* 暂时禁用 AI 解析相关元素 */
.ai-parse-sidebar,
.ai-parse-overlay,
.selection-menu {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

body.night-mode .ai-parse-sidebar {
    background: #1e1e1e;
}

body.night-mode .ai-parse-content h4 {
    color: #8ab4f8;
}

body.night-mode .selected-text-display,
body.night-mode .parse-result {
    background: #2a2a2a;
    border-color: #333;
    color: #d0d0d0;
}

body.night-mode .api-input-group input,
body.night-mode .api-input-group select {
    background: #333;
    border-color: #444;
    color: #d0d0d0;
}
