/* Từ điển / Hướng dẫn sử dụng */
.tudien {
    --tudien-accent: #1B6B2A;
    --tudien-border: #D4E0D4;
    --tudien-bg: #f7faf7;
    --tudien-sidebar-w: 300px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.5rem 0 1.5rem;
}

.tudien__header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.tudien__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--tudien-accent);
    margin: 0 0 0.25rem;
}

.tudien__desc {
    font-size: 0.9rem;
    color: #5a6b5a;
}

.tudien__search {
    flex: 1 1 220px;
    max-width: 420px;
    position: relative;
}

.tudien__search-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: #fff;
    border: 1px solid var(--tudien-border);
    border-radius: 10px;
    padding: 0.35rem 0.65rem;
}

.tudien__search-ico { color: #7a8a7a; }
.tudien__search-input {
    flex: 1;
    border: 0;
    outline: none;
    font-size: 0.95rem;
    background: transparent;
    min-width: 0;
}
.tudien__search-clear {
    border: 0;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0 0.2rem;
}

.tudien__search-results {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid var(--tudien-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    max-height: 320px;
    overflow: auto;
}

.tudien__search-hit {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #eef2ee;
    cursor: pointer;
}
.tudien__search-hit:hover,
.tudien__search-hit:focus {
    background: #eef6ee;
}
.tudien__search-hit-title {
    font-weight: 600;
    font-size: 0.92rem;
    color: #1a2a1a;
}
.tudien__search-hit-snip {
    font-size: 0.8rem;
    color: #6a7a6a;
}
.tudien__search-hit-kind {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--tudien-accent);
}

.tudien__body {
    display: grid;
    grid-template-columns: var(--tudien-sidebar-w) 1fr;
    gap: 1rem;
    align-items: start;
    min-height: 420px;
}

.tudien__sidebar {
    background: #fff;
    border: 1px solid var(--tudien-border);
    border-radius: 12px;
    overflow: hidden;
    max-height: min(70vh, 720px);
    display: flex;
    flex-direction: column;
}

.tudien__sidebar-head {
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--tudien-border);
    background: var(--tudien-bg);
    color: #345034;
}

.tudien__tree {
    overflow: auto;
    flex: 1;
    padding: 0.35rem 0;
}

.tudien-tree__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tudien-tree__item {
    margin: 0;
}

.tudien-tree__btn {
    display: flex;
    align-items: flex-start;
    gap: 0.15rem;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.4rem 0.65rem 0.4rem calc(0.55rem + var(--tudien-depth, 0) * 0.85rem);
    font-size: 0.88rem;
    line-height: 1.35;
    color: #243424;
    cursor: pointer;
}
.tudien-tree__btn:hover { background: #eef6ee; }
.tudien-tree__btn.is-active {
    background: #dcebdc;
    color: var(--tudien-accent);
    font-weight: 600;
}
.tudien-tree__btn i { margin-top: 0.1rem; flex-shrink: 0; opacity: 0.75; }
.tudien-tree__item--folder > .tudien-tree__btn { font-weight: 600; }

.tudien__main {
    background: #fff;
    border: 1px solid var(--tudien-border);
    border-radius: 12px;
    padding: 1.1rem 1.25rem 1.5rem;
    min-height: 320px;
}

.tudien__article h1,
.tudien__article-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a2a1a;
    margin: 0 0 0.35rem;
}

.tudien__article-tomtat {
    color: #5a6b5a;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.tudien__article-body {
    font-size: 0.95rem;
    line-height: 1.55;
    color: #2a3a2a;
}
.tudien__article-body h3 {
    font-size: 1.05rem;
    margin: 1.1rem 0 0.45rem;
    color: var(--tudien-accent);
}
.tudien__article-body ul { padding-left: 1.2rem; }
.tudien__article-body li { margin-bottom: 0.25rem; }

.tudien-meta-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.tudien-meta-table th,
.tudien-meta-table td {
    border: 1px solid var(--tudien-border);
    padding: 0.4rem 0.55rem;
    vertical-align: top;
}
.tudien-meta-table th {
    width: 28%;
    background: var(--tudien-bg);
    font-weight: 600;
    text-align: left;
}

.tudien-chuthich,
.tudien-giaithich {
    background: var(--tudien-bg);
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 991.98px) {
    .tudien__body {
        grid-template-columns: 1fr;
    }
    .tudien__sidebar {
        display: none;
        max-height: 50vh;
    }
    .tudien__sidebar.is-open {
        display: flex;
    }
}
