/* Từ điển (tu-dien). Mọi lớp tiền tố tdi- (tệp này nạp ở mọi trang). */
.chinh:has(> .tdi) { max-width: 1120px; }
.tdi-an { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tdi-dau p { margin-top: 0; }
.tdi-ve { margin: 0 0 8px; font-size: .875rem; }
.tdi-ve a { color: var(--c); }
.tdi-nho-h { font-size: .8125rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--phu); margin: 0 0 8px; }

/* Ô tra */
.tdi-tim { background: var(--the); border: 1px solid var(--vien); border-radius: var(--r); box-shadow: var(--bong); padding: 14px; margin-bottom: 16px; }
.tdi-kieu { border: 0; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tdi-kieu__o { position: relative; cursor: pointer; }
.tdi-kieu__o input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tdi-kieu__o span { display: inline-block; padding: 6px 14px; min-height: 36px; line-height: 24px; border-radius: 999px; border: 1px solid var(--c-vien);
  color: var(--c-dam); font-size: .9375rem; background: #fff; }
.tdi-kieu__o input:checked + span { background: var(--c-dam); border-color: var(--c-dam); color: #fff; font-weight: 600; }
.tdi-kieu__o input:focus-visible + span { outline: 3px solid var(--nhan); outline-offset: 2px; }
.tdi-tim__hang { display: flex; gap: 8px; }
.tdi-tim__o { position: relative; flex: 1; min-width: 0; }
.tdi-tim__o input { width: 100%; box-sizing: border-box; min-height: 48px; padding: 10px 14px; font-size: 1.125rem; border: 1px solid var(--c-vien);
  border-radius: var(--r-nho); font-family: inherit; background: #fff; color: var(--chu); }
.tdi-tim__o input:focus { outline: 3px solid var(--c-nhat); border-color: var(--c); }
.tdi-tim__nut { min-height: 48px; padding: 10px 22px; }
.tdi-goi-y { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; list-style: none; margin: 0; padding: 4px; background: #fff;
  border: 1px solid var(--vien); border-radius: var(--r-nho); box-shadow: 0 10px 28px rgba(20,40,40,.16); max-height: 60vh; overflow: auto; }
.tdi-goi-y a { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 7px; text-decoration: none; color: var(--chu); }
.tdi-goi-y b { flex: none; color: var(--c-dam); }
.tdi-goi-y span { color: var(--phu); font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tdi-goi-y li[aria-selected="true"] a, .tdi-goi-y a:hover { background: var(--c-nhat); }

/* Trang tra */
.tdi-so { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tdi-so li { background: var(--the); border: 1px solid var(--vien); border-top: 3px solid var(--nhan); border-radius: var(--r-nho); padding: 10px 12px; }
.tdi-so b { display: block; font-size: 1.35rem; color: var(--c-dam); }
.tdi-so span { font-size: .8125rem; color: var(--phu); }
.tdi-luoi { display: grid; gap: 0 14px; }
.tdi-hom-nay__tu { font-size: 1.75rem; font-weight: 700; color: var(--c-dam); text-decoration: none; margin-right: 8px; }
.tdi-hom-nay__tu:hover { text-decoration: underline; }
.tdi-hom-nay p { margin: 6px 0 12px; }
.tdi-pa { color: var(--phu); font-family: "Segoe UI", "DejaVu Sans", Arial, sans-serif; }
.tdi-ls__dau { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.tdi-ls__dau .tdi-nho-h { margin: 0; }
.tdi-ls__ds { list-style: none; margin: 0 0 6px; padding: 0; }
.tdi-ls__ds li { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--vien); min-width: 0; }
.tdi-ls__ds a { font-weight: 600; color: var(--c-dam); flex: none; }
.tdi-ls__k { flex: none; font-size: .75rem; color: var(--nhan-dam); background: var(--nhan-nhat); border-radius: 999px; padding: 0 7px; }
.tdi-ls__ds .tdi-ds__m { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tdi-nguon { margin-top: 18px; }
.tdi-nguon a { color: var(--c); }

/* Kết quả */
.tdi-kq__h { font-size: 1.25rem; }
.tdi-ds { list-style: none; margin: 0 0 14px; padding: 0; }
.tdi-ds li { padding: 9px 0; border-bottom: 1px solid var(--vien); }
.tdi-ds li > a, .tdi-ds li > b { font-weight: 700; color: var(--c-dam); font-size: 1.0625rem; }
.tdi-ds__m { display: block; color: var(--phu); font-size: .9375rem; }
.tdi-ds__nhom { font-weight: 700; background: var(--c-nhat); padding: 6px 10px !important; border-radius: 7px; border: 0 !important; margin-top: 6px; }
.tdi-chip { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tdi-chip li > a, .tdi-chip li > span { display: inline-block; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--c-vien); background: #fff;
  color: var(--c-dam); text-decoration: none; font-size: .9375rem; }
.tdi-chip li > span { color: var(--phu); border-style: dashed; }
.tdi-chip li > a:hover { background: var(--c-nhat); }
.tdi-han-luoi { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.tdi-han-luoi a { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 6px; border: 1px solid var(--vien);
  border-radius: var(--r-nho); text-decoration: none; color: var(--chu); background: #fff; height: 100%; box-sizing: border-box; }
.tdi-han-luoi a:hover { border-color: var(--c); background: var(--c-nhat); }
.tdi-han-luoi__chu { font-size: 2.25rem; line-height: 1.2; color: var(--c-dam); }
.tdi-han-luoi__am { font-weight: 600; font-size: .875rem; }
.tdi-han-luoi__n { font-size: .75rem; color: var(--phu); }
.tdi-trang { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }

/* Mục từ */
.tdi-muc__dau { margin-bottom: 12px; }
.tdi-muc__dau h1 { font-size: 2.25rem; color: var(--c-dam); display: inline; margin-right: 10px; overflow-wrap: anywhere; }
.tdi-muc__dau .tdi-pa { font-size: 1.125rem; margin-left: 6px; }
.tdi-muc__han { margin: 8px 0 0; }
.tdi-muc__cum { font-size: 1.5rem; margin-right: 10px; }
.tdi-muc__cum a { text-decoration: none; color: var(--c-dam); border-bottom: 2px solid var(--nhan); }
.tdi-muc__than { display: grid; gap: 0 14px; }
.tdi-tl__h { font-size: 1.0625rem; color: var(--c-dam); border-left: 4px solid var(--nhan); padding-left: 10px; }
.tdi-nghia { margin: 0; padding-left: 1.5em; }
.tdi-nghia > li { margin-bottom: 10px; }
.tdi-nghia > li::marker { color: var(--nhan-dam); font-weight: 700; }
.tdi-vd { list-style: none; margin: 4px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--vien); }
.tdi-vd li { color: #3d4a4c; font-style: italic; font-size: .9375rem; padding: 1px 0; }
.tdi-vd b { font-style: normal; color: var(--c-dam); }
.tdi-thn { margin: 0; }
.tdi-thn dt { font-weight: 700; color: var(--c-dam); margin-top: 8px; }
.tdi-thn dd { margin: 2px 0 0; }
.tdi-dich { list-style: none; margin: 0; padding: 0; }
.tdi-dich li { padding: 6px 0; border-bottom: 1px solid var(--vien); }
.tdi-dich li:last-child { border-bottom: 0; }
.tdi-dich a { font-weight: 600; }
.tdi-han-nho { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.tdi-han-nho a { display: inline-grid; place-items: center; width: 44px; height: 44px; font-size: 1.5rem; text-decoration: none; color: var(--c-dam);
  border: 1px solid var(--vien); border-radius: 8px; background: #fff; }
.tdi-han-nho a:hover { background: var(--c-nhat); }
.tdi-o a { color: var(--c); }

/* Chữ Hán */
.tdi-han { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; background: var(--the); border: 1px solid var(--vien); border-radius: var(--r);
  box-shadow: var(--bong); padding: 16px; margin-bottom: 14px; }
.tdi-han__chu { font-size: 5.5rem; line-height: 1; margin: 0; padding: 12px 18px; color: var(--c-dam); border: 2px solid var(--nhan); border-radius: var(--r);
  background: var(--nhan-nhat); font-weight: 400; }
.tdi-han__tt { margin: 0; flex: 1; min-width: 220px; display: grid; gap: 6px; }
.tdi-han__tt div { display: grid; grid-template-columns: 11em 1fr; gap: 8px; }
.tdi-han__tt dt { color: var(--phu); font-size: .875rem; }
.tdi-han__tt dd { margin: 0; font-weight: 600; }
.tdi-han__tt dd a { font-size: 1.5rem; text-decoration: none; margin-right: 6px; }

@media (min-width: 720px) {
  .tdi-so { grid-template-columns: repeat(4, 1fr); }
  .tdi-luoi { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
  .tdi-muc__than { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .tdi-muc__dau h1 { font-size: 2.75rem; }
}
@media (max-width: 480px) {
  .tdi-tim { padding: 12px; }
  .tdi-kieu__o span { padding: 5px 11px; font-size: .875rem; }
  .tdi-han__tt div { grid-template-columns: 1fr; gap: 0; }
  .tdi-han__chu { font-size: 4.5rem; }
}
