.td-toc-container {
    display: block !important;
    margin: 20px 0;
    max-width: 100%;
    position: relative;
}

.td-toc {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.td-toc-progress {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    margin-bottom: 10px;
    overflow: hidden;
}

.td-toc-progress-bar {
    height: 100%;
    width: 0;
    background: #007bff;
    transition: width 0.3s ease;
}

.td-toc-title {
    margin: 0 0 15px;
    font-size: 18px;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.td-toc-toggle {
    display: none;
}

.td-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.td-toc-item {
    margin: 4px 0; /* Reduced space between lines */
}

.td-toc-item.level-3 {
    margin-left: 15px;
}

.td-toc-item a {
    text-decoration: none;
    color: #2c3e50;
    transition: color 0.3s;
    display: block;
    padding: 4px; /* Reduced padding for tighter lines */
}

.td-toc-item a:hover {
    color: #007bff;
}

.td-toc-item.active a {
    color: #007bff;
    font-weight: bold;
}

.td-toc-copy-notice {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 80%;
    font-size: 14px;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .td-toc-container {
        position: static;
    }
    
    .td-toc {
        padding: 10px;
    }
    
    .td-toc-item a {
        padding: 4px; /* Reduced for mobile */
    }
    
    .td-toc-copy-notice {
        bottom: 10px;
        right: 10px;
        max-width: 90%;
        font-size: 12px;
    }
}