/* STH Dictionary — luyện đọc tiếng Trung */

.ld-reader {
	--ld-accent: #c0202a;
	border: 1px solid #ecdcdc;
	border-radius: 14px;
	background: #fff;
	padding: 0;
	margin: 1.5em 0;
	overflow: hidden;
}

.ld-toolbar {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	padding: 10px 14px;
	background: linear-gradient(180deg, #fff7f7, #fdeeee);
	border-bottom: 1px solid #f0dede;
}

.ld-title {
	font-weight: 700;
	color: var(--ld-accent);
	margin-right: auto;
}

.ld-toggle-py {
	cursor: pointer;
	border: 1px solid var(--ld-accent);
	color: var(--ld-accent);
	background: #fff;
	border-radius: 999px;
	padding: 5px 14px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	transition: all .15s ease;
}
.ld-toggle-py[aria-pressed="true"] {
	background: var(--ld-accent);
	color: #fff;
}
.ld-toggle-py:hover { filter: brightness(.97); }

.ld-hint {
	font-size: 13px;
	color: #9a8a8a;
}

.ld-content {
	padding: 16px 18px 20px;
	font-size: 1.35rem;
	line-height: 2.4;
	color: #1c1c1c;
}

/* Ruby pinyin: ẩn mặc định, hiện khi có .ld-show-pinyin */
.ld-content ruby.ld-w > rt {
	display: none;
	font-size: .5em;
	color: #b06a14;
	font-weight: 400;
	line-height: 1.1;
	-webkit-user-select: none;
	user-select: none;
}
.ld-reader.ld-show-pinyin .ld-content ruby.ld-w > rt {
	display: revert;
}

ruby.ld-w {
	cursor: pointer;
	border-radius: 4px;
	padding: 0 1px;
	transition: background .12s ease;
	ruby-align: center;
}
ruby.ld-w:hover { background: #fde3c6; }
ruby.ld-w.ld-active { background: #f9c98e; }

/* Popup tra từ */
.ld-pop {
	position: absolute;
	z-index: 99999;
	max-width: min(360px, 92vw);
	background: #fff;
	border: 1px solid #e3d2d2;
	border-radius: 12px;
	box-shadow: 0 12px 38px rgba(60, 20, 20, .22);
	padding: 14px 16px;
	font-size: 15px;
	line-height: 1.55;
	color: #222;
	animation: ld-pop-in .12s ease;
}
@keyframes ld-pop-in {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: translateY(0); }
}
.ld-pop .ld-pop-close {
	position: absolute;
	top: 6px;
	right: 8px;
	border: 0;
	background: none;
	font-size: 20px;
	line-height: 1;
	color: #b0a0a0;
	cursor: pointer;
}
.ld-pop .ld-pop-close:hover { color: #c0202a; }

.ld-pop .ld-hw {
	font-size: 30px;
	font-weight: 700;
	color: #111;
	margin-right: 8px;
	font-family: "Noto Serif SC", serif;
}
.ld-pop .ld-py {
	color: #b06a14;
	font-weight: 600;
}
.ld-pop .ld-speak {
	border: 0;
	background: #fef0e0;
	color: #b06a14;
	border-radius: 999px;
	width: 26px; height: 26px;
	cursor: pointer;
	vertical-align: middle;
	margin-left: 6px;
}
.ld-pop .ld-hv {
	display: inline-block;
	margin-top: 6px;
	background: #fbe9ea;
	color: #c0202a;
	border-radius: 6px;
	padding: 1px 8px;
	font-weight: 600;
	font-size: 14px;
}
.ld-pop .ld-row { margin-top: 8px; }
.ld-pop .ld-lbl {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #9a8a8a;
	margin-bottom: 1px;
}
.ld-pop .ld-vi { font-weight: 600; }
.ld-pop .ld-type { color: #6a7a8a; font-style: italic; font-weight: 400; font-size: 13px; }
.ld-pop .ld-en { color: #555; font-size: 14px; }
.ld-pop .ld-ex {
	margin: 3px 0 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
}
.ld-pop .ld-ex li { margin-bottom: 3px; }
.ld-pop .ld-ex .x-cn { font-family: "Noto Serif SC", serif; }
.ld-pop .ld-ex .x-vi { color: #666; }

.ld-pop .ld-chars {
	margin-top: 10px;
	border-top: 1px dashed #eedede;
	padding-top: 8px;
	font-size: 13.5px;
}
.ld-pop .ld-chars .c-item { margin-bottom: 4px; }
.ld-pop .ld-chars .c-hz { font-weight: 700; font-family: "Noto Serif SC", serif; }
.ld-pop .ld-chars .c-hv { color: #c0202a; font-weight: 600; }
.ld-pop .ld-chars .c-vi { color: #555; }

.ld-pop .ld-loading,
.ld-pop .ld-empty { color: #9a8a8a; }

.ld-pop .ld-badge {
	font-size: 10px;
	background: #eef6ee;
	color: #2e7d32;
	border-radius: 4px;
	padding: 0 5px;
	margin-left: 6px;
	vertical-align: middle;
}

@media (max-width: 600px) {
	.ld-content { font-size: 1.2rem; line-height: 2.2; }
}
