* TOC Container */
.my-toc {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    line-height: 1.4;
}

/* Dark theme */
.my-toc[data-theme="dark"] {
    background: #333;
    color: #fff;
    border-color: #444;
}

/* Header */
.my-toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.my-toc[data-theme="dark"] .my-toc-header {
    border-bottom-color: #444;
}

/* Title */
.my-toc-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

/* Toggle button */
.my-toc-toggle {
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 3px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    user-select: none;
}

.my-toc[data-theme="dark"] .my-toc-toggle {
    background: #444;
    border-color: #555;
}

/* Content area */
.my-toc-content {
    transition: max-height 0.3s ease-out;
    overflow: hidden;
    max-height: 2000px;
}

.my-toc-content.collapsed {
    max-height: 0;
}

/* List styling */
.my-toc-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.my-toc-content li {
    margin: 8px 0;
    padding-left: 20px;
}

.my-toc-content li.level-h3 {
    padding-left: 40px;
}

.my-toc-content li.level-h4 {
    padding-left: 60px;
}

/* Links */
.my-toc-content a {
    text-decoration: none;
    color: #0073aa;
    display: block;
    padding: 3px 0;
    transition: color 0.2s;
}

.my-toc[data-theme="dark"] .my-toc-content a {
    color: #5bb7ff;
}

.my-toc-content a:hover {
    color: #00a0d2;
    text-decoration: underline;
}

/* Heading highlight */
.toc-heading-highlight {
    transition: background-color 0.3s ease;
}