/* ==========================================================================
   STH Flashcard / Course - Frontend
   ========================================================================== */

.sth-course-app,
.sth-lesson-app {
	--sth-accent: #6366f1;
	--sth-accent-dark: #4f46e5;
	--sth-accent-soft: #eef2ff;
	--sth-bg: #f7f7f5;
	--sth-card: #ffffff;
	--sth-text: #1f2937;
	--sth-muted: #9ca3af;
	--sth-line: #e5e7eb;
	--sth-green: #16a34a;
	--sth-green-soft: #dcfce7;
	--sth-red: #dc2626;
	--sth-red-soft: #fee2e2;
	/* Font chữ Hán kiểu khải (Kaiti) cho flashcard; fallback về sans nếu máy không có. */
	--sth-cn-kai: "Kaiti SC", "STKaiti", "KaiTi", "Kaiti TC", "\6977\4F53", "AR PL UKai CN", "Noto Serif SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", serif;

	color: var(--sth-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	max-width: 1120px;
	margin: 24px auto;
}
.sth-course-app *, .sth-course-app *::before, .sth-course-app *::after,
.sth-lesson-app *, .sth-lesson-app *::before, .sth-lesson-app *::after { box-sizing: border-box; }

.sth-fc-loading { text-align: center; color: var(--sth-muted); padding: 60px 0; }
.sth-empty { text-align: center; color: var(--sth-muted); padding: 48px 16px; font-size: 16px; }
.sth-fc-error {
	max-width: 760px; margin: 24px auto; padding: 24px; background: #fff7ed;
	border: 1px solid #fed7aa; border-radius: 12px; color: #9a3412; text-align: center;
}
.sth-cn { font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }

/* ==========================================================================
   LOGIN GATE (bắt buộc đăng nhập)
   ========================================================================== */
.sth-login-gate {
	max-width: 460px; margin: 32px auto; background: var(--sth-card);
	border: 1px solid var(--sth-line); border-radius: 18px; padding: 44px 32px;
	text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.06);
}
.sth-login-gate-icon { font-size: 56px; line-height: 1; }
.sth-login-gate-title { font-size: 24px; font-weight: 800; margin: 16px 0 8px; color: #111827; }
.sth-login-gate-text { color: #6b7280; font-size: 16px; line-height: 1.6; margin-bottom: 24px; }
.sth-login-gate-btn {
	display: inline-block; background: var(--sth-accent); color: #fff !important; text-decoration: none;
	border-radius: 12px; padding: 13px 36px; font-size: 16px; font-weight: 700; transition: background .15s;
}
.sth-login-gate-btn:hover { background: var(--sth-accent-dark); color: #fff; }
.sth-login-gate-link { display: block; margin-top: 16px; color: var(--sth-accent); font-size: 14px; text-decoration: none; }
.sth-login-gate-link:hover { text-decoration: underline; }

/* ==========================================================================
   COURSE CATALOG
   ========================================================================== */
.sth-course-hero {
	display: flex; align-items: center; gap: 20px;
	background: linear-gradient(120deg, #1e293b, #334155 60%, #3b4a63);
	color: #fff; border-radius: 18px; padding: 32px 36px; margin: 0 12px 28px;
}
.sth-course-badge {
	font-size: 30px; font-weight: 700; background: rgba(255,255,255,.14);
	border-radius: 12px; padding: 10px 16px; line-height: 1;
	font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.sth-course-title { font-size: 34px; font-weight: 800; margin: 0 0 6px; color: #fff; }
.sth-course-sub { font-size: 16px; color: #cbd5e1; }

.sth-course-cat {
	padding: 0 12px; margin: 30px 0 14px;
}
.sth-course-cat:first-of-type { margin-top: 8px; }
.sth-course-cat-name {
	font-size: 22px; font-weight: 800; color: #111827; position: relative; padding-left: 14px;
}
.sth-course-cat-name::before {
	content: ''; position: absolute; left: 0; top: 3px; bottom: 3px; width: 5px;
	border-radius: 3px; background: var(--sth-accent);
}
.sth-course-cat-desc { color: #6b7280; font-size: 15px; margin-top: 6px; padding-left: 14px; }

.sth-course-grid {
	display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding: 0 12px;
}
.sth-course-grid + .sth-course-cat { margin-top: 36px; }
.sth-quyen-card {
	background: var(--sth-card); border-radius: 16px; overflow: hidden;
	box-shadow: 0 8px 24px rgba(0,0,0,.07); display: flex; flex-direction: column;
	transition: transform .18s, box-shadow .18s;
}
.sth-quyen-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(0,0,0,.12); }
.sth-quyen-cardhead { padding: 26px 24px 20px; color: #fff; position: relative; }
.sth-quyen-name { font-size: 26px; font-weight: 800; }
.sth-quyen-level {
	display: inline-block; margin-top: 10px; background: rgba(255,255,255,.22);
	border-radius: 6px; padding: 4px 12px; font-size: 12px; font-weight: 700; letter-spacing: .5px;
}
.sth-quyen-body { padding: 20px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.sth-quyen-desc { font-size: 15px; color: #4b5563; line-height: 1.5; }
.sth-quyen-stats { display: flex; gap: 18px; margin: 14px 0; color: #6b7280; font-size: 14px; }
.sth-quyen-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.sth-quyen-chip {
	border: 1px solid var(--sth-line); border-radius: 8px; padding: 5px 10px; font-size: 13px; color: #4b5563;
}
.sth-quyen-chip b { font-size: 15px; color: #111827; margin-right: 3px; font-family: "Noto Sans SC", "PingFang SC", sans-serif; }
.sth-quyen-go {
	margin-top: auto; background: none; border: none; border-top: 1px solid var(--sth-line);
	padding: 14px 0 2px; font-size: 16px; font-weight: 700; cursor: pointer;
	display: flex; align-items: center; gap: 8px; text-align: left;
}
.sth-quyen-go svg { width: 18px; height: 18px; }
.sth-quyen-go:hover { gap: 12px; }

/* ---- Giáo trình cards (trang [sth_giaotrinh]) ---- */
.sth-giaotrinh-card {
	background: var(--sth-card); border-radius: 16px; overflow: hidden;
	box-shadow: 0 8px 24px rgba(0,0,0,.07); display: flex; flex-direction: column;
	transition: transform .18s, box-shadow .18s;
}
.sth-giaotrinh-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(0,0,0,.12); }
.sth-giaotrinh-cardhead { padding: 28px 24px 22px; color: #fff; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.sth-giaotrinh-name { font-size: 25px; font-weight: 800; line-height: 1.2; }
.sth-giaotrinh-count { background: rgba(255,255,255,.22); border-radius: 8px; padding: 4px 12px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.sth-giaotrinh-quyens { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.sth-giaotrinh-qchip { border: 1px solid var(--sth-line); border-radius: 7px; padding: 4px 10px; font-size: 13px; color: #4b5563; background: #f9fafb; }
.sth-cat-lead { padding: 0 12px; margin: 0 0 16px; font-size: 16px; }

/* ==========================================================================
   LESSON LIST (trong 1 Quyển)
   ========================================================================== */
.sth-lessonlist { display: flex; flex-direction: column; gap: 12px; padding: 4px 12px; }
.sth-lessonlist-item {
	display: flex; align-items: center; gap: 16px; background: var(--sth-card);
	border: 1px solid var(--sth-line); border-radius: 14px; padding: 16px 20px; cursor: pointer;
	transition: border-color .15s, box-shadow .15s;
}
.sth-lessonlist-item:not(.is-locked):hover { border-color: var(--sth-accent); box-shadow: 0 6px 18px rgba(99,102,241,.12); }
.sth-lessonlist-item.is-locked { opacity: .6; cursor: not-allowed; background: #fafafa; }
.sth-lessonlist-num {
	width: 44px; height: 44px; border-radius: 50%; background: var(--sth-accent-soft); color: var(--sth-accent);
	display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex: 0 0 auto;
}
.sth-lessonlist-num svg { width: 22px; height: 22px; }
.sth-lessonlist-item.is-done .sth-lessonlist-num { background: var(--sth-green-soft); color: var(--sth-green); }
.sth-lessonlist-item.is-locked .sth-lessonlist-num { background: #e5e7eb; color: #9ca3af; }
.sth-lessonlist-info { flex: 1; min-width: 0; }
.sth-lessonlist-title { font-size: 18px; font-weight: 700; }
.sth-lessonlist-meta { font-size: 14px; color: #6b7280; margin-top: 3px; }
.sth-lessonlist-go { color: var(--sth-accent); font-weight: 600; display: flex; align-items: center; gap: 6px; font-size: 15px; flex: 0 0 auto; }
.sth-lessonlist-go svg { width: 16px; height: 16px; }
.sth-lessonlist-locked { color: #9ca3af; font-weight: 500; }

/* ==========================================================================
   LESSON DETAIL (tabs)
   ========================================================================== */
.sth-lesson-app { background: var(--sth-bg); border-radius: 20px; padding: 20px 24px 30px; }
.sth-lesson-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 6px; padding: 0 12px; }
.sth-lesson-titles { flex: 1; min-width: 0; }
.sth-lesson-crumb { font-size: 13px; color: var(--sth-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.sth-lesson-title { font-size: 24px; font-weight: 800; margin-top: 2px; }
.sth-ver-badge { flex: 0 0 auto; align-self: flex-start; font-size: 11px; color: #94a3b8; background: #f1f5f9; border-radius: 6px; padding: 2px 7px; font-weight: 600; }

.sth-fc-iconbtn { background: none; border: none; cursor: pointer; padding: 6px; color: #374151; border-radius: 8px; line-height: 0; flex: 0 0 auto; transition: background .15s; }
.sth-fc-iconbtn:hover { background: #ececec; }
.sth-fc-iconbtn svg { width: 24px; height: 24px; display: block; }

.sth-lesson-tabs { display: flex; gap: 8px; padding: 10px 12px 0; flex-wrap: wrap; border-bottom: 1px solid var(--sth-line); margin: 8px 0 18px; }
.sth-lesson-tab {
	background: none; border: none; border-bottom: 3px solid transparent; padding: 10px 14px 12px;
	font-size: 16px; font-weight: 600; color: #6b7280; cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.sth-lesson-tab:hover { color: var(--sth-accent-dark); }
.sth-lesson-tab.is-active { color: var(--sth-accent); border-bottom-color: var(--sth-accent); }
.sth-tab-count { background: var(--sth-accent-soft); color: var(--sth-accent-dark); border-radius: 999px; font-size: 12px; padding: 1px 8px; }
.sth-lesson-body { padding: 0 12px; }

/* ---- Layout 2 cột: nội dung + sidebar ---- */
.sth-lesson-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 24px; align-items: start; padding: 8px 12px 0; }
.sth-lesson-main { min-width: 0; }
.sth-lesson-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Hero gradient */
.sth-side-hero { background: linear-gradient(135deg, #6d5ef0, #8b5cf6); color: #fff; border-radius: 18px; padding: 20px 20px 18px; box-shadow: 0 10px 24px rgba(109,94,240,.25); }
.sth-side-hero-top { display: flex; align-items: center; justify-content: space-between; }
.sth-side-hero-quyen { font-size: 17px; font-weight: 800; }
.sth-side-hero-steps { font-size: 12px; font-weight: 600; background: rgba(255,255,255,.2); border-radius: 999px; padding: 3px 10px; }
.sth-side-hero-sub { font-size: 12px; color: rgba(255,255,255,.8); margin-top: 14px; }
.sth-side-hero-title { font-size: 20px; font-weight: 700; margin-top: 2px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.3; }
.sth-side-hero-prow { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.sth-side-hero-bar { flex: 1; height: 8px; background: rgba(255,255,255,.25); border-radius: 999px; overflow: hidden; }
.sth-side-hero-fill { height: 100%; background: #fff; border-radius: 999px; transition: width .35s; }
.sth-side-hero-pct { font-size: 13px; font-weight: 700; }

/* Menu chế độ */
.sth-side-menu { background: var(--sth-card); border: 1px solid var(--sth-line); border-radius: 18px; padding: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.04); }
.sth-side-row {
	width: 100%; display: flex; align-items: center; gap: 12px; background: none; border: none;
	padding: 9px 10px; border-radius: 12px; cursor: pointer; text-align: left; color: #374151; transition: background .12s;
}
.sth-side-row:hover { background: #f6f7f9; }
.sth-side-row.is-active { background: var(--sth-accent-soft); }
.sth-side-tile { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px; display: flex; align-items: center; justify-content: center; }
.sth-side-tile svg { width: 20px; height: 20px; }
.tile-vocab { background: #eff6ff; color: #3b82f6; }
.tile-flash { background: #eef2ff; color: #6366f1; }
.tile-grammar { background: #f5f3ff; color: #8b5cf6; }
.tile-exercise { background: #fdf2f8; color: #ec4899; }
.tile-type { background: #ecfdf5; color: #10b981; }
.sth-side-name { flex: 1; font-size: 16px; font-weight: 600; }
.sth-side-row.is-active .sth-side-name { color: var(--sth-accent-dark); }
.sth-side-state { flex: 0 0 auto; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; color: #cbd5e1; }
.sth-side-state svg { width: 16px; height: 16px; }
.sth-side-state.is-done { color: #16a34a; }

.sth-side-siblings { background: var(--sth-card); border: 1px solid var(--sth-line); border-radius: 14px; padding: 14px; }
.sth-side-siblings-title { font-size: 12px; font-weight: 700; color: #9ca3af; letter-spacing: .5px; margin: 2px 4px 10px; }
.sth-side-sib { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: none; padding: 9px 8px; border-radius: 9px; cursor: pointer; text-align: left; color: #374151; }
.sth-side-sib:hover:not(:disabled) { background: #f3f4f6; }
.sth-side-sib.is-current { background: var(--sth-accent-soft); color: var(--sth-accent-dark); font-weight: 700; }
.sth-side-sib.is-locked { opacity: .5; cursor: not-allowed; }
.sth-side-sib-num { width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%; background: #f3f4f6; color: #6b7280; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.sth-side-sib.is-current .sth-side-sib-num { background: var(--sth-accent); color: #fff; }
.sth-side-sib-title { font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; }
.sth-side-sib-list { display: flex; flex-direction: column; gap: 2px; }

@media (max-width: 860px) {
	.sth-lesson-layout { grid-template-columns: 1fr; gap: 14px; }
	.sth-lesson-side { position: static; order: -1; gap: 10px; }

	/* Hero: thu gọn thành thanh tiến độ mảnh (tiêu đề bài đã hiển thị ở đầu trang) */
	.sth-side-hero { padding: 12px 16px; border-radius: 14px; box-shadow: 0 6px 16px rgba(109,94,240,.2); }
	.sth-side-hero-title, .sth-side-hero-sub { display: none; }
	.sth-side-hero-prow { margin-top: 10px; }

	/* Menu chế độ: hàng "pill" cuộn ngang, dễ chạm bằng ngón cái */
	.sth-side-menu { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 8px; padding: 6px; overflow-x: auto; min-width: 0; max-width: 100%; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
	.sth-side-menu::-webkit-scrollbar { display: none; }
	.sth-side-row { width: auto; flex: 0 0 auto; flex-direction: column; align-items: center; gap: 6px; min-width: 78px; padding: 10px 12px; border-radius: 14px; }
	.sth-side-row.is-active { background: var(--sth-accent-soft); box-shadow: inset 0 0 0 1.5px var(--sth-accent); }
	.sth-side-tile { width: 34px; height: 34px; }
	.sth-side-name { flex: none; font-size: 12px; font-weight: 600; white-space: nowrap; text-align: center; }
	.sth-side-state { display: none; }

	/* Bài khác: pager số cuộn ngang thay vì danh sách dọc dài */
	.sth-side-siblings { padding: 12px 14px; }
	.sth-side-siblings-title { margin: 0 2px 10px; }
	.sth-side-sib-list { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; min-width: 0; max-width: 100%; gap: 8px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
	.sth-side-sib-list::-webkit-scrollbar { display: none; }
	.sth-side-sib { width: auto; flex: 0 0 auto; padding: 0; }
	.sth-side-sib-title { display: none; }
	.sth-side-sib-num { width: 38px; height: 38px; font-size: 15px; }
	.sth-side-sib:hover:not(:disabled) { background: none; }
	.sth-side-sib:hover:not(:disabled) .sth-side-sib-num { background: #e5e7eb; }
	.sth-side-sib.is-current .sth-side-sib-num { box-shadow: 0 2px 8px rgba(99,102,241,.4); }
}

/* ---- Vocab list (no images) ---- */
.sth-vocab-list { display: flex; flex-direction: column; gap: 14px; }
.sth-vocab-row { display: flex; gap: 16px; background: var(--sth-card); border-radius: 14px; padding: 18px 20px; box-shadow: 0 3px 12px rgba(0,0,0,.05); }
.sth-vocab-num { width: 30px; height: 30px; border-radius: 8px; background: var(--sth-accent-soft); color: var(--sth-accent); font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; font-size: 14px; }
.sth-vocab-main { flex: 1; min-width: 0; }
.sth-vocab-wordhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sth-vocab-hanzi { font-size: 34px; font-weight: 700; line-height: 1; font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }
.sth-vocab-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sth-vocab-pinyin { font-size: 17px; color: var(--sth-accent); font-weight: 500; }
.sth-vocab-badge { background: #f3f4f6; color: #6b7280; border-radius: 6px; padding: 2px 9px; font-size: 12px; font-weight: 600; }
.sth-vocab-spk { background: none; border: none; cursor: pointer; color: #9ca3af; padding: 4px; line-height: 0; border-radius: 6px; }
.sth-vocab-spk:hover { color: var(--sth-accent); background: var(--sth-accent-soft); }
.sth-vocab-spk svg { width: 20px; height: 20px; }
.sth-vocab-spk--sm svg { width: 16px; height: 16px; }
.sth-vocab-meaning { font-size: 16px; color: #374151; margin-top: 8px; }
.sth-vocab-example { margin-top: 12px; padding: 10px 14px; background: #f9fafb; border-radius: 10px; border-left: 3px solid var(--sth-accent-soft); }
.sth-vocab-example-top { display: flex; align-items: center; gap: 8px; }
.sth-vocab-example-hz { font-size: 17px; font-weight: 600; font-family: "Noto Sans SC", "PingFang SC", sans-serif; }
.sth-vocab-example-py { font-size: 14px; color: var(--sth-accent); margin-top: 2px; }
.sth-vocab-example-mn { font-size: 14px; color: #6b7280; }
.sth-vocab-cta { text-align: center; margin-top: 24px; }

/* ---- Grammar (Ngữ pháp) ---- */
.sth-grammar-list { display: flex; flex-direction: column; gap: 16px; }
.sth-grammar-card { background: var(--sth-card); border: 1px solid var(--sth-line); border-radius: 14px; padding: 18px 20px; box-shadow: 0 3px 12px rgba(0,0,0,.04); }
.sth-grammar-head { display: flex; align-items: center; gap: 12px; }
.sth-grammar-idx { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 8px; background: var(--sth-accent-soft); color: var(--sth-accent-dark); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
/* Font hỗn hợp: hệ thống (đúng dấu tiếng Việt) trước, font Trung fallback cho chữ Hán. */
.sth-grammar-structure { font-size: 20px; font-weight: 700; color: #111827; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }
.sth-grammar-meaning { font-size: 16px; font-weight: 600; color: var(--sth-accent-dark); margin-top: 10px; }
.sth-grammar-explain { font-size: 15px; color: #4b5563; line-height: 1.6; margin-top: 6px; }
.sth-grammar-examples { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.sth-grammar-example { padding: 10px 14px; background: #f9fafb; border-radius: 10px; border-left: 3px solid var(--sth-accent-soft); }
.sth-grammar-example-top { display: flex; align-items: center; gap: 8px; }
.sth-grammar-example-hz { font-size: 17px; font-weight: 600; color: #111827; font-family: "Noto Sans SC", "PingFang SC", sans-serif; }
.sth-grammar-example-py { font-size: 14px; color: var(--sth-accent); margin-top: 2px; }
.sth-grammar-example-mn { font-size: 14px; color: #6b7280; }

/* ---- Nhập từ vựng (type) ---- */
.sth-typev-head { background: var(--sth-card); border: 1px solid var(--sth-line); border-radius: 14px; padding: 16px 20px; margin-bottom: 16px; }
.sth-typev-headtop { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sth-typev-title { font-size: 19px; font-weight: 800; color: #111827; }
.sth-typev-sub { font-size: 14px; color: #6b7280; margin-top: 4px; line-height: 1.5; }
.sth-typev-toggle { flex: 0 0 auto; background: var(--sth-accent-soft); color: var(--sth-accent-dark); border: 1px solid #dfe3ff; border-radius: 10px; padding: 8px 14px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s; }
.sth-typev-toggle:hover { background: #e0e5ff; }
.sth-typev-table.hide-py thead th:nth-child(3),
.sth-typev-table.hide-py tbody td:nth-child(3) { display: none; }
.sth-typev-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--sth-card); border: 1px solid var(--sth-line); border-radius: 14px; overflow: hidden; }
.sth-typev-table thead th { background: linear-gradient(135deg, #5b8def, #6366f1); color: #fff; font-size: 14px; font-weight: 700; text-align: left; padding: 14px 18px; }
.sth-typev-table tbody td { padding: 14px 18px; border-top: 1px solid #f1f3f5; vertical-align: middle; }
.sth-typev-num { color: #9ca3af; font-weight: 700; width: 40px; }
.sth-typev-mn { font-size: 16px; color: #111827; font-weight: 600; }
.sth-typev-py { font-style: italic; color: #6b7280; font-size: 15px; white-space: nowrap; }
.sth-typev-input {
	width: 100%; min-width: 120px; font-size: 22px; padding: 8px 12px; border: 1px solid var(--sth-line);
	border-radius: 10px; outline: none; background: #fff; color: #111827;
	font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; transition: border-color .15s, box-shadow .15s;
}
.sth-typev-input:focus { border-color: var(--sth-accent); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.sth-typev-input.is-right { border-color: var(--sth-green); background: #f0fdf4; }
.sth-typev-input.is-wrong { border-color: var(--sth-red); background: #fef2f2; }
.sth-typev-result { width: 120px; text-align: center; }
.sth-typev-dash { color: #cbd5e1; }
.sth-typev-chip { display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.sth-typev-chip.ok { background: #dcfce7; color: #166534; }
.sth-typev-chip.no { background: #fee2e2; color: #991b1b; }
.sth-typev-correct { margin-top: 4px; font-size: 22px; font-weight: 700; color: var(--sth-green); font-family: "Noto Sans SC", "PingFang SC", sans-serif; }

@media (max-width: 600px) {
	.sth-typev-table thead th:nth-child(3),
	.sth-typev-table tbody td:nth-child(3) { display: none; }
	.sth-typev-table thead th, .sth-typev-table tbody td { padding: 10px 10px; }
}

/* ==========================================================================
   FLASHCARD (4 bước) — render trong lesson body
   ========================================================================== */
.sth-fc-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.sth-fc-progress-count { font-size: 15px; color: #6b7280; font-weight: 600; flex: 0 0 auto; }
.sth-fc-progress-bar { flex: 1 1 auto; height: 8px; background: var(--sth-line); border-radius: 999px; overflow: hidden; }
.sth-fc-progress-fill { height: 100%; background: var(--sth-accent); border-radius: 999px; transition: width .35s ease; }

.sth-fc-steps { display: flex; align-items: flex-start; justify-content: center; margin: 22px auto 18px; max-width: 620px; }
.sth-fc-step { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; width: 84px; }
.sth-fc-step-num { width: 46px; height: 46px; border-radius: 50%; background: #ececef; color: #9ca3af; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; transition: all .2s; }
.sth-fc-step.is-active .sth-fc-step-num { background: var(--sth-accent); color: #fff; box-shadow: 0 4px 12px rgba(99,102,241,.4); }
.sth-fc-step.is-done .sth-fc-step-num { background: var(--sth-accent-soft); color: var(--sth-accent); }
.sth-fc-step-label { margin-top: 8px; font-size: 14px; color: #9ca3af; text-align: center; }
.sth-fc-step.is-active .sth-fc-step-label { color: var(--sth-accent); font-weight: 600; }
.sth-fc-step.is-done .sth-fc-step-label { color: #6b7280; }
.sth-fc-step-line { flex: 1 1 auto; height: 2px; background: var(--sth-line); margin-top: 23px; min-width: 18px; }
.sth-fc-step-line.is-done { background: var(--sth-accent); }

.sth-fc-card-wrap { max-width: 560px; margin: 0 auto; perspective: 1600px; }
.sth-fc-card { background: var(--sth-card); border-radius: 20px; min-height: 280px; box-shadow: 0 8px 24px rgba(0,0,0,.05); padding: 28px 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

/* Lật 3D — 2 mặt cùng kích thước (inset:0) */
.sth-fc-flip { position: relative; width: 100%; height: 380px; transform-style: preserve-3d; transition: transform .55s; cursor: pointer; }
.sth-fc-flip.is-flipped { transform: rotateY(180deg); }
.sth-fc-face {
	position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
	background: var(--sth-card); border: 2px solid #e5e7fb; border-radius: 20px; box-shadow: 0 8px 24px rgba(0,0,0,.05);
	display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
	padding: 24px; overflow: hidden;
}
.sth-fc-face-back { transform: rotateY(180deg); }

.sth-fc-hanzi { font-size: 96px; line-height: 1.05; font-weight: 700; font-family: var(--sth-cn-kai); color: #111827; }
.sth-fc-pinyin { font-size: 24px; color: var(--sth-accent); font-weight: 600; }
.sth-fc-type { font-size: 15px; font-weight: 700; color: #f59e0b; margin-top: 6px; }
.sth-fc-meaning { font-size: 24px; font-weight: 700; margin-top: 8px; color: #111827; line-height: 1.3; }
.sth-fc-hint { color: var(--sth-muted); font-size: 15px; margin-top: 16px; }
.sth-fc-speaker { background: none; border: none; cursor: pointer; color: #6b7280; padding: 8px; margin-top: 12px; border-radius: 50%; line-height: 0; }
.sth-fc-speaker:hover { color: var(--sth-accent); background: var(--sth-accent-soft); }
.sth-fc-speaker svg { width: 28px; height: 28px; }

.sth-fc-example { margin-top: 16px; width: 100%; max-width: 420px; text-align: left; padding: 12px 14px; border-radius: 12px; background: #f9fafb; }
.sth-fc-example-top { display: flex; align-items: center; gap: 8px; }
.sth-fc-example-hz { font-size: 18px; font-weight: 600; color: #111827; font-family: var(--sth-cn-kai); }
.sth-fc-example-py { font-size: 14px; color: var(--sth-accent); margin-top: 2px; }
.sth-fc-example-mn { font-size: 14px; color: #6b7280; }

.sth-fc-write-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.sth-fc-write-target { width: 280px; height: 280px; position: relative; margin: 0 auto; flex: 0 0 auto; }
.sth-fc-write-bg { position: absolute; inset: 0; border: 2px dashed var(--sth-line); border-radius: 12px; background-image: linear-gradient(var(--sth-line) 1px, transparent 1px), linear-gradient(90deg, var(--sth-line) 1px, transparent 1px); background-size: 50% 50%; background-position: center; }
.sth-fc-write-quiz-status { margin-top: 14px; font-size: 15px; color: #6b7280; min-height: 22px; }
.sth-fc-write-quiz-status.ok { color: var(--sth-green); font-weight: 600; }

.sth-fc-type-prompt { font-size: 18px; color: #374151; margin-bottom: 4px; }
.sth-fc-type-meaning { font-size: 30px; font-weight: 700; color: #111827; margin-bottom: 6px; }
.sth-fc-type-py { font-size: 18px; color: var(--sth-accent); margin-bottom: 22px; }
.sth-fc-type-input { font-size: 38px; text-align: center; border: none; border-bottom: 3px solid var(--sth-line); width: 240px; padding: 8px; outline: none; background: transparent; color: #111827; font-family: var(--sth-cn-kai); }
.sth-fc-type-input:focus { border-bottom-color: var(--sth-accent); }
.sth-fc-type-input.is-wrong { border-bottom-color: var(--sth-red); animation: sth-shake .35s; }
.sth-fc-type-input.is-right { border-bottom-color: var(--sth-green); }
.sth-fc-type-feedback { margin-top: 16px; font-size: 16px; min-height: 24px; }
.sth-fc-type-feedback.ok { color: var(--sth-green); font-weight: 600; }
.sth-fc-type-feedback.no { color: var(--sth-red); }
@keyframes sth-shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-8px)} 60%{transform:translateX(8px)} }

.sth-fc-quiz-q { font-size: 19px; color: #374151; margin-bottom: 6px; }
.sth-fc-quiz-hanzi { font-size: 60px; font-weight: 700; color: #111827; margin-bottom: 6px; font-family: var(--sth-cn-kai); }
.sth-fc-quiz-py { font-size: 18px; color: var(--sth-accent); margin-bottom: 22px; }
.sth-fc-quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 520px; }
.sth-fc-quiz-opt { border: 2px solid var(--sth-line); background: #fff; border-radius: 14px; padding: 16px; font-size: 17px; cursor: pointer; transition: all .15s; color: #374151; text-align: center; }
.sth-fc-quiz-opt:hover:not(:disabled) { border-color: var(--sth-accent); background: var(--sth-accent-soft); }
.sth-fc-quiz-opt.is-correct { border-color: var(--sth-green); background: var(--sth-green-soft); color: #166534; font-weight: 600; }
.sth-fc-quiz-opt.is-wrong { border-color: var(--sth-red); background: var(--sth-red-soft); color: #991b1b; }
.sth-fc-quiz-opt:disabled { cursor: default; }

.sth-fc-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; gap: 12px; }
.sth-fc-btn { border: none; border-radius: 12px; padding: 13px 26px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all .15s; }
.sth-fc-btn-primary { background: var(--sth-accent); color: #fff; }
.sth-fc-btn-primary:hover { background: var(--sth-accent-dark); }
.sth-fc-btn-primary:disabled { background: #c7d2fe; cursor: not-allowed; }
.sth-fc-btn-ghost { background: #fff; color: #374151; border: 1px solid var(--sth-line); }
.sth-fc-btn-ghost:hover { background: #f3f4f6; }
.sth-fc-btn-ghost:disabled { opacity: .4; cursor: not-allowed; }

.sth-pulse { animation: sth-pulse 1s ease infinite; }
@keyframes sth-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(99,102,241,.45); } 50% { box-shadow: 0 0 0 8px rgba(99,102,241,0); } }

/* ==========================================================================
   EXERCISES (Luyện tập)
   ========================================================================== */
.sth-ex-card { min-height: 300px; }
.sth-ex-typetag { background: var(--sth-accent-soft); color: var(--sth-accent-dark); border-radius: 999px; padding: 4px 14px; font-size: 13px; font-weight: 700; margin-bottom: 16px; }
.sth-ex-q { font-size: 22px; font-weight: 600; color: #111827; margin-bottom: 20px; line-height: 1.5; }
.sth-ex-tf { grid-template-columns: 1fr 1fr; max-width: 360px; }
/* Ô trả lời bài tập có thể là tiếng Việt -> dùng font hệ thống (đúng dấu) trước,
   font Trung chỉ làm fallback cho chữ Hán. Ghi đè font Trung của .sth-fc-type-input. */
.sth-ex-input { width: 100%; max-width: 360px; font-size: 22px; text-align: left; border: 1px solid var(--sth-line); border-bottom-width: 1px; border-radius: 12px; padding: 12px 14px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }
.sth-ex-input:focus { border-color: var(--sth-accent); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.sth-ex-input.is-right { border-color: var(--sth-green); background: #f0fdf4; }
.sth-ex-input.is-wrong { border-color: var(--sth-red); background: #fef2f2; animation: none; }
.sth-ex-submit { margin-top: 20px; }

/* Bài dịch: ô nhập nhiều dòng + khối đáp án tham khảo (không chấm đúng/sai) */
.sth-ex-textarea { display: block; max-width: 560px; min-height: 64px; line-height: 1.5; resize: vertical; }
.sth-ex-refanswer { margin-top: 16px; max-width: 560px; background: var(--sth-accent-soft); border: 1px solid #dfe3ff; border-left: 4px solid var(--sth-accent); border-radius: 12px; padding: 14px 16px; text-align: left; }
.sth-ex-reflabel { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--sth-accent-dark); margin-bottom: 6px; }
.sth-ex-reftext { font-size: 18px; font-weight: 600; color: #111827; line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }
.sth-ex-refnote { font-size: 14px; color: #6b7280; margin-top: 8px; line-height: 1.6; }
.sth-ex-refanswer .sth-ex-reftext + .sth-ex-reftext { margin-top: 4px; }
.sth-ex-refanswer .sth-ex-speaker { color: var(--sth-accent-dark); font-weight: 700; margin-right: 2px; }

/* Bài dịch: hướng dẫn + chữ Hán (mỗi lời thoại/câu một dòng) + phiên âm tách riêng */
.sth-ex-trans { text-align: left; max-width: 640px; margin-left: auto; margin-right: auto; }
.sth-ex-trans-instr { font-size: 14px; font-weight: 600; color: var(--sth-muted); margin-bottom: 12px; line-height: 1.5; }
.sth-ex-trans-line { font-size: 22px; font-weight: 600; color: #111827; line-height: 1.65; margin-bottom: 4px; font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }
.sth-ex-trans-py { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--sth-line); }
.sth-ex-trans-pyline { font-size: 15px; color: var(--sth-accent); font-style: italic; line-height: 1.6; margin-bottom: 2px; }
.sth-ex-trans .sth-ex-speaker { color: var(--sth-accent-dark); font-weight: 700; margin-right: 4px; }

.sth-ex-feedback { margin-top: 18px; font-size: 16px; min-height: 24px; max-width: 560px; line-height: 1.5; }
.sth-ex-feedback.ok { color: var(--sth-green); font-weight: 600; }
.sth-ex-feedback.no { color: var(--sth-red); }

.sth-ex-arrange-answer { min-height: 56px; width: 100%; max-width: 560px; border: 2px dashed var(--sth-line); border-radius: 12px; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin-bottom: 16px; }
.sth-ex-arrange-answer.is-right { border-color: var(--sth-green); background: var(--sth-green-soft); }
.sth-ex-arrange-answer.is-wrong { border-color: var(--sth-red); background: var(--sth-red-soft); }
.sth-ex-arrange-pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 560px; }
.sth-ex-chip { font-size: 20px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--sth-accent); background: var(--sth-accent-soft); color: var(--sth-accent-dark); cursor: pointer; font-family: "Noto Sans SC", "PingFang SC", sans-serif; }
.sth-ex-chip--pool { border-color: var(--sth-line); background: #fff; color: #374151; }
.sth-ex-chip:hover { border-color: var(--sth-accent); }

/* Nối câu với câu (match) */
.sth-ex-match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; width: 100%; max-width: 600px; margin-bottom: 4px; }
.sth-ex-match-col { display: flex; flex-direction: column; gap: 12px; }
.sth-ex-match-cell { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 2px solid var(--sth-line); background: #fff; border-radius: 12px; padding: 12px 14px; font-size: 17px; color: #374151; cursor: pointer; transition: all .15s; }
.sth-ex-match-cell:hover:not(:disabled) { border-color: var(--sth-accent); background: var(--sth-accent-soft); }
.sth-ex-match-cell.is-active { border-color: var(--sth-accent); background: var(--sth-accent-soft); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.sth-ex-match-cell.is-set { border-color: var(--sth-accent); }
.sth-ex-match-cell.is-correct { border-color: var(--sth-green); background: var(--sth-green-soft); }
.sth-ex-match-cell.is-wrong { border-color: var(--sth-red); background: var(--sth-red-soft); }
.sth-ex-match-num { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; background: transparent; }
.sth-ex-match-cell.is-set .sth-ex-match-num { background: var(--sth-accent); }
.sth-ex-match-cell.is-correct .sth-ex-match-num { background: var(--sth-green); }
.sth-ex-match-cell.is-wrong .sth-ex-match-num { background: var(--sth-red); }
.sth-ex-match-text { flex: 1 1 auto; line-height: 1.45; font-family: "Noto Sans SC", "PingFang SC", sans-serif; }

/* Đọc hiểu (reading): đoạn văn / hội thoại + câu hỏi con */
.sth-ex-passage { width: 100%; max-width: 600px; background: #f9fafb; border: 1px solid var(--sth-line); border-left: 4px solid var(--sth-accent); border-radius: 12px; padding: 16px 18px; margin-bottom: 20px; text-align: left; }
.sth-ex-passage-line { font-size: 18px; line-height: 1.7; color: #1f2937; font-family: "Noto Sans SC", "PingFang SC", sans-serif; }
.sth-ex-passage.is-dialogue .sth-ex-passage-line { display: flex; gap: 8px; padding: 3px 0; }
.sth-ex-speaker { flex: 0 0 auto; font-weight: 700; color: var(--sth-accent-dark); }
.sth-ex-passage-text { flex: 1 1 auto; }
.sth-ex-subq { width: 100%; max-width: 600px; text-align: left; margin-bottom: 18px; }
.sth-ex-subq-q { font-size: 17px; font-weight: 600; color: #111827; margin-bottom: 10px; line-height: 1.5; }
.sth-ex-subq-opts { max-width: 100%; }
.sth-ex-subq-note { margin-top: 8px; font-size: 14px; color: var(--sth-red); }
.sth-fc-quiz-opt.is-chosen { border-color: var(--sth-accent); background: var(--sth-accent-soft); color: var(--sth-accent-dark); font-weight: 600; }

/* Completion */
.sth-fc-done { text-align: center; padding: 40px 20px; }
.sth-fc-done-emoji { font-size: 72px; }
.sth-fc-done-title { font-size: 28px; font-weight: 700; margin: 12px 0 6px; }
.sth-fc-done-sub { color: #6b7280; font-size: 16px; margin-bottom: 24px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
	.sth-course-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.sth-course-app, .sth-lesson-app { margin: 0; overflow-x: hidden; } /* chống tràn ngang */
	.sth-lesson-app { border-radius: 0; padding: 14px 10px 24px; }
	.sth-lesson-body { padding: 0 4px; }
	.sth-lesson-head { padding: 0 4px; }
	.sth-lesson-layout { padding: 8px 4px 0; }
	.sth-course-grid { grid-template-columns: 1fr; }
	.sth-course-hero { flex-direction: column; text-align: center; padding: 24px; }
	.sth-course-title { font-size: 26px; }
	.sth-lesson-title { font-size: 20px; }

	/* Flashcard 4 bước */
	.sth-fc-card { padding: 18px 12px; }
	.sth-fc-hanzi { font-size: 72px; }
	.sth-fc-steps { margin: 16px auto 14px; }
	.sth-fc-step { width: auto; flex: 1 1 0; min-width: 0; }
	.sth-fc-step-num { width: 38px; height: 38px; font-size: 15px; }
	.sth-fc-step-label { font-size: 11px; }
	.sth-fc-quiz-options { grid-template-columns: 1fr; }
	.sth-fc-quiz-hanzi { font-size: 46px; }
	.sth-fc-type-input { font-size: 30px; width: 100%; max-width: 240px; }
	.sth-fc-type-prompt { font-size: 18px; }

	/* Nút & footer: full-width, không tràn */
	.sth-fc-footer { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
	.sth-fc-footer .sth-fc-btn { width: 100%; }
	.sth-fc-btn { padding: 12px 18px; font-size: 15px; }

	/* Ô viết chữ vừa màn hình */
	.sth-fc-write-target { max-width: 100%; }
	.sth-fc-write-row { gap: 12px; }

	/* Bài tập */
	.sth-ex-q { font-size: 18px; margin-bottom: 16px; }
	.sth-ex-input { font-size: 18px; }
	.sth-ex-chip, .sth-ex-arrange-pool .sth-ex-chip { font-size: 17px; padding: 9px 13px; }
	.sth-ex-match { grid-template-columns: 1fr; gap: 10px; }
	.sth-ex-match-col { gap: 10px; }
	.sth-ex-match-cell { font-size: 15px; padding: 10px 12px; }
	.sth-ex-passage-line { font-size: 16px; }
	.sth-ex-subq-q { font-size: 15px; }
	.sth-ex-trans-line { font-size: 18px; }
	.sth-ex-trans-pyline { font-size: 14px; }

	/* Từ vựng & ngữ pháp */
	.sth-vocab-row { padding: 14px 14px; gap: 12px; }
	.sth-vocab-hanzi { font-size: 30px; }
	.sth-grammar-card { padding: 14px 14px; }
	.sth-grammar-structure { font-size: 18px; }

	/* Tabs cuộn ngang thay vì xuống dòng lộn xộn */
	.sth-lesson-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
	.sth-lesson-tabs::-webkit-scrollbar { display: none; }
	.sth-lesson-tab { font-size: 14px; padding: 8px 10px 10px; white-space: nowrap; flex: 0 0 auto; }

	/* Hoàn thành */
	.sth-fc-done { padding: 28px 12px; }
	.sth-fc-done-emoji { font-size: 56px; }
	.sth-fc-done-title { font-size: 22px; }
}

@media (max-width: 400px) {
	.sth-fc-hanzi { font-size: 60px; }
	.sth-fc-quiz-hanzi { font-size: 38px; }
	.sth-fc-step-num { width: 34px; height: 34px; font-size: 14px; }
	.sth-fc-step-label { font-size: 10px; }
	.sth-lessonlist-item { padding: 14px 14px; gap: 12px; }
	.sth-lessonlist-go span { display: none; }
}

/* ==========================================================================
   SEO — outline server-side cho khách / công cụ tìm kiếm
   ========================================================================== */
.sth-seo { max-width: 880px; margin: 0 auto; padding: 8px 16px 32px; }
.sth-seo-title { font-size: 30px; font-weight: 800; color: #111827; line-height: 1.25; margin: 8px 0; }
.sth-seo-lead { font-size: 17px; color: #4b5563; line-height: 1.6; margin: 0 0 18px; }
.sth-seo-cta { margin: 18px 0 28px; }
.sth-seo-outline { display: flex; flex-direction: column; gap: 20px; }
.sth-seo-cat { font-size: 22px; font-weight: 800; color: #111827; margin: 12px 0 4px; padding-bottom: 8px; border-bottom: 2px solid var(--sth-line); }
.sth-seo-catdesc { font-size: 15px; color: #6b7280; margin: 0 0 8px; line-height: 1.6; }
.sth-seo-quyen { background: var(--sth-card); border: 1px solid var(--sth-line); border-radius: 14px; padding: 16px 20px; }
.sth-seo-qtitle { font-size: 18px; font-weight: 700; color: var(--sth-accent-dark); margin: 0 0 4px; }
.sth-seo-qdesc { font-size: 14px; color: #6b7280; margin: 0 0 10px; line-height: 1.6; }
.sth-seo-lessons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sth-seo-lessons li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-top: 1px solid #f1f3f5; }
.sth-seo-lessons li:first-child { border-top: none; }
.sth-seo-lesson-title { font-size: 15px; font-weight: 600; color: #374151; }
.sth-seo-lesson-meta { font-size: 13px; color: #9ca3af; white-space: nowrap; flex: 0 0 auto; }
@media (max-width: 600px) {
	.sth-seo { padding: 8px 6px 24px; }
	.sth-seo-title { font-size: 24px; }
	.sth-seo-lessons li { flex-direction: column; gap: 2px; }
}

/* ==========================================================================
   MODAL — yêu cầu đăng nhập để học
   ========================================================================== */
.sth-modal-overlay {
	/* Modal gắn vào <body> nên KHÔNG kế thừa biến của .sth-course-app -> tự khai báo. */
	--sth-accent: #6366f1; --sth-accent-dark: #4f46e5; --sth-accent-soft: #eef2ff; --sth-line: #e5e7eb;
	position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center;
	padding: 20px; background: rgba(17,24,39,.55); opacity: 0; transition: opacity .18s ease;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
.sth-modal-overlay.is-open { opacity: 1; }
.sth-modal {
	background: #fff; border-radius: 18px; padding: 28px 26px; max-width: 380px; width: 100%;
	text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.3);
	transform: translateY(10px) scale(.97); transition: transform .18s ease;
}
.sth-modal-overlay.is-open .sth-modal { transform: none; }
.sth-modal-icon { font-size: 44px; line-height: 1; }
.sth-modal-title { font-size: 20px; font-weight: 800; color: #111827; margin: 12px 0 6px; }
.sth-modal-text { font-size: 15px; color: #6b7280; line-height: 1.6; margin: 0 0 22px; }
.sth-modal-actions { display: flex; gap: 10px; justify-content: center; }
.sth-modal-actions .sth-fc-btn { flex: 1; }

/* ===================== Hán Việt (v2.9.0) ===================== */
.tile-dialogue { background: #ecfeff; color: #0891b2; }
.sth-fc-hanviet { font-size: 14px; font-weight: 600; color: #0891b2; margin-top: 4px; letter-spacing: .02em; }
.sth-vocab-hanviet { background: #ecfeff; color: #0891b2; border-radius: 6px; padding: 2px 9px; font-size: 12px; font-weight: 600; }

/* ===================== Hội thoại (v2.9.0) ===================== */
.sth-dlg-list { display: flex; flex-direction: column; gap: 18px; }
.sth-dlg-card { background: var(--sth-card); border: 1px solid var(--sth-line); border-radius: 14px; padding: 18px 20px; box-shadow: 0 3px 12px rgba(0,0,0,.04); }
.sth-dlg-head { display: flex; align-items: center; gap: 10px; }
.sth-dlg-idx { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 8px; background: #ecfeff; color: #0891b2; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.sth-dlg-title { font-size: 19px; font-weight: 700; color: #111827; }
.sth-dlg-scene { font-size: 14px; color: #6b7280; font-style: italic; margin: 8px 0 4px; }
.sth-dlg-playall { display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 6px; padding: 6px 12px; border: 1px solid #cffafe; background: #ecfeff; color: #0891b2; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s; }
.sth-dlg-playall:hover { background: #cffafe; }
.sth-dlg-playall svg { width: 16px; height: 16px; }
.sth-dlg-turn { display: flex; gap: 10px; margin-top: 12px; align-items: flex-start; }
.sth-dlg-speaker { flex: 0 0 auto; min-width: 66px; font-weight: 700; color: #0891b2; font-size: 14px; padding-top: 9px; font-family: var(--sth-cn-kai); }
.sth-dlg-bubble { flex: 1; background: #f9fafb; border-radius: 12px; border-left: 3px solid #cffafe; padding: 10px 14px; }
.sth-dlg-line-top { display: flex; align-items: center; gap: 8px; }
.sth-dlg-hz { font-size: 21px; font-weight: 600; color: #111827; font-family: var(--sth-cn-kai); line-height: 1.4; }
.sth-dlg-py { font-size: 14px; color: var(--sth-accent); margin-top: 3px; }
.sth-dlg-mn { font-size: 14px; color: #6b7280; margin-top: 2px; }
