/* 前台样式 */
body {
    font-family: 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
}

/* 导航栏 */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* 文章内容样式 */
.article-content {
    line-height: 1.8;
    font-size: 16px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.article-content p {
    margin-bottom: 1rem;
    color: #555;
}

.article-content blockquote {
    border-left: 4px solid #007bff;
    padding-left: 1rem;
    margin: 1rem 0;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
}

.article-content code {
    background-color: #f8f9fa;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.article-content pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

.article-content pre code {
    background: none;
    padding: 0;
}

/* 书籍阅读样式 */
.section-content {
    line-height: 1.8;
    font-size: 16px;
}

.section-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

.section-content h1,
.section-content h2,
.section-content h3,
.section-content h4,
.section-content h5,
.section-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.section-content p {
    margin-bottom: 1rem;
    color: #555;
}

/* 书籍章节目录样式 */
.list-group-item-action.active {
    background-color: #007bff;
    border-color: #007bff;
}

/* 侧边栏优化样式 */
.sidebar-card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
}

.sidebar-card .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
}

.sidebar-card .card-header h5 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0;
    color: #495057;
}

.sidebar-card .card-body {
    padding: 0.75rem 1rem;
}

.sidebar-card .list-unstyled li {
    margin-bottom: 0.5rem;
}

.sidebar-card .list-unstyled a {
    font-size: 0.9rem;
    color: #495057;
    display: block;
    padding: 0.25rem 0;
    transition: color 0.15s ease-in-out;
}

.sidebar-card .list-unstyled a:hover {
    color: #007bff;
    text-decoration: none;
}

.sidebar-card .list-unstyled a.small {
    font-size: 0.85rem;
    line-height: 1.4;
}

/* 响应式侧边栏 */
@media (max-width: 992px) {
    .sidebar-card {
        margin-bottom: 1rem;
    }
    
    .sidebar-card .card-header h5 {
        font-size: 0.9rem;
    }
    
    .sidebar-card .list-unstyled a {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .sidebar-card .card-body {
        padding: 0.5rem 0.75rem;
    }
    
    .sidebar-card .card-header {
        padding: 0.5rem 0.75rem;
    }
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* 进度条样式 */
.progress {
    background-color: #e9ecef;
}

.progress-bar {
    background-color: #28a745;
}

/* 友情链接样式 */
.btn-outline-primary:hover {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .article-content,
    .section-content {
        font-size: 14px;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* 页脚样式 */
footer {
    margin-top: auto;
}

footer img {
    max-width: 14px;
    height: auto;
    vertical-align: middle;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 123, 255, 0.3);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 表格样式优化 */
.table th {
    border-top: none;
    font-weight: 600;
    color: #333;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.075);
}

/* 徽章样式 */
.badge {
    font-size: 0.75em;
}

/* 分页样式 */
.pagination .page-link {
    color: #007bff;
    border-color: #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

.pagination .page-link:hover {
    color: #0056b3;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

/* 按钮组样式 */
.btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* 模态框样式 */
.modal-content {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* 描述内容样式 */
.description-content {
    line-height: 1.6;
    color: #555;
}

.description-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 8px 0;
}