/* DadiLand Table of Contents */
.dl-toc {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #1565C0;
    border-radius: 0 12px 12px 0;
    padding: 0;
    margin: 28px 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: 700px;
}

.dl-toc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 0 12px 0 0;
}

.dl-toc-icon { color: #1565C0; display: flex; flex-shrink: 0; }

.dl-toc-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    flex: 1;
}

.dl-toc-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
}
.dl-toc-toggle:hover { background: #e2e8f0; color: #1565C0; }
.dl-toc-toggle svg { transition: transform 0.3s; }
.dl-toc.collapsed .dl-toc-toggle svg { transform: rotate(-90deg); }

/* List */
.dl-toc-list {
    padding: 12px 0;
    max-height: 500px;
    overflow-y: auto;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
}
.dl-toc.collapsed .dl-toc-list {
    max-height: 0;
    padding: 0;
    opacity: 0;
    overflow: hidden;
}

/* Items */
.dl-toc-item {
    display: block;
    padding: 7px 20px;
    font-size: 14px;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.5;
    border-left: 3px solid transparent;
}
.dl-toc-item:hover {
    color: #1565C0;
    background: #EBF5FB;
    border-left-color: #1565C0;
}
.dl-toc-item.active {
    color: #1565C0;
    background: #E3F2FD;
    border-left-color: #1565C0;
    font-weight: 600;
}

.dl-toc-h2 { padding-left: 20px; }
.dl-toc-h3 { padding-left: 36px; font-size: 13px; color: #64748b; }
.dl-toc-h3:hover { color: #1565C0; }

.dl-toc-num {
    color: #1565C0;
    font-weight: 600;
    font-size: 12px;
    margin-right: 4px;
}

/* Scrollbar */
.dl-toc-list::-webkit-scrollbar { width: 4px; }
.dl-toc-list::-webkit-scrollbar-track { background: transparent; }
.dl-toc-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* Mobile */
@media (max-width: 768px) {
    .dl-toc { max-width: 100%; }
    .dl-toc-item { padding: 6px 16px; font-size: 13px; }
    .dl-toc-h3 { padding-left: 28px; font-size: 12px; }
}

/* Print: show expanded */
@media print {
    .dl-toc-list { max-height: none !important; opacity: 1 !important; }
}
