/*
Theme Name: Truyện Hay
Theme URI: https://webtruyen.id.vn
Author: Mai Cuong
Author URI: https://webtruyen.id.vn
Description: Theme này thuộc vê Mai Cuong.
Version: 1.4.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: truyen-hay
Tags: blog, custom-logo, custom-menu, featured-images, right-sidebar, translation-ready, two-columns, block-styles, wide-blocks
*/

/* ==========================================================================
   1. Biến thiết kế
   ========================================================================== */
:root {
	--th-pink: #ff5f9e;
	--th-pink-light: #ff8fbd;
	--th-pink-dark: #e0417d;
	--th-pink-soft: #ffe6f0;
	--th-pink-bg: #fff5f9;
	--th-purple: #7c5cff;
	--th-purple-dark: #5b3ce0;
	--th-yellow: #ffc93c;
	--th-red: #ff4d4f;

	--th-bg: #fff5f9;
	--th-card: #ffffff;
	--th-ink: #2c2430;
	--th-ink-2: #5b5363;
	--th-muted: #8e8798;
	--th-line: #f4e4ec;
	--th-line-strong: #ffd3e4;

	--th-radius: 16px;
	--th-radius-sm: 10px;
	--th-radius-xs: 8px;
	--th-shadow: 0 6px 22px rgba(255, 95, 158, .10);
	--th-shadow-hover: 0 14px 34px rgba(255, 95, 158, .24);
	--th-container: 1220px;
	--th-font: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	--th-font-serif: Georgia, 'Times New Roman', 'Noto Serif', serif;
	--th-header-h: 68px;
}

/* ==========================================================================
   2. Nền tảng
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body.th-body {
	margin: 0;
	font-family: var(--th-font);
	font-size: 15px;
	line-height: 1.65;
	color: var(--th-ink);
	background-color: var(--th-bg);
	background-image:
		radial-gradient(1100px 380px at 12% -8%, rgba(255, 255, 255, .95), transparent 62%),
		radial-gradient(760px 320px at 88% 2%, rgba(255, 214, 232, .75), transparent 60%),
		radial-gradient(900px 420px at 50% 108%, rgba(255, 226, 240, .8), transparent 65%);
	background-attachment: fixed;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--th-pink-dark); text-decoration: none; transition: color .18s ease, opacity .18s ease; }
a:hover { color: var(--th-pink); }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.28; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
input, select, textarea { font-family: inherit; font-size: 15px; }
::selection { background: var(--th-pink); color: #fff; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0);
	white-space: nowrap; border: 0;
}

.skip-link:focus {
	position: fixed; top: 8px; left: 8px; z-index: 9999;
	width: auto; height: auto; clip: auto; margin: 0;
	padding: 10px 16px; background: #fff; border-radius: 8px;
}

.th-container {
	width: 100%;
	max-width: var(--th-container);
	margin: 0 auto;
	padding: 0 20px;
}

.th-main { min-height: 55vh; padding-bottom: 60px; }

/* ==========================================================================
   3. Nút
   ========================================================================== */
.th-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 10px 20px;
	border: 0; border-radius: 999px;
	font-size: 14px; font-weight: 600;
	cursor: pointer;
	transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease;
	white-space: nowrap;
}

.th-btn--primary {
	background: linear-gradient(135deg, var(--th-pink-light), var(--th-pink));
	color: #fff;
	box-shadow: 0 6px 18px rgba(255, 95, 158, .34);
}
.th-btn--primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 10px 26px rgba(255, 95, 158, .46); }

.th-btn--ghost {
	background: #fff; color: var(--th-pink-dark);
	border: 1.5px solid var(--th-line-strong);
}
.th-btn--ghost:hover { background: var(--th-pink-soft); color: var(--th-pink-dark); }

.th-btn--soft { background: var(--th-pink-soft); color: var(--th-pink-dark); }
.th-btn--soft:hover { background: #ffd9e8; color: var(--th-pink-dark); }

.th-btn--block { width: 100%; }
.th-btn.is-disabled,
.th-btn[disabled] { opacity: .45; pointer-events: none; box-shadow: none; }

/* ==========================================================================
   4. Header
   ========================================================================== */
.th-header {
	position: sticky; top: 0; z-index: 60;
	background: rgba(255, 255, 255, .94);
	backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--th-line);
}

.th-header__inner {
	display: flex; align-items: center; gap: 22px;
	min-height: var(--th-header-h);
}

.th-brand { flex: 0 0 auto; }
.th-brand__link { display: inline-flex; align-items: center; gap: 9px; }
.th-brand__icon { font-size: 22px; }
.th-brand__name {
	font-size: 21px; font-weight: 800; letter-spacing: -.4px;
	background: linear-gradient(120deg, var(--th-pink-dark), var(--th-pink-light));
	-webkit-background-clip: text; background-clip: text; color: transparent;
}
.th-brand .custom-logo { max-height: 46px; width: auto; }

