/* Hiệu ứng cuộn mượt khi bấm vào mục lục */
html {
    scroll-behavior: smooth;
}

/* Khoảng cách bù trừ phía trên khi cuộn tới tiêu đề (tránh bị che bởi menu cố định) */
h2[id], h3[id] {
    scroll-margin-top: 80px;
}

/* Khung bao ngoài mục lục */
.atoc-container {
    background-color: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 24px 0;
    max-width: 100%;
    font-size: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

/* Tiêu đề mục lục & nút đóng mở */
.atoc-title {
    font-weight: 700;
    font-size: 17px;
    color: #1e293b;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.atoc-title::-webkit-details-marker {
    display: none;
}

.atoc-title::after {
    content: "[Ẩn]";
    font-size: 13px;
    font-weight: 400;
    color: #3b82f6;
}

.atoc-container:not([open]) .atoc-title::after {
    content: "[Hiện]";
}

/* Danh sách các mục */
.atoc-list {
    margin: 12px 0 0 0 !important;
    padding-left: 18px !important;
    list-style-type: decimal;
}

.atoc-list li {
    margin-bottom: 6px;
    line-height: 1.5;
}

/* Thụt lề cho thẻ H3 */
.atoc-list li.atoc-sub-item {
    margin-left: 20px;
    list-style-type: disc;
    font-size: 14px;
}

/* Link trong mục lục */
.atoc-list a {
    color: #334155;
    text-decoration: none;
    transition: color 0.2s ease;
}

.atoc-list a:hover {
    color: #2563eb;
    text-decoration: underline;
}
