.collection-mainbox {
    max-width: 1400px;
    display: flex;
    justify-content: flex-start;
    margin: 90px auto 10px auto;
    gap: 20px;
    padding: 0 15px;
    box-sizing: border-box;
}

.collection-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    border: 1px solid rgba(204, 202, 202, 0.425);
}

.collection-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #2196F3, #1976D2);
    border-radius: 5px 5px 0 0;
}

.collection-sidebar-header h2 {
    font-size: 16px;
    color: #fff;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.collection-sidebar-header h2 i {
    font-size: 22px;
}

.collection-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    margin: 0;
    line-height: 1.5;
}

.collection-progress {
    margin-top: 15px;
    background: rgba(255,255,255,0.2);
    padding: 10px;
    border-radius: 5px;
}

.collection-progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    overflow: hidden;
}

.collection-progress-fill {
    height: 100%;
    background: #fff;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.collection-progress-text {
    font-size: 12px;
    color: rgba(255,255,255,0.9);
    margin-top: 5px;
    text-align: right;
}

.collection-toc {
    padding: 10px 0;
}

.collection-toc-title {
    padding: 15px 20px 10px;
    font-size: 13px;
    color: #999;
    font-weight: 500;
    border-bottom: 1px solid #eee;
}

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

.collection-toc-item {
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.collection-toc-item:hover {
    background: #f5f5f5;
}

.collection-toc-item.active {
    border-left-color: #2196F3;
    background: #e3f2fd;
}

.collection-toc-item.completed {
    border-left-color: #4CAF50;
}

.collection-toc-item.completed .collection-toc-link::after {
    content: '\2713';
    color: #4CAF50;
    margin-left: auto;
    font-size: 14px;
    flex-shrink: 0;
}

.collection-toc-link {
    display: flex;
    align-items: center;
    padding: 12px 15px 12px 20px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

.collection-toc-link:hover {
    color: #2196F3;
}

.collection-toc-item.active .collection-toc-link {
    color: #2196F3;
    font-weight: 500;
}

.collection-toc-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #e0e0e0;
    border-radius: 50%;
    margin-right: 10px;
    font-size: 12px;
    color: #666;
    flex-shrink: 0;
}

.collection-toc-item.active .collection-toc-number {
    background: #2196F3;
    color: #fff;
}

.collection-toc-item.completed .collection-toc-number {
    background: #4CAF50;
    color: #fff;
}

.collection-toc-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collection-content {
    flex: 1;
    min-width: 0;
}

.collection-article {
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    border: 1px solid rgba(204, 202, 202, 0.425);
    padding: 30px;
    margin-bottom: 20px;
}

.collection-article-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.collection-article-header h1 {
    font-size: 22px;
    color: #333;
    margin: 0 0 15px 0;
    line-height: 1.4;
    text-align: center;
}

.collection-article-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #666;
}

.collection-article-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.collection-article-meta i {
    font-size: 16px;
    color: #2196F3;
}

.collection-article-body {
    font-size: 14px;
    line-height: 30px;
    color: rgb(109, 110, 112);
    padding: 20px;
}

.collection-article-body p {
    margin-bottom: 15px;
    line-height: 30px;
}

.collection-article-body strong {
    color: #1976D2;
}

.collection-article-body h2 {
    font-size: 18px;
    margin: 30px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #2196F3;
    color: #333;
}

.collection-article-body h3 {
    font-size: 16px;
    margin: 25px 0 12px 0;
    color: #1976D2;
}

.collection-article-body img {
    max-width: 100%;
    border-radius: 5px;
    margin: 15px 0;
}

.collection-article-body code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 13px;
    color: #e83e8c;
}

.collection-article-body pre {
    background: #2d333b;
    color: #abb2bf;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 15px 0;
    font-size: 14px;
    line-height: 1.5;
}

.collection-article-body pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.collection-article-body ul, 
.collection-article-body ol {
    margin: 15px 0;
    padding-left: 25px;
}

.collection-article-body li {
    margin-bottom: 8px;
}

.collection-navigation {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.collection-nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.collection-nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    background: #e3f2fd;
    color: #2196F3;
}

.collection-nav-btn.prev {
    justify-content: flex-start;
}

.collection-nav-btn.next {
    justify-content: flex-end;
}

.collection-nav-btn .nav-label {
    font-size: 12px;
    color: #999;
    display: block;
}

.collection-nav-btn:hover .nav-label {
    color: #2196F3;
}

.collection-nav-btn .nav-title {
    font-weight: 500;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.collection-nav-btn i {
    font-size: 20px;
    color: #2196F3;
    flex-shrink: 0;
}

.collection-nav-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.collection-related {
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    border: 1px solid rgba(204, 202, 202, 0.425);
    padding: 20px;
}

.collection-related-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.collection-related-header h3 {
    font-size: 13px;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.collection-related-header i {
    font-size: 17px;
    color: #2196F3;
    margin-right: 10px;
}

.collection-related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.collection-related-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.collection-related-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    background: #e3f2fd;
}

.collection-related-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
}

.collection-related-info {
    flex: 1;
    min-width: 0;
}

.collection-related-info h4 {
    font-size: 13px;
    margin: 0 0 5px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
}

.collection-related-info p {
    font-size: 12px;
    color: #999;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 移动端目录切换按钮 */
.collection-toggle {
    display: none;
    padding: 12px 20px;
    background: #f5f5f5;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
}

.collection-toggle span {
    font-weight: 500;
    color: #333;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.collection-toggle span i {
    color: #2196F3;
}

.collection-toggle .toggle-icon {
    transition: transform 0.3s ease;
    color: #999;
}

.collection-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .collection-sidebar {
        width: 260px;
    }
}

@media (max-width: 992px) {
    .collection-mainbox {
        flex-direction: column;
        margin: 80px 10px 10px 10px;
        padding: 0;
    }
    
    .collection-sidebar {
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
        margin-bottom: 15px;
    }
    
    .collection-sidebar-header {
        position: relative;
    }
    
    .collection-toggle {
        display: flex;
    }
    
    .collection-toc {
        display: none;
        border-top: 1px solid #eee;
    }
    
    .collection-toc.show {
        display: block;
    }
    
    .collection-toc-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 5px;
        padding: 10px;
    }
    
    .collection-toc-item {
        border-left: none;
        border-radius: 5px;
        background: #f8f9fa;
    }
    
    .collection-toc-item.active {
        border-left: none;
        background: #e3f2fd;
        border: 1px solid #2196F3;
    }
    
    .collection-toc-item.completed {
        border-left: none;
    }
    
    .collection-toc-link {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .collection-toc-item.completed .collection-toc-link::after {
        display: none;
    }
    
    .collection-content {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .collection-article {
        padding: 15px;
    }
    
    .collection-article-header h1 {
        font-size: 18px;
    }
    
    .collection-article-meta {
        gap: 10px;
    }
    
    .collection-article-body {
        padding: 15px 0;
        font-size: 14px;
    }
    
    .collection-article-body h2 {
        font-size: 16px;
    }
    
    .collection-article-body h3 {
        font-size: 15px;
    }
    
    .collection-navigation {
        grid-template-columns: 1fr;
    }
    
    .collection-nav-btn {
        padding: 15px;
    }
    
    .collection-nav-btn .nav-title {
        max-width: 150px;
    }
    
    .collection-related-list {
        grid-template-columns: 1fr;
    }
    
    .collection-progress {
        padding: 8px;
    }
}