.th-nav { flex: 1 1 auto; min-width: 0; }
.th-nav__list { display: flex; align-items: center; gap: 4px; }
.th-nav__list > li { position: relative; }
.th-nav__list > li > a {
	display: inline-flex; align-items: center; gap: 5px;
	padding: 9px 13px; border-radius: 999px;
	font-size: 14.5px; font-weight: 600; color: var(--th-ink-2);
	white-space: nowrap;
}
.th-nav__list > li > a:hover,
.th-nav__list > li.current-menu-item > a {
	background: var(--th-pink-soft); color: var(--th-pink-dark);
}
.menu-item--vip > a { color: #d99a00 !important; }

.th-nav .sub-menu {
	position: absolute; top: calc(100% + 8px); left: 0; z-index: 40;
	min-width: 210px; max-height: 420px; overflow-y: auto;
	padding: 8px; background: #fff;
	border-radius: var(--th-radius-sm);
	box-shadow: 0 16px 40px rgba(120, 60, 90, .16);
	border: 1px solid var(--th-line);
	opacity: 0; visibility: hidden; transform: translateY(-6px);
	transition: all .18s ease;
}
.th-nav li:hover > .sub-menu,
.th-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.th-nav .sub-menu a {
	display: block; padding: 8px 12px; border-radius: var(--th-radius-xs);
	font-size: 14px; color: var(--th-ink-2); font-weight: 500;
}
.th-nav .sub-menu a:hover { background: var(--th-pink-soft); color: var(--th-pink-dark); }

/* Mega menu "Thể loại" – 4 cột, tự sinh từ danh sách thể loại */
.th-nav__list > li.th-mega-parent { position: static; }
.th-nav__list > li.th-mega-parent > a::after { content: '▾'; font-size: 10px; opacity: .6; margin-left: 5px; }
.th-nav__list > li.th-mega-parent.is-open > a { background: var(--th-pink-soft); color: var(--th-pink-dark); }

.th-nav .th-mega-parent > .sub-menu {
	left: 24px; right: 24px; top: calc(100% + 6px);
	width: auto; min-width: 0;
	max-height: min(72vh, 460px);
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 2px 18px;
	align-content: start;
	padding: 18px 22px;
	border-radius: 18px;
	box-shadow: 0 24px 60px rgba(120, 60, 90, .18);
	transform: translateY(-10px);
}
.th-nav li.th-mega-parent:hover > .sub-menu,
.th-nav li.th-mega-parent:focus-within > .sub-menu,
.th-nav li.th-mega-parent.is-open > .sub-menu { transform: translateY(0); }
.th-nav .th-mega-parent > .sub-menu > li { width: 100%; }
.th-nav .th-mega-parent > .sub-menu a {
	padding: 9px 12px; border-radius: 10px; font-size: 14px;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.th-nav .th-mega-parent > .sub-menu a.current-menu-item { background: var(--th-pink-soft); color: var(--th-pink-dark); font-weight: 700; }

/* Cầu nối chuột giữa mục "Thể loại" và bảng mega menu */
.th-nav li.th-mega-parent:hover::after,
.th-nav li.th-mega-parent:focus-within::after {
	content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 14px;
}

.th-caret { font-size: 10px; opacity: .6; }

.th-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; flex: 0 1 auto; }

.th-search {
	display: flex; align-items: center;
	background: #fff; border: 1.5px solid var(--th-line);
	border-radius: 999px; padding: 3px 3px 3px 16px;
	transition: border-color .18s ease, box-shadow .18s ease;
	min-width: 0; flex: 0 1 auto;
}
.th-search:focus-within { border-color: var(--th-pink-light); box-shadow: 0 0 0 4px rgba(255, 95, 158, .12); }
.th-search__input {
	width: 168px; min-width: 0; border: 0; outline: 0; background: transparent;
	font-size: 14px; color: var(--th-ink);
}
.th-search__input::placeholder { color: var(--th-muted); }
.th-search__btn {
	width: 34px; height: 34px; flex: 0 0 34px;
	border: 0; border-radius: 50%; cursor: pointer;
	background: var(--th-pink-soft); color: var(--th-pink-dark);
	font-size: 14px; line-height: 1;
}
.th-search__btn:hover { background: var(--th-pink); color: #fff; }

.th-icon-btn {
	width: 40px; height: 40px; flex: 0 0 40px;
	display: inline-flex; align-items: center; justify-content: center;
	border: 1.5px solid var(--th-line); background: #fff;
	border-radius: 50%; cursor: pointer; font-size: 17px; color: var(--th-ink-2);
	transition: all .18s ease;
}
.th-icon-btn:hover { border-color: var(--th-pink-light); color: var(--th-pink-dark); background: var(--th-pink-soft); }

.th-account { padding: 9px 18px; font-size: 14px; }

.th-burger {
	display: none; flex-direction: column; justify-content: center; gap: 4px;
	width: 42px; height: 42px; padding: 10px;
	border: 1.5px solid var(--th-line); background: #fff; border-radius: 12px; cursor: pointer;
}
.th-burger span:not(.screen-reader-text) { display: block; height: 2px; background: var(--th-ink-2); border-radius: 2px; }

/* Bảng tuỳ chỉnh đọc */
.th-reader-panel {
	background: #fff; border-bottom: 1px solid var(--th-line);
	box-shadow: 0 12px 30px rgba(180, 90, 130, .10);
	position: relative; z-index: 55;
}
.th-reader-panel__inner {
	display: flex; align-items: center; flex-wrap: wrap; gap: 10px 28px;
	padding-top: 14px; padding-bottom: 14px;
}
.th-reader-panel__group { display: flex; align-items: center; gap: 10px; }
.th-reader-panel__label { font-size: 13px; font-weight: 600; color: var(--th-muted); }
.th-swatches { display: flex; gap: 8px; }
.th-swatch {
	width: 34px; height: 34px; border-radius: 50%;
	border: 2px solid var(--th-line); background: var(--sw);
	cursor: pointer; font-size: 12px; font-weight: 700; color: var(--th-ink-2);
}
.th-swatch.is-active { border-color: var(--th-pink); box-shadow: 0 0 0 3px rgba(255, 95, 158, .2); }
.th-stepper { display: flex; align-items: center; gap: 4px; background: var(--th-pink-soft); border-radius: 999px; padding: 3px; }
.th-stepper button {
	width: 32px; height: 30px; border: 0; border-radius: 999px; background: #fff;
	cursor: pointer; font-weight: 700; color: var(--th-pink-dark);
}
.th-stepper__value { min-width: 52px; text-align: center; font-size: 13px; font-weight: 600; }
.th-toggle-group { display: flex; background: var(--th-pink-soft); border-radius: 999px; padding: 3px; }
.th-toggle-group button {
	border: 0; background: transparent; padding: 6px 14px; border-radius: 999px;
	font-size: 13px; font-weight: 600; color: var(--th-pink-dark); cursor: pointer;
}
.th-toggle-group button.is-active { background: #fff; box-shadow: 0 2px 8px rgba(255, 95, 158, .2); }
.th-reader-panel__reset {
	margin-left: auto; border: 0; background: transparent;
	color: var(--th-muted); font-size: 13px; text-decoration: underline; cursor: pointer;
}

/* ==========================================================================
   5. Khu vực & lưới
   ========================================================================== */
.th-home { padding-top: 26px; }
.th-section { margin-bottom: 40px; }

.th-section__head {
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	margin-bottom: 18px;
}
.th-section__title {
	display: inline-flex; align-items: center; gap: 9px;
	margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.3px;
	color: var(--th-ink);
}
.th-section__title::before {
	content: ''; width: 4px; height: 20px; border-radius: 4px;
	background: linear-gradient(180deg, var(--th-pink-light), var(--th-pink));
}
.th-ico { font-size: 18px; }
.th-section__more { font-size: 13.5px; font-weight: 600; color: var(--th-pink); }

.th-grid { display: grid; gap: 20px 16px; }
.th-grid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.th-grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.th-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.th-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.th-layout__main { min-width: 0; }

/* ==========================================================================
   6. Thẻ truyện
   ========================================================================== */
.th-card {
	position: relative;
	background: var(--th-card);
	border-radius: var(--th-radius);
	box-shadow: var(--th-shadow);
	overflow: hidden;
	transition: transform .2s ease, box-shadow .2s ease;
	display: flex; flex-direction: column;
}
.th-card:hover { transform: translateY(-4px); box-shadow: var(--th-shadow-hover); }
.th-card__link { display: block; color: inherit; }
.th-card__link:hover { color: inherit; }

.th-cover { position: relative; overflow: hidden; background: var(--th-pink-soft); }
.th-cover__img { width: 100%; aspect-ratio: 5 / 7; object-fit: cover; display: block; }
.th-cover__img--ph {
	display: flex; align-items: center; justify-content: center;
	background-image: linear-gradient(150deg, #ffb3d1, #ff7fb2);
}
.th-cover__ph-letter {
	font-size: 46px; font-weight: 800; color: rgba(255, 255, 255, .85);
	text-shadow: 0 2px 12px rgba(0, 0, 0, .12);
}
.th-cover--post .th-cover__img { aspect-ratio: 16 / 10; }

.th-badge {
	position: absolute; top: 8px;
	padding: 3px 8px; border-radius: 6px;
	font-size: 10.5px; font-weight: 800; letter-spacing: .3px;
	color: #fff; text-transform: uppercase;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.th-badge--chapter { left: 8px; background: rgba(58, 40, 52, .78); backdrop-filter: blur(4px); }
.th-badge--full { left: 8px; background: linear-gradient(135deg, #4ade80, #16a34a); }
.th-badge--hot { right: 8px; background: linear-gradient(135deg, #ff7a7a, #e63946); }
.th-badge--vip { right: 8px; background: linear-gradient(135deg, #ffd166, #f0a500); color: #5a3b00; }

.th-card__title {
	margin: 0; padding: 10px 12px;
	font-size: 13.5px; font-weight: 600; line-height: 1.42;
	color: var(--th-ink);
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	min-height: 56px;
}
.th-card__meta {
	display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
	padding: 0 12px 12px; margin-top: auto;
	font-size: 11.5px; color: var(--th-muted);
}
.th-card__author { display: inline-flex; align-items: center; gap: 5px; color: var(--th-pink); font-weight: 600; }
.th-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--th-pink); display: inline-block; }
.th-card__chapters { color: var(--th-muted); }
.th-card__time { color: var(--th-muted); }
.th-card__excerpt { padding: 0 12px 14px; margin: 0; font-size: 13px; color: var(--th-ink-2); }
.th-card--post .th-card__title { min-height: 0; }

.th-empty {
	padding: 22px; text-align: center;
	background: var(--th-card); border-radius: var(--th-radius);
	color: var(--th-muted); font-size: 14px;
}

/* ==========================================================================
   7. Dropdown
   ========================================================================== */
.th-dropdown { position: relative; }
.th-dropdown__toggle {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 9px 16px; border: 1.5px solid var(--th-line);
	background: #fff; border-radius: 999px; cursor: pointer;
	font-size: 13.5px; font-weight: 600; color: var(--th-ink-2);
}
.th-dropdown__toggle:hover { border-color: var(--th-pink-light); color: var(--th-pink-dark); }
.th-dropdown__menu {
	position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
	min-width: 220px; max-height: 340px; overflow-y: auto;
	padding: 8px; background: #fff; border: 1px solid var(--th-line);
	border-radius: var(--th-radius-sm);
	box-shadow: 0 18px 44px rgba(120, 60, 90, .18);
}
.th-dropdown__item {
	display: block; width: 100%; text-align: left;
	padding: 8px 12px; border: 0; border-radius: var(--th-radius-xs);
	background: transparent; cursor: pointer;
	font-size: 14px; color: var(--th-ink-2);
}
.th-dropdown__item:hover { background: var(--th-pink-soft); color: var(--th-pink-dark); }
.th-dropdown__item.is-active { background: var(--th-pink-soft); color: var(--th-pink-dark); font-weight: 700; }
.th-dropdown__menu[hidden] { display: none; }

/* ==========================================================================
   8. Sidebar
   ========================================================================== */
.th-sidebar { position: sticky; top: calc(var(--th-header-h) + 20px); display: flex; flex-direction: column; gap: 20px; }
.th-widget {
	background: var(--th-card); border-radius: var(--th-radius);
	box-shadow: var(--th-shadow); padding: 16px;
}
.th-widget__title {
	margin: 0 0 12px; font-size: 16px; font-weight: 800;
	display: flex; align-items: center; gap: 8px;
}
.th-crown, .th-cloud-icon { font-size: 16px; }

.th-rank-box__title { color: var(--th-ink); }

.th-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.th-tab {
	padding: 5px 14px; border-radius: 999px;
	font-size: 12.5px; font-weight: 600;
	background: var(--th-pink-soft); color: var(--th-pink-dark);
}
.th-tab:hover { background: #ffd6e6; }
.th-tab.is-active { background: linear-gradient(135deg, var(--th-pink-light), var(--th-pink)); color: #fff; }

.th-rank { display: flex; flex-direction: column; }
.th-rank__item {
	display: flex; align-items: center; gap: 10px;
	padding: 8px 0; border-bottom: 1px dashed var(--th-line);
}
.th-rank__item:last-child { border-bottom: 0; }
.th-rank__no {
	flex: 0 0 24px; width: 24px; height: 24px;
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: 50%; font-size: 12px; font-weight: 700;
	background: var(--th-pink-soft); color: var(--th-pink-dark);
}
.th-rank__item.is-top-1 .th-rank__no { background: linear-gradient(135deg, #ffd93b, #f0a500); color: #fff; }
.th-rank__item.is-top-2 .th-rank__no { background: linear-gradient(135deg, #cfd8e3, #94a3b8); color: #fff; }
.th-rank__item.is-top-3 .th-rank__no { background: linear-gradient(135deg, #ffb27a, #e07b3a); color: #fff; }
.th-rank__body { min-width: 0; display: flex; flex-direction: column; }
.th-rank__title {
	font-size: 13.5px; font-weight: 600; color: var(--th-ink);
	display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.th-rank__title:hover { color: var(--th-pink-dark); }
.th-rank__views { font-size: 11.5px; color: var(--th-muted); }

.th-keywords--cloud {
	background: linear-gradient(140deg, var(--th-purple), var(--th-purple-dark));
	border-radius: var(--th-radius);
	padding: 16px;
	color: #fff;
}
.th-keywords--cloud .th-widget__title,
.th-keywords--cloud .th-keywords__title { color: #fff; }
.th-keywords__list { display: flex; flex-wrap: wrap; gap: 8px; }
.th-keyword {
	display: inline-block; padding: 5px 12px;
	border-radius: 999px; font-size: 12.5px; font-weight: 500;
	background: rgba(255, 255, 255, .16); color: #fff;
	border: 1px solid rgba(255, 255, 255, .26);
}
.th-keyword:hover { background: #fff; color: var(--th-purple-dark); }

.th-mini-list { display: flex; flex-direction: column; gap: 12px; }
.th-mini { display: flex; gap: 10px; align-items: center; }
.th-mini__cover { flex: 0 0 54px; }
.th-mini__cover .th-cover__img { width: 54px; aspect-ratio: 5 / 7; border-radius: var(--th-radius-xs); }
.th-mini__cover .th-cover__ph-letter { font-size: 20px; }
.th-mini__body { min-width: 0; }
.th-mini__title {
	display: block; font-size: 13.5px; font-weight: 600; color: var(--th-ink);
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.th-mini__meta { font-size: 11.5px; color: var(--th-muted); }

/* ==========================================================================
   9. Banner chuyên mục + thanh lọc
   ========================================================================== */
.th-archive { padding-top: 24px; }
.th-catbanner {
	display: flex; align-items: center; justify-content: space-between; gap: 20px;
	padding: 26px 32px; margin-bottom: 18px;
	border-radius: var(--th-radius);
	background: linear-gradient(120deg, #ff5f9e 0%, #ff7fb2 55%, #ffa6c9 100%);
	color: #fff;
	box-shadow: 0 14px 34px rgba(255, 95, 158, .3);
	position: relative; overflow: hidden;
}
.th-catbanner::after {
	content: ''; position: absolute; right: -40px; bottom: -60px;
	width: 220px; height: 220px; border-radius: 50%;
	background: rgba(255, 255, 255, .12);
}
.th-catbanner__eyebrow {
	display: inline-block; margin-bottom: 6px;
	font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
	opacity: .85;
}
.th-catbanner__title { margin: 0; font-size: 30px; font-weight: 800; color: #fff; letter-spacing: -.5px; }
.th-catbanner__desc { margin: 6px 0 0; font-size: 13.5px; opacity: .92; max-width: 720px; }
.th-catbanner__icon { font-size: 44px; opacity: .5; position: relative; z-index: 1; }

.th-filterbar {
	display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
	padding: 12px 16px; margin-bottom: 22px;
	background: var(--th-card); border-radius: var(--th-radius); box-shadow: var(--th-shadow);
}
.th-filterbar__tabs { display: flex; gap: 8px; }
.th-filterbar__tab {
	padding: 8px 20px; border-radius: 999px;
	font-size: 13.5px; font-weight: 600;
	background: var(--th-pink-soft); color: var(--th-pink-dark);
}
.th-filterbar__tab:hover { background: #ffd6e6; }
.th-filterbar__tab.is-active { background: linear-gradient(135deg, var(--th-pink-light), var(--th-pink)); color: #fff; }
.th-filterbar__right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.th-filterbar__label { font-size: 13px; color: var(--th-muted); }
.th-filterbar__count { font-size: 13px; color: var(--th-muted); }

.th-breadcrumb {
	display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
	margin: 0 0 18px; font-size: 12.5px; color: var(--th-muted);
}
.th-sep { opacity: .5; }
.th-breadcrumb .th-current { color: var(--th-ink-2); font-weight: 600; }

/* ==========================================================================
   10. Phân trang
   ========================================================================== */
.th-pagination {
	display: flex; flex-direction: column; align-items: center; gap: 12px;
	margin: 34px 0 10px;
}
.th-pagination__info { font-size: 12.5px; color: var(--th-muted); }
.th-pagination__list { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.th-pagination__list .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 40px; height: 40px; padding: 0 12px;
	border-radius: 12px; background: #fff;
	font-size: 14px; font-weight: 600; color: var(--th-ink-2);
	box-shadow: 0 3px 10px rgba(255, 95, 158, .10);
}
.th-pagination__list .page-numbers:hover { background: var(--th-pink-soft); color: var(--th-pink-dark); }
.th-pagination__list .page-numbers.current {
	background: linear-gradient(135deg, var(--th-pink-light), var(--th-pink));
	color: #fff; box-shadow: 0 6px 18px rgba(255, 95, 158, .34);
}
.th-pagination__list .page-numbers.dots { box-shadow: none; background: transparent; }

/* ==========================================================================
   11. Trang chi tiết truyện
   ========================================================================== */
.th-single-story { padding-top: 24px; }
.th-story { background: var(--th-card); border-radius: var(--th-radius); box-shadow: var(--th-shadow); padding: 26px; }

.th-story__head { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; }

.th-story__coverbox { display: flex; flex-direction: column; gap: 12px; }
.th-story__cover {
	position: relative; border-radius: var(--th-radius-sm); overflow: hidden;
	box-shadow: 0 12px 30px rgba(120, 60, 90, .18);
}
.th-story__cover .th-cover__img { aspect-ratio: 5 / 7; }
.th-story__cover-actions { display: flex; flex-direction: column; gap: 10px; }

.th-story__title { margin: 0 0 6px; font-size: 30px; font-weight: 800; letter-spacing: -.6px; }
.th-story__updated { margin: 0 0 12px; font-size: 12.5px; color: var(--th-muted); }
.th-story__genres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.th-chip {
	display: inline-block; padding: 4px 13px;
	border-radius: 999px; font-size: 12px; font-weight: 600;
	background: var(--th-pink-soft); color: var(--th-pink-dark);
}
.th-chip:hover { background: var(--th-pink); color: #fff; }

.th-info-grid {
	display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px 24px; padding: 16px 18px; margin-bottom: 16px;
	background: #fff8fb; border: 1px solid var(--th-line); border-radius: var(--th-radius-sm);
}
.th-info-grid__item { display: flex; flex-direction: column; gap: 3px; }
.th-info-grid__label { font-size: 12px; color: var(--th-muted); display: inline-flex; align-items: center; gap: 6px; }
.th-info-grid__value { font-size: 14.5px; font-weight: 700; color: var(--th-ink); }

.th-story__rating { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.th-stars { display: inline-flex; align-items: center; gap: 3px; }
.th-star { color: #e6dfe4; font-size: 17px; line-height: 1; }
.th-star.is-on { color: var(--th-yellow); }
.th-stars__text { margin-left: 8px; font-size: 12.5px; color: var(--th-muted); }

.th-rate { display: inline-flex; align-items: center; gap: 3px; }
.th-rate__label { font-size: 12.5px; color: var(--th-muted); margin-right: 5px; }
.th-rate__star {
	border: 0; background: transparent; cursor: pointer;
	font-size: 20px; color: #e6dfe4; padding: 0 1px; line-height: 1;
}
.th-rate__star:hover,
.th-rate__star.is-hover { color: var(--th-yellow); }

.th-story__note {
	display: inline-block; padding: 7px 14px; margin-bottom: 16px;
	border-radius: 999px; background: #fff6e0; color: #a06a00;
	font-size: 12.5px; font-weight: 600;
}

.th-story__subtitle { margin: 20px 0 8px; font-size: 17px; font-weight: 800; }
.th-story__summary { font-size: 14.5px; color: var(--th-ink-2); }
.th-story__summary p:last-child { margin-bottom: 0; }
.th-story__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.th-tag {
	padding: 4px 11px; border-radius: 6px;
	background: #f4f0ff; color: var(--th-purple-dark);
	font-size: 12px; font-weight: 600;
}
.th-tag:hover { background: var(--th-purple); color: #fff; }

.th-chapters {
	margin-top: 32px; padding: 20px;
	background: #fff8fb; border: 1px solid var(--th-line); border-radius: var(--th-radius);
}
.th-chapters__title { margin: 0 0 14px; font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.th-chapters__latest {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 11px 16px; margin-bottom: 16px;
	background: #fff; border: 1px solid var(--th-line); border-radius: var(--th-radius-sm);
	font-size: 13.5px;
}
.th-chapters__latest a { font-weight: 700; }
.th-chapters__read { color: var(--th-pink-dark); font-weight: 600; }

.th-chapter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 26px; }
.th-chapter-item {
	display: block; padding: 10px 4px;
	border-bottom: 1px solid #efdfe8;
	font-size: 14px; color: var(--th-ink-2); font-weight: 500;
}
.th-chapter-item:hover { color: var(--th-pink-dark); padding-left: 8px; }
.th-chapter-item.is-current { color: var(--th-pink-dark); font-weight: 700; }
.th-chapter-item.is-latest .th-chapter-item__name::after {
	content: 'NEW'; margin-left: 8px; padding: 1px 6px;
	border-radius: 4px; background: var(--th-pink); color: #fff;
	font-size: 9.5px; font-weight: 800; vertical-align: middle;
}
.th-chapters__more { margin-top: 18px; text-align: center; }

.th-section--related { margin-top: 34px; }

/* ==========================================================================
   12. Bình luận
   ========================================================================== */
.th-comments { margin-top: 34px; padding: 22px; background: var(--th-card); border-radius: var(--th-radius); box-shadow: var(--th-shadow); }
.th-comments__title { font-size: 18px; font-weight: 800; }
.th-comments__list { display: flex; flex-direction: column; gap: 14px; }
.th-comments__list ol.children { margin: 14px 0 0 24px; padding: 0; }
.comment-body {
	padding: 14px 16px; border-radius: var(--th-radius-sm);
	background: #fff8fb; border: 1px solid var(--th-line);
}
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.comment-author img { border-radius: 50%; }
.comment-metadata { margin: 4px 0 10px; font-size: 12px; color: var(--th-muted); }
.comment-content { font-size: 14px; color: var(--th-ink-2); }
.reply a { font-size: 12.5px; font-weight: 600; }
.comment-respond { margin-top: 22px; }

.th-comments__empty { padding: 34px 16px; text-align: center; color: var(--th-muted); }
.th-comments__empty-icon { font-size: 34px; margin-bottom: 6px; }

.th-comment-form__title { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.th-comment-form__login {
	padding: 26px; margin: 12px 0;
	text-align: center; background: #fff8fb;
	border: 1px solid var(--th-line); border-radius: var(--th-radius-sm);
}
.th-comment-form__login p { color: var(--th-muted); font-size: 14px; }

.comment-form { display: flex; flex-direction: column; gap: 4px; }
.comment-form p { margin: 0 0 12px; }
.comment-form label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--th-ink-2); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%; padding: 12px 14px;
	border: 1.5px solid var(--th-line); border-radius: var(--th-radius-sm);
	background: #fff; outline: 0; transition: border-color .18s ease, box-shadow .18s ease;
}
.comment-form textarea { min-height: 130px; resize: vertical; }
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--th-pink-light); box-shadow: 0 0 0 4px rgba(255, 95, 158, .1); }
.comment-form .submit { padding: 11px 30px; border: 0; border-radius: 999px; cursor: pointer; }
.comment-form__notes { font-size: 12px; color: var(--th-muted); }
.comment-notes { font-size: 12px; color: var(--th-muted); }

/* ==========================================================================
   13. Trang đọc chương
   ========================================================================== */
.th-reader { padding-bottom: 40px; }
.th-reader__bar {
	position: sticky; top: var(--th-header-h); z-index: 50;
	background: rgba(255, 255, 255, .96);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--th-line);
}
.th-reader__bar-inner {
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	min-height: 58px;
}
.th-reader__meta { display: flex; flex-direction: column; min-width: 0; }
.th-reader__back { font-size: 14px; font-weight: 700; color: var(--th-pink-dark); display: inline-flex; gap: 6px; }
.th-reader__chapter-name { font-size: 11.5px; color: var(--th-muted); }
.th-reader__nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.th-reader__navbtn {
	display: inline-flex; align-items: center; gap: 7px;
	padding: 8px 15px; border-radius: 999px;
	background: var(--th-pink-soft); color: var(--th-pink-dark);
	font-size: 13px; font-weight: 600; border: 0; cursor: pointer;
}
.th-reader__navbtn:hover { background: #ffd6e6; color: var(--th-pink-dark); }
.th-reader__navbtn--next { background: linear-gradient(135deg, var(--th-pink-light), var(--th-pink)); color: #fff; }
.th-reader__navbtn--next:hover { color: #fff; }
.th-reader__navbtn.is-disabled { opacity: .4; pointer-events: none; }
.th-reader__navbtn--icon { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 50%; }

.th-reader__select { position: relative; display: inline-flex; align-items: center; }
.th-reader__select-icon { position: absolute; left: 12px; font-size: 13px; pointer-events: none; }
.th-reader__select select {
	appearance: none; -webkit-appearance: none;
	padding: 8px 30px 8px 32px; max-width: 190px;
	border: 1.5px solid var(--th-line); border-radius: 999px;
	background: #fff; font-size: 13px; font-weight: 600; color: var(--th-ink-2);
	cursor: pointer;
}

.th-chapter { margin-top: 18px; }
.th-chapter__paper {
	max-width: 900px; margin: 0 auto;
	background: #fff; border-radius: var(--th-radius);
	box-shadow: 0 10px 34px rgba(120, 60, 90, .10);
	padding: 40px 52px;
}
.th-chapter__head { margin-bottom: 26px; text-align: center; border-bottom: 1px dashed var(--th-line-strong); padding-bottom: 18px; }
.th-chapter__title { margin: 0 0 6px; font-size: 25px; font-weight: 800; }
.th-chapter__story { margin: 0; font-size: 13px; color: var(--th-muted); }
.th-chapter__story a { font-weight: 600; }

.th-chapter__content {
	font-size: calc(17px * var(--th-reader-scale, 1));
	line-height: var(--th-reader-lh, 1.95);
	color: var(--th-reader-ink, var(--th-ink));
	font-family: var(--th-reader-font, var(--th-font));
}
.th-chapter__content p { margin: 0 0 1.35em; }
.th-chapter__content h2,
.th-chapter__content h3 { margin: 1.4em 0 .6em; font-size: 1.15em; }
.th-chapter__content img { border-radius: var(--th-radius-sm); margin: 1em auto; }
.th-chapter__content blockquote {
	margin: 1.4em 0; padding: 12px 20px;
	border-left: 4px solid var(--th-pink-light);
	background: #fff8fb; border-radius: 0 var(--th-radius-xs) var(--th-radius-xs) 0;
	font-style: italic;
}

.th-chapter__foot {
	display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
	margin-top: 34px; padding-top: 18px; border-top: 1px dashed var(--th-line-strong);
}
.th-chapter__stats { margin: 0; font-size: 12.5px; color: var(--th-muted); }
.th-report {
	display: inline-flex; align-items: center; gap: 6px;
	border: 0; background: transparent; cursor: pointer;
	font-size: 12.5px; font-weight: 600; color: var(--th-red);
}
.th-report.is-sent { color: #16a34a; }

.th-chapter__nav {
	display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
	max-width: 900px; margin: 24px auto 0;
}
.th-chapter__nav .th-btn { flex: 0 1 auto; }
.th-chapter__navprev, .th-chapter__navnext { min-width: 190px; }

/* Nền đọc */
body.th-read-light .th-chapter__paper { background: #fff; }
body.th-read-sepia .th-chapter__paper { background: #fbf3e4; }
body.th-read-sepia .th-chapter__content { --th-reader-ink: #4a3b2a; }
body.th-read-dark .th-chapter__paper { background: #1b1a21; box-shadow: none; }
body.th-read-dark .th-chapter__content { --th-reader-ink: #d7d3de; }
body.th-read-dark .th-chapter__title { color: #f2eef6; }
body.th-read-dark .th-reader__bar { background: rgba(27, 26, 33, .96); border-color: #2c2a35; }

.th-reader--seriffont .th-chapter__content { font-family: var(--th-font-serif); }

/* ==========================================================================
   14. Trang tĩnh / bài viết
   ========================================================================== */
.th-page, .th-archive { padding-top: 24px; }
.th-page-head { margin-bottom: 20px; }
.th-page-head__title { margin: 0 0 6px; font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.th-page-head__query { color: var(--th-pink-dark); }
.th-page-head__desc { margin: 0; font-size: 14px; color: var(--th-muted); }

.th-entry { background: var(--th-card); border-radius: var(--th-radius); box-shadow: var(--th-shadow); padding: 30px 34px; }
.th-entry__content { font-size: 16px; line-height: 1.85; color: var(--th-ink-2); }
.th-entry__content h2 { font-size: 21px; margin-top: 1.5em; }
.th-entry__content h3 { font-size: 18px; margin-top: 1.4em; }
.th-entry__content ul { list-style: disc; padding-left: 22px; margin-bottom: 1em; }
.th-entry__content ol { list-style: decimal; padding-left: 22px; margin-bottom: 1em; }
.th-entry__content img { border-radius: var(--th-radius-sm); }
.th-entry__thumb { margin-bottom: 22px; border-radius: var(--th-radius-sm); overflow: hidden; }
.th-entry__content a { text-decoration: underline; }

/* ==========================================================================
   15. Thông báo / 404
   ========================================================================== */
.th-notice {
	padding: 22px 24px; margin-bottom: 24px;
	background: var(--th-card); border: 1px dashed var(--th-line-strong);
	border-radius: var(--th-radius); text-align: center;
	color: var(--th-ink-2); font-size: 14px;
}
.th-notice--empty { padding: 50px 24px; }
.th-notice__icon { font-size: 40px; margin-bottom: 8px; }

.th-404 { padding: 60px 0; text-align: center; }
.th-404__code {
	margin: 0; font-size: 84px; font-weight: 800; line-height: 1;
	background: linear-gradient(120deg, var(--th-pink), var(--th-purple));
	-webkit-background-clip: text; background-clip: text; color: transparent;
}
.th-404__title { margin: 10px 0; font-size: 24px; }
.th-404__desc { color: var(--th-muted); max-width: 520px; margin: 0 auto 22px; }
.th-404__search { max-width: 480px; margin: 0 auto 22px; }
.th-404__actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }
.th-404 .th-section__head { justify-content: center; }
.th-404 .th-section { text-align: left; }

.th-search--form {
	display: flex; gap: 10px; padding: 6px 6px 6px 18px;
	background: #fff; border: 1.5px solid var(--th-line); border-radius: 999px;
}
.th-search--form .th-search__input { flex: 1 1 auto; width: auto; padding: 8px 0; }
.th-search__submit { padding: 10px 22px; }

/* ==========================================================================
   16. Chân trang
   ========================================================================== */
.th-footer {
	margin-top: 20px; padding: 46px 0 22px;
	background: linear-gradient(180deg, #fff6fa, #ffffff);
	border-top: 1px solid var(--th-line);
}
.th-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1.6fr; gap: 34px; }
.th-footer__title { margin: 0 0 14px; font-size: 17px; font-weight: 800; }
.th-footer__desc { font-size: 14px; color: var(--th-ink-2); line-height: 1.8; }
.th-footer__list { display: flex; flex-direction: column; gap: 9px; }
.th-footer__list a { font-size: 14px; color: var(--th-ink-2); }
.th-footer__list a:hover { color: var(--th-pink-dark); }
.th-footer__genres { display: flex; flex-wrap: wrap; gap: 8px; }
.th-footer__widgets { display: flex; flex-wrap: wrap; gap: 34px; margin-top: 34px; }
.th-widget--footer { background: transparent; box-shadow: none; padding: 0; flex: 1 1 240px; }
.th-footer__bottom {
	display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
	margin-top: 34px; padding-top: 18px;
	border-top: 1px solid var(--th-line);
}
.th-footer__copy { margin: 0; font-size: 12.5px; color: var(--th-muted); }
.th-footer__menu { display: flex; gap: 18px; font-size: 12.5px; }

.th-to-top {
	position: fixed; right: 22px; bottom: 22px; z-index: 70;
	width: 44px; height: 44px; border: 0; border-radius: 50%;
	background: linear-gradient(135deg, var(--th-pink-light), var(--th-pink));
	color: #fff; font-size: 18px; cursor: pointer;
	box-shadow: 0 10px 26px rgba(255, 95, 158, .4);
	opacity: 0; visibility: hidden; transform: translateY(10px);
	transition: all .22s ease;
}
.th-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* ==========================================================================
   17. Đăng nhập / Đăng ký thành viên
   ========================================================================== */
.th-auth-page { padding: 34px 20px 60px; }
.th-auth { display: flex; justify-content: center; }
.th-auth__card {
	width: min(438px, 100%);
	background: var(--th-card);
	border-radius: 20px;
	padding: 34px 34px 26px;
	box-shadow: 0 22px 55px rgba(120, 60, 90, .14);
	text-align: center;
}
.th-auth__icon {
	width: 58px; height: 58px; margin: 0 auto 14px;
	display: flex; align-items: center; justify-content: center;
	border-radius: 50%; font-size: 24px;
	background: linear-gradient(135deg, #ffd9e8, #ffb3d1);
	color: var(--th-pink-dark);
}
.th-auth__icon--green { background: linear-gradient(135deg, #d6f5e6, #a7e8c9); color: #12795a; }
.th-auth__icon img { border-radius: 50%; }
.th-auth__title { margin: 0 0 4px; font-size: 27px; font-weight: 800; letter-spacing: -.6px; }
.th-auth__sub { margin: 0 0 22px; font-size: 13.5px; color: var(--th-muted); }
.th-auth__form { text-align: left; }
.th-auth__error {
	padding: 10px 14px; margin-bottom: 16px; text-align: left;
	background: #fff1f0; border: 1px solid #ffccc7; border-radius: 10px;
	color: #a8071a; font-size: 13px;
}
.th-auth__terms { margin: 4px 0 16px; font-size: 12px; color: var(--th-muted); line-height: 1.6; }

.th-field { display: block; margin-bottom: 15px; }
.th-field__label {
	font-size: 11.5px; font-weight: 700; letter-spacing: .9px;
	text-transform: uppercase; color: var(--th-ink-2);
}
.th-field__row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.th-field__hint { font-size: 11.5px; font-weight: 600; color: var(--th-pink-dark); }
.th-field__box {
	position: relative; display: flex; align-items: center; gap: 10px;
	height: 48px; margin-top: 7px; padding: 0 14px;
	border: 1.5px solid var(--th-line); border-radius: 11px;
	background: var(--th-card);
	transition: border-color .18s ease, box-shadow .18s ease;
}
.th-field__box:focus-within { border-color: var(--th-pink-light); box-shadow: 0 0 0 4px rgba(255, 95, 158, .12); }
.th-field__icon { font-size: 14px; opacity: .55; flex: 0 0 auto; }
.th-field__box input {
	flex: 1 1 auto; min-width: 0; height: 100%;
	border: 0; outline: 0; background: transparent;
	font-size: 14.5px; color: var(--th-ink);
}
.th-field__box input::placeholder { color: var(--th-muted); }
.th-field__eye {
	flex: 0 0 auto; border: 0; background: transparent; cursor: pointer;
	font-size: 15px; color: var(--th-muted); padding: 4px; line-height: 1;
}
.th-field__eye:hover { color: var(--th-pink-dark); }

.th-check {
	display: flex; align-items: center; gap: 9px;
	margin-bottom: 18px; font-size: 13px; color: var(--th-ink-2); cursor: pointer;
}
.th-check input { width: 16px; height: 16px; accent-color: var(--th-pink); }

.th-auth__submit {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	width: 100%; padding: 14px 20px;
	border: 0; border-radius: 999px; cursor: pointer;
	font-size: 15px; font-weight: 700; color: #fff;
	background: linear-gradient(135deg, var(--th-pink-light), var(--th-pink));
	box-shadow: 0 10px 26px rgba(255, 95, 158, .34);
	transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.th-auth__submit:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 14px 30px rgba(255, 95, 158, .44); }
.th-auth__submit--green { background: linear-gradient(135deg, #34c38f, #1a9e6f); box-shadow: 0 10px 26px rgba(26, 158, 111, .3); }
.th-auth__submit--green:hover { box-shadow: 0 14px 30px rgba(26, 158, 111, .4); }
.th-auth__submit--ghost {
	background: transparent; color: var(--th-pink-dark);
	border: 1.5px solid var(--th-line-strong); box-shadow: none;
}
.th-auth__submit--ghost:hover { background: var(--th-pink-soft); box-shadow: none; }
.th-auth__actions { display: flex; flex-direction: column; gap: 10px; }

.th-auth__or { position: relative; margin: 20px 0 14px; text-align: center; }
.th-auth__or::before {
	content: ''; position: absolute; left: 0; right: 0; top: 50%;
	height: 1px; background: var(--th-line);
}
.th-auth__or span {
	position: relative; padding: 0 12px;
	background: var(--th-card);
	font-size: 11px; font-weight: 700; letter-spacing: 1.6px;
	text-transform: uppercase; color: var(--th-muted);
}
.th-auth__switch { margin: 0; font-size: 13.5px; color: var(--th-ink-2); }
.th-auth__switch a { font-weight: 700; }
.th-auth__admin { margin: 14px 0 0; font-size: 11.5px; }
.th-auth__admin a { color: var(--th-muted); }

/* ==========================================================================
   18. Cổng quảng cáo mở khóa chương
   ========================================================================== */
.th-gate { padding: 6px 0 10px; text-align: center; }
.th-gate__heading { margin: 0 0 6px; font-size: 15px; color: var(--th-ink-2); }
.th-gate__highlight {
	margin: 0 0 16px; font-size: 17px; font-weight: 800;
	letter-spacing: -.2px; color: #e53935;
}
.th-gate__linkrow { margin: 0 0 18px; }
.th-gate__link {
	font-size: 14.5px; font-weight: 700; color: #1565c0;
	word-break: break-all; text-decoration: underline;
}
.th-gate__link:hover { color: #0d47a1; }
.th-gate__media {
	display: inline-block; margin: 0 auto 18px; padding: 16px;
	background: #f4f5f7; border-radius: 14px;
}
.th-gate__media img {
	display: block; width: auto; max-width: min(420px, 100%);
	max-height: 420px; border-radius: 8px;
}
.th-gate__note { margin: 0 0 10px; font-size: 14px; color: #1565c0; }
.th-gate__thanks { margin: 0 0 18px; font-size: 15px; font-weight: 700; color: #f57c00; }
.th-gate__confirm { margin: 0; font-size: 13px; }
.th-gate__confirm a { color: var(--th-pink-dark); font-weight: 600; }
.th-gate__loading { margin: 10px 0 0; font-size: 13px; color: var(--th-muted); }

.th-toast {
	position: fixed; left: 50%; bottom: 28px; z-index: 200;
	transform: translateX(-50%) translateY(16px);
	padding: 12px 22px; border-radius: 999px;
	background: rgba(44, 36, 48, .94); color: #fff;
	font-size: 13.5px; font-weight: 600;
	opacity: 0; visibility: hidden; transition: all .25s ease;
}
.th-toast.is-visible { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

body.th-dark .th-field__box { background: #23222b; }
body.th-dark .th-auth__or span { background: var(--th-card); }
body.th-dark .th-auth__error { background: #3a1a1c; border-color: #6b2b30; color: #ffb3b8; }
body.th-dark .th-gate__media { background: #23222b; }
body.th-dark .th-gate__link { color: #7fb3ff; }
body.th-dark .th-gate__note { color: #8fb8ff; }
body.th-dark .th-auth__icon { background: linear-gradient(135deg, #4a2a3a, #6b3550); color: #ffb3d1; }
body.th-dark .th-auth__icon--green { background: linear-gradient(135deg, #1d3a30, #245c47); color: #a7e8c9; }

/* ==========================================================================
   17. Chế độ tối
   ========================================================================== */
body.th-dark {
	--th-bg: #16151b;
	--th-card: #1f1e26;
	--th-ink: #ece9f1;
	--th-ink-2: #b9b4c6;
	--th-muted: #8b8698;
	--th-line: #2c2a35;
	--th-line-strong: #3a3646;
	--th-pink-soft: #2b2130;
	background-image:
		radial-gradient(900px 340px at 12% -8%, rgba(60, 40, 55, .8), transparent 62%),
		radial-gradient(760px 320px at 88% 2%, rgba(50, 35, 60, .7), transparent 60%);
}
body.th-dark .th-header,
body.th-dark .th-reader__bar { background: rgba(31, 30, 38, .95); }
body.th-dark .th-search,
body.th-dark .th-icon-btn,
body.th-dark .th-dropdown__toggle,
body.th-dark .th-dropdown__menu,
body.th-dark .th-burger,
body.th-dark .th-reader-panel { background: #23222b; }
body.th-dark .th-nav__list > li > a { color: var(--th-ink-2); }
body.th-dark .th-tab.is-active,
body.th-dark .th-filterbar__tab.is-active { color: #fff; }
body.th-dark .th-rank__title,
body.th-dark .th-card__title,
body.th-dark .th-mini__title { color: var(--th-ink); }
body.th-dark .th-info-grid { background: #23222b; }
body.th-dark .th-chapters { background: #23222b; }
body.th-dark .th-chapters__latest { background: #1f1e26; }
body.th-dark .comment-body { background: #23222b; }
body.th-dark .th-footer { background: linear-gradient(180deg, #1b1a22, #16151b); }
body.th-dark .th-pagination__list .page-numbers { background: #23222b; color: var(--th-ink-2); }
body.th-dark .th-chapter-item { border-color: #2c2a35; }
body.th-dark .th-comment-form__login { background: #23222b; }

/* ==========================================================================
   18. Responsive
   ========================================================================== */
@media (max-width: 1180px) {
	.th-header__inner { gap: 14px; }
	.th-nav__list > li > a { padding: 9px 10px; font-size: 14px; }
	.th-search { padding-left: 12px; }
	.th-search__input { width: 128px; }
	.th-account { padding: 9px 15px; font-size: 13.5px; }
	.th-grid--6 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.th-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; }
	.th-story__head { grid-template-columns: 220px minmax(0, 1fr); gap: 22px; }
}

@media (max-width: 1080px) {
	.th-search { display: none; }
}

@media (max-width: 1024px) {
	.th-nav {
		position: fixed; inset: var(--th-header-h) 0 auto 0; z-index: 65;
		background: #fff; border-bottom: 1px solid var(--th-line);
		padding: 12px 20px 22px; max-height: calc(100vh - var(--th-header-h));
		overflow-y: auto; display: none;
	}
	.th-nav.is-open { display: block; }
	.th-nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
	.th-nav__list > li > a { padding: 12px 14px; border-radius: 12px; font-size: 15px; }
	.th-nav .sub-menu {
		position: static; opacity: 1; visibility: visible; transform: none;
		box-shadow: none; border: 0; padding: 0 0 0 14px; max-height: none;
	}
	.th-nav__list > li > .sub-menu { display: none; }
	.th-nav__list > li.is-open > .sub-menu { display: block; }
	.th-nav .th-mega-parent > .sub-menu {
		display: none; grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0 10px; padding: 4px 0 0 14px; left: auto; right: auto; top: auto;
		border-radius: 0; box-shadow: none; max-height: none;
	}
	.th-nav__list > li.th-mega-parent.is-open > .sub-menu { display: grid; }
	.th-nav li.th-mega-parent:hover::after,
	.th-nav li.th-mega-parent:focus-within::after { content: none; }
	.th-burger { display: flex; }
	.th-search { display: none; }
	.th-layout { grid-template-columns: minmax(0, 1fr); }
	.th-sidebar { position: static; }
	.th-grid--5 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.th-footer__grid { grid-template-columns: 1fr 1fr; }
	.th-footer__col--genres { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
	.th-story { padding: 18px; }
	.th-story__head { grid-template-columns: 180px minmax(0, 1fr); gap: 18px; }
	.th-story__title { font-size: 22px; }
	.th-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
	.th-chapter-grid { grid-template-columns: 1fr; }
	.th-chapter__paper { padding: 26px 20px; }
	.th-catbanner { padding: 20px; }
	.th-catbanner__title { font-size: 22px; }
	.th-grid--6, .th-grid--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.th-grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.th-reader__bar-inner { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
	.th-reader__navtext { display: none; }
	.th-reader__navbtn { padding: 8px 12px; }
	.th-reader__select select { max-width: 130px; }
}

/* ── Điện thoại: trang truyện xếp dọc, thoáng như ảnh thiết kế ── */
@media (max-width: 760px) {
	.th-single-story { padding-top: 14px; }
	.th-story { padding: 14px 14px 18px; border-radius: 14px; }

	.th-story__head { grid-template-columns: minmax(0, 1fr); gap: 16px; }

	.th-story__coverbox { align-items: center; gap: 16px; }
	.th-story__cover { width: min(212px, 62%); margin: 0 auto; border-radius: 14px; }
	.th-story__cover .th-cover__img { border-radius: 14px; }

	.th-story__cover-actions { flex-direction: row; align-items: stretch; width: 100%; gap: 10px; }
	.th-story__cover-actions .th-btn--block { flex: 1 1 auto; width: auto; padding: 13px 18px; }

	/* Nút theo dõi thu lại thành nút tròn hình trái tim */
	.th-story__cover-actions .th-follow {
		flex: 0 0 48px; width: 48px; height: 48px; padding: 0;
		border-radius: 50%; border-width: 2px;
	}
	.th-story__cover-actions .th-follow__text { display: none; }
	.th-story__cover-actions .th-follow__icon { font-size: 20px; line-height: 1; }
	.th-story__cover-actions .th-follow.is-active { background: var(--th-pink-soft); border-color: var(--th-pink); color: var(--th-pink-dark); }

	.th-story__info { width: 100%; }
	.th-story__title { font-size: 23px; letter-spacing: -.3px; margin-bottom: 4px; }
	.th-story__updated { margin-bottom: 10px; }
	.th-story__genres { margin-bottom: 14px; }

	.th-info-grid { padding: 16px; gap: 14px 16px; }
	.th-info-grid__label { font-size: 11.5px; }
	.th-info-grid__value { font-size: 14px; }

	.th-story__rating { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
	.th-story__subtitle { font-size: 16px; }

	.th-chapters { padding: 16px 14px; }
	.th-chapters__latest { flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (max-width: 600px) {
	:root { --th-header-h: 60px; }
	.th-container { padding: 0 14px; }
	.th-brand__name { font-size: 17px; }
	.th-grid { gap: 14px 10px; }
	.th-grid--6, .th-grid--5, .th-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.th-card__title { font-size: 12.5px; padding: 8px 9px; min-height: 50px; }
	.th-card__meta { padding: 0 9px 10px; font-size: 11px; }
	.th-section__title { font-size: 17px; }
	.th-story__title { font-size: 21px; }
	.th-chapter__paper { padding: 22px 16px; border-radius: 12px; }
	.th-chapter__title { font-size: 20px; }
	.th-chapter__content { font-size: calc(16px * var(--th-reader-scale, 1)); }
	.th-footer__grid { grid-template-columns: 1fr; gap: 24px; }
	.th-footer__bottom { flex-direction: column; text-align: center; }
	.th-catbanner { flex-direction: column; align-items: flex-start; }
	.th-catbanner__icon { display: none; }
	.th-filterbar { flex-direction: column; align-items: stretch; }
	.th-filterbar__right { margin-left: 0; justify-content: space-between; }
	.th-page-head__title { font-size: 22px; }
	.th-entry { padding: 20px 18px; }
	.th-reader-panel__inner { gap: 10px 16px; }
	.th-reader-panel__reset { margin-left: 0; }
}

@media print {
	.th-header, .th-footer, .th-sidebar, .th-reader__bar, .th-chapter__nav, .th-comments, .th-to-top { display: none !important; }
	.th-chapter__paper { box-shadow: none; padding: 0; }
}
