/* ==========================================================================
   THICHDOCTRUYEN — STYLESHEET (Mobile-First 390px, Responsive to Desktop 680px)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&family=Lora:ital,wght@0,400;0,500;0,600;1,400&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300&family=Roboto:wght@400;500;700&display=swap');

:root {
  --primary: #006f48;
  --primary-dark: #043825;
  --primary-light: #e6f4ee;
  --accent: #e47c80;
  --accent-hover: #d3686c;
  --gold: #f59e0b;
  
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  
  /* Badges */
  --badge-he-bg: #dcfce7;
  --badge-he-text: #166534;
  --badge-se-bg: #ffe4e6;
  --badge-se-text: #9f1239;
  --badge-oe-bg: #f3e8ff;
  --badge-oe-text: #6b21a8;

  /* Reader themes */
  --reader-bg: #faf7ee; /* Default Gold Paper */
  --reader-text: #2b2520;
  --reader-font: 'Lora', serif;
  --reader-font-size: 19px;
  --reader-line-height: 1.8;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

/* BASE RESETS */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* LAYOUT CONTAINER */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.reader-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px;
}

/* HEADER */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 12px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

.brand-logo img {
  height: 34px;
  width: auto;
}

.brand-tagline {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  display: block;
  line-height: 1;
}

/* SEARCH BAR */
.header-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrap input {
  width: 100%;
  height: 38px;
  padding: 0 38px 0 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: #f1f5f9;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.search-input-wrap input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 111, 72, 0.12);
}

.search-btn {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* LIVE SEARCH SUGGESTIONS */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 6px;
  box-shadow: var(--shadow-md);
  z-index: 200;
  overflow: hidden;
  display: none;
}

.search-suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s;
}

.search-suggestion-item:last-child {
  border-bottom: none;
}

.search-suggestion-item:hover {
  background: #f8fafc;
}

.search-suggestion-img {
  width: 32px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

/* HEADER ACTIONS */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.action-btn.primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.action-btn.primary:hover {
  background: var(--primary-dark);
}

/* MOBILE NAV BAR (BOTTOM FIXED ON 390px) */
.mobile-nav-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  z-index: 99;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  gap: 2px;
  padding: 4px 10px;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
  color: var(--primary);
}

.mobile-nav-item svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 768px) {
  .mobile-nav-bar {
    display: flex;
  }
  body {
    padding-bottom: 60px; /* Space for bottom nav */
  }
  .header-actions .desktop-only {
    display: none;
  }
}

/* BADGES (HE / SE / OE) */
.badge-end {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
}

.badge-he {
  background: var(--badge-he-bg);
  color: var(--badge-he-text);
  border: 1px solid #bbf7d0;
}

.badge-se {
  background: var(--badge-se-bg);
  color: var(--badge-se-text);
  border: 1px solid #fecdd3;
}

.badge-oe {
  background: var(--badge-oe-bg);
  color: var(--badge-oe-text);
  border: 1px solid #e9d5ff;
}

/* TAGS */
.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  background: #f1f5f9;
  color: var(--text-muted);
  transition: background 0.15s;
}

.tag-pill:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* STORY CARDS */
.story-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .story-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (min-width: 860px) {
  .story-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
}

@media (min-width: 1040px) {
  .story-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
  }
}

.story-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.story-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.story-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: #e2e8f0;
}

.story-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.story-card:hover .story-card-cover img {
  transform: scale(1.03);
}

.story-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
}

.story-card-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.story-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.story-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.story-card-focus {
  font-size: 11.5px;
  font-style: italic;
  color: var(--primary);
  margin-top: auto;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* COMPACT LIST (Mới cập nhật dạng gọn theo mục 4) */
.compact-update-list {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.compact-update-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  gap: 12px;
  transition: background 0.15s ease;
}

.compact-update-item:hover {
  background: #fdfbf7;
}

.compact-update-item:last-child {
  border-bottom: none;
}

.compact-update-thumb {
  width: 44px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  background: #f1f5f9;
  display: block;
}

.compact-update-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.compact-update-item:hover .compact-update-thumb img {
  transform: scale(1.05);
}

.compact-update-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.compact-update-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.compact-update-title {
  font-weight: 600;
  color: var(--text-main);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.compact-update-title:hover {
  color: var(--primary);
}

.compact-update-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.compact-update-chapter {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}

.compact-update-chapter:hover {
  text-decoration: underline;
}

.compact-update-dot {
  color: #cbd5e1;
}

.compact-update-time {
  color: var(--text-light);
  font-size: 11.5px;
}

/* ==========================================================================
   FRESH UPDATE GRID (Mới cập nhật dạng thẻ bìa lớn chuẩn KakaoPage)
   ========================================================================== */
.section-subtitle {
  font-size: 12.5px;
  color: #64748b;
  margin-top: 2px;
}

.fresh-update-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.fresh-card {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.fresh-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(244, 63, 94, 0.1);
  border-color: #fecdd3;
}

.fresh-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #f8fafc;
}

.fresh-cover-link {
  display: block;
  width: 100%;
  height: 100%;
}

.fresh-cover-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.fresh-card:hover .fresh-cover-link img {
  transform: scale(1.06);
}

.fresh-badge-top-left {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
}

.fresh-up-badge {
  background: linear-gradient(135deg, #f43f5e, #fb923c);
  color: #ffffff;
  font-weight: 800;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.45);
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.fresh-badge-top-right {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}

.fresh-cover-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 22px 10px 8px 10px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.6) 60%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  transition: background 0.2s ease;
}

.fresh-cover-bottom:hover {
  background: linear-gradient(to top, rgba(225, 29, 72, 0.95) 0%, rgba(225, 29, 72, 0.65) 60%, transparent 100%);
}

.fresh-chap-tag {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
}

.fresh-time-tag {
  font-size: 11px;
  color: #fde68a;
  font-weight: 500;
}

.fresh-info {
  padding: 10px 12px 12px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  gap: 4px;
}

.fresh-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  display: block;
}

.fresh-title:hover {
  color: var(--primary, #e11d48);
}

.fresh-focus {
  font-size: 11.5px;
  color: #e11d48;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  font-style: italic;
}

.fresh-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
}

.fresh-author-name {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.fresh-read-btn {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #e11d48;
  background: #fff1f2;
  padding: 3px 8px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.fresh-read-btn:hover {
  background: #e11d48;
  color: #ffffff !important;
}

@media (max-width: 768px) {
  .fresh-update-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .fresh-info {
    padding: 8px 10px 10px 10px;
  }
  .fresh-title {
    font-size: 13px;
  }
  .fresh-chap-tag {
    font-size: 11px;
  }
  .fresh-time-tag {
    font-size: 10px;
  }
  .fresh-read-btn {
    font-size: 11px;
    padding: 2px 6px;
  }
}

/* VERTICAL CHAPTER LIST (Dạng Dọc 1 Cột toàn phần - Tuyệt đối không mất chữ) */
.chapter-vertical-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.chapter-vertical-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.18s ease;
  min-height: 48px;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

.chapter-vertical-item:hover {
  background: #fdfbf7;
  border-color: #cbd5e1;
  transform: translateX(3px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.chapter-vertical-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.chapter-badge-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: 12px;
  flex-shrink: 0;
  min-width: 36px;
  text-align: center;
}

.chapter-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  white-space: normal;
  word-break: break-word;
  line-height: 1.5;
  flex: 1;
}

.chapter-vertical-item:hover .chapter-item-title {
  color: var(--primary);
  font-weight: 600;
}

.chapter-vertical-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.chapter-free-tag {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: #dcfce7;
  color: #166534;
}

.chapter-vip-tag {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: #fef3c7;
  color: #b45309;
}

.chapter-item-icon {
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  opacity: 0.85;
  white-space: nowrap;
}

.chapter-vertical-item:hover .chapter-item-icon {
  opacity: 1;
  transform: translateX(3px);
}

body.global-dark .chapter-vertical-item {
  background: #1c1d22;
  border-color: #2e323b;
}

body.global-dark .chapter-vertical-item:hover {
  background: #252830;
  border-color: #3b4252;
}

body.global-dark .chapter-item-title {
  color: #e2e8f0;
}

body.global-dark .chapter-item-icon {
  color: #34d399;
}

/* SECTION TITLES */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  margin-top: 24px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--primary);
  border-radius: 2px;
}

.section-more {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
}

/* CALLOUT "ĐANG ĐỌC DỞ" VỚI CÂU MÓC (Mục 4 & 12.2) */
.reading-resume-card {
  background: #fffbf0;
  border: 1px solid #fde68a;
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 16px 0 24px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reading-resume-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reading-resume-tag {
  font-size: 11.5px;
  font-weight: 600;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.reading-resume-hook {
  font-size: 14px;
  color: #78350f;
  font-style: italic;
  line-height: 1.45;
}

.reading-resume-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

/* DUAL STATE: TRẠNG THÁI KHÁCH MỚI / CHƯA CÓ LỊCH SỬ ĐỌC (MỤC 12.2) */
.new-user-welcome-card {
  background: linear-gradient(135deg, #fff9f6 0%, #fff1f2 60%, #fff7ed 100%);
  border: 1px solid #fecdd3;
  border-left: 4px solid var(--primary, #e11d48);
  border-radius: var(--radius-lg, 12px);
  padding: 22px 24px;
  margin: 16px 0 28px 0;
  box-shadow: 0 4px 20px -2px rgba(225, 29, 72, 0.06);
}

.welcome-header {
  margin-bottom: 16px;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #be123c;
  background: #ffe4e6;
  padding: 4px 10px;
  border-radius: 9999px;
}

.welcome-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 10px 0 6px 0;
  line-height: 1.35;
  letter-spacing: -0.3px;
}

.welcome-desc {
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
  margin: 0;
}

.welcome-gift-bar {
  background: #ffffff;
  border: 1.5px dashed #fb7185;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.05);
}

.gift-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gift-icon {
  font-size: 26px;
  line-height: 1;
}

.gift-text {
  font-size: 13.5px;
  color: #334155;
  line-height: 1.45;
}

.gift-tag {
  font-weight: 700;
  color: #e11d48;
  margin-right: 4px;
}

.welcome-gift-btn {
  background: linear-gradient(135deg, #e11d48, #f43f5e);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.25);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.welcome-gift-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.35);
}

.starter-tags-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.starter-tags-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  margin-right: 4px;
}

.starter-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.starter-pill {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #475569;
  padding: 4px 11px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}

.starter-pill:hover {
  background: #ffe4e6;
  border-color: #fda4af;
  color: #e11d48;
}

.starter-picks-section {
  border-top: 1px solid rgba(244, 63, 94, 0.18);
  padding-top: 16px;
}

.starter-picks-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 14px;
}

.starter-picks-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.starter-picks-sub {
  font-size: 12.5px;
  color: #64748b;
}

.starter-picks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.starter-card {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  gap: 12px;
  padding: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.starter-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.08);
  border-color: #fecdd3;
}

.starter-thumb {
  position: relative;
  width: 75px;
  min-width: 75px;
  height: 105px;
  border-radius: 6px;
  overflow: hidden;
  display: block;
}

.starter-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.starter-thumb-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
}

.starter-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
}

.starter-meta-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #64748b;
}

.starter-setting-badge {
  font-size: 10.5px;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  padding: 1px 6px;
  border-radius: 4px;
}

.starter-author {
  font-size: 11px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.starter-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  margin-top: 2px;
}

.starter-title:hover {
  color: var(--primary, #e11d48);
}

.starter-hook {
  font-size: 11.5px;
  color: #475569;
  font-style: italic;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 3px 0 6px 0;
}

.starter-focus {
  font-size: 11.5px;
  color: #64748b;
  margin: 3px 0 6px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.starter-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: auto;
}

.starter-read-btn {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #e11d48;
  text-decoration: none;
  padding: 3px 9px;
  border-radius: 6px;
  background: #fff1f2;
  transition: all 0.15s ease;
}

.starter-read-btn:hover {
  background: #e11d48;
  color: #ffffff !important;
}

@media (max-width: 768px) {
  .new-user-welcome-card {
    padding: 16px 14px;
  }
  .welcome-title {
    font-size: 18px;
  }
  .welcome-gift-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    gap: 10px;
  }
  .welcome-gift-btn {
    justify-content: center;
  }
  .starter-picks-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ==========================================================================
   READER SCREEN (/doc-truyen/{slug}/chuong-{n}) — THE CROWN JEWEL
   ========================================================================== */
.reader-page {
  background-color: var(--reader-bg);
  color: var(--reader-text);
  min-height: 100vh;
  transition: background-color 0.25s, color 0.25s;
}

/* Reader Top Bar */
.reader-header {
  background: var(--reader-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: blur(8px);
}

.reader-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reader-story-info {
  flex: 1;
  min-width: 0;
}

.reader-story-title {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.reader-story-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  opacity: 0.8;
  margin-top: 2px;
}

.reader-settings-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: transparent;
  color: inherit;
  cursor: pointer;
  flex-shrink: 0;
}

/* Reader Settings Drawer / Modal */
.reader-settings-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  color: #1e293b;
  border-top: 1px solid var(--border-color);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  padding: 20px;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  max-width: 680px;
  margin: 0 auto;
}

.reader-settings-panel.open {
  transform: translateY(0);
}

.settings-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  display: none;
}

.settings-overlay.open {
  display: block;
}

.settings-row {
  margin-bottom: 16px;
}

.settings-row:last-child {
  margin-bottom: 0;
}

.settings-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
  color: var(--text-muted);
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.theme-btn {
  height: 38px;
  border-radius: 8px;
  border: 2px solid transparent;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn.active {
  border-color: var(--primary);
}

.theme-white { background: #ffffff; color: #1e293b; border-color: #cbd5e1; }
.theme-gold  { background: #faf7ee; color: #2b2520; border-color: #e2d9c2; }
.theme-sepia { background: #f4ecd8; color: #3d332a; border-color: #d8cdb4; }
.theme-dark  { background: #18191a; color: #e4e6eb; border-color: #3a3b3c; }

.font-options, .line-height-options {
  display: flex;
  gap: 8px;
}

.option-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border-color);
  background: #f8fafc;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
}

.option-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

/* Reader Content Area */
.chapter-heading {
  margin: 32px 0 24px 0;
  text-align: center;
}

.chapter-number-tag {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 1px;
}

.chapter-title-text {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 4px;
}

.chapter-body-content {
  font-family: var(--reader-font);
  font-size: var(--reader-font-size);
  line-height: var(--reader-line-height);
  color: var(--reader-text);
  margin-bottom: 40px;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.015em;
}

.chapter-body-content p {
  margin-bottom: 1.35em;
  text-align: justify;
  text-justify: inter-word;
  text-indent: 1.5em;
  word-break: break-word;
}

.chapter-body-content p.empty-chapter {
  text-align: center;
  font-style: italic;
  text-indent: 0;
  opacity: 0.7;
  padding: 30px 0;
}

/* Reader Bottom Actions */
.reader-bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 32px 0 20px 0;
}

.nav-ch-btn {
  flex: 1;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  transition: opacity 0.2s;
}

.nav-ch-btn:hover {
  opacity: 0.9;
}

.nav-ch-btn.secondary {
  background: transparent;
  color: inherit;
}

.nav-ch-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* Jump input */
.chapter-jump-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13.5px;
}

.chapter-jump-box input {
  width: 70px;
  height: 38px;
  text-align: center;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 14px;
}

.chapter-jump-box button {
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Nút Ủng hộ nhóm dịch */
.donate-ch-box {
  background: rgba(228, 124, 128, 0.12);
  border: 1px solid rgba(228, 124, 128, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.donate-ch-text {
  font-size: 13px;
  color: inherit;
}

.donate-ch-btn {
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.donate-ch-btn:hover {
  background: var(--accent-hover);
}

/* Nút Thêm vào tủ truyện */
.save-ch-btn {
  width: 100%;
  min-height: 44px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  margin-bottom: 24px;
}

/* Vị trí quảng cáo chờ sẵn */
.ad-slot-reserved {
  min-height: 90px;
  margin: 24px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.02);
  border: 1px dashed rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
}

/* FOOTER */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 32px 0 24px 0;
  margin-top: auto;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}

.footer-links a:hover {
  color: var(--primary);
}

/* FORM ELEMENTS */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

/* ==========================================================================
   PAGINATION (Custom Thích Đọc Truyện + Global SVGs Safeguard)
   ========================================================================== */
nav[role="navigation"] svg,
.pagination svg,
.tdt-pagination svg {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  display: inline-block !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
}

.tdt-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 28px 0;
  flex-wrap: wrap;
}

.tdt-page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tdt-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all 0.2s ease;
  user-select: none;
}

.tdt-page-btn:hover:not(.disabled):not(.active) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.tdt-page-btn.active {
  background: var(--primary);
  color: #ffffff !important;
  border-color: var(--primary);
  font-weight: 700;
}

.tdt-page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.tdt-page-btn.separator {
  border: none;
  background: transparent;
}

/* ==========================================================================
   GLOBAL DARK MODE THEME & THEME TOGGLE
   ========================================================================== */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  transform: scale(1.08);
  border-color: var(--primary);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.theme-toggle-btn .icon-sun {
  display: none;
}

.theme-toggle-btn .icon-moon {
  display: block;
}

body.global-dark {
  --bg-page: #121316;
  --bg-card: #1c1d22;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --border-color: #2e323b;
  --primary-light: #16382c;
  --reader-bg: #18181b;
  --reader-text: #e4e4e7;
  background-color: #121316;
  color: #f1f5f9;
}

body.global-dark .theme-toggle-btn .icon-sun {
  display: block;
  color: #facc15;
}

body.global-dark .theme-toggle-btn .icon-moon {
  display: none;
}

body.global-dark .site-header,
body.global-dark .site-footer,
body.global-dark .mobile-nav-bar {
  background-color: #18191e;
  border-color: #2e323b;
}

body.global-dark .brand-logo div > div {
  color: #f8fafc;
}

body.global-dark .story-card,
body.global-dark .admin-card,
body.global-dark .story-detail-card,
body.global-dark .chapter-list-card,
body.global-dark .modal-content {
  background-color: #1c1d22;
  border-color: #2e323b;
}

body.global-dark .story-card-title,
body.global-dark .section-title {
  color: #f8fafc;
}

body.global-dark .compact-update-item {
  border-bottom-color: #262830;
}

body.global-dark .compact-update-item:hover {
  background-color: #23252c;
}

body.global-dark .reading-resume-card {
  background-color: #241c14;
  border-color: #78350f;
}

body.global-dark .reading-resume-header span,
body.global-dark .reading-resume-hook {
  color: #fde68a;
}

body.global-dark .reading-resume-action span {
  color: #fcd34d;
}

body.global-dark .new-user-welcome-card {
  background: linear-gradient(135deg, #1c1917 0%, #1e1b2e 100%);
  border-color: #3f2c35;
  border-left-color: #fb7185;
  box-shadow: none;
}
body.global-dark .welcome-badge {
  background: #381a24;
  color: #fda4af;
}
body.global-dark .welcome-title {
  color: #f1f5f9;
}
body.global-dark .welcome-desc {
  color: #94a3b8;
}
body.global-dark .welcome-gift-bar {
  background: #231f28;
  border-color: #881337;
}
body.global-dark .gift-text {
  color: #e2e8f0;
}
body.global-dark .starter-pill {
  background: #23252c;
  border-color: #334155;
  color: #cbd5e1;
}
body.global-dark .starter-pill:hover {
  background: #381a24;
  border-color: #881337;
  color: #fda4af;
}
body.global-dark .starter-picks-section {
  border-top-color: #334155;
}
body.global-dark .starter-picks-title {
  color: #f1f5f9;
}
body.global-dark .starter-picks-sub {
  color: #94a3b8;
}
body.global-dark .starter-card {
  background: #202229;
  border-color: #2e323e;
}
body.global-dark .starter-title {
  color: #f1f5f9;
}
body.global-dark .starter-hook {
  color: #94a3b8;
}
body.global-dark .starter-read-btn {
  background: #381a24;
  color: #fda4af;
}
body.global-dark .starter-read-btn:hover {
  background: #e11d48;
  color: #ffffff !important;
}

body.global-dark .tag-pill,
body.global-dark .action-btn {
  background-color: #262830;
  color: #cbd5e1;
  border-color: #334155;
}

body.global-dark .site-search-input {
  background-color: #262830;
  border-color: #334155;
  color: #f1f5f9;
}

body.global-dark .tdt-page-btn {
  background: #1c1d22;
  color: #e2e8f0;
  border-color: #2e323b;
}

/* ==========================================================================
   MOBILE SWIPE INDICATOR TOAST
   ========================================================================== */
.swipe-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 14.5px;
  font-weight: 600;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 8px;
}

.swipe-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ==========================================================================
   MONETIZATION & PAYWALL STYLES
   ========================================================================== */

/* Header badges */
.header-coin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 16px;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.header-coin-badge:hover {
  background: #fde68a;
  transform: translateY(-1px);
}

.header-vip-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff !important;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 16px;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(217, 119, 6, 0.2);
  white-space: nowrap;
}
.header-vip-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* Footer Community Row */
.footer-community-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.community-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}
.community-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s;
}
.community-link.fb {
  background: #1877f2;
  color: #ffffff;
}
.community-link.fb:hover {
  background: #0d65d9;
}
.community-link.tt {
  background: #0f172a;
  color: #ffffff;
}
.community-link.tt:hover {
  background: #000000;
}

/* VIP Hero Banner */
.vip-hero-banner {
  background: linear-gradient(135deg, #006f48, #034b31);
  color: #ffffff;
  padding: 36px 24px;
  border-radius: var(--radius-lg);
  text-align: center;
  margin-bottom: 30px;
  box-shadow: 0 10px 25px -5px rgba(0, 111, 72, 0.3);
}
.vip-hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  color: #fef08a;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.vip-hero-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.vip-hero-subtitle {
  font-size: 14.5px;
  color: #e2e8f0;
  max-width: 580px;
  margin: 0 auto 18px auto;
  line-height: 1.5;
}
.vip-user-status {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #ffffff;
  color: var(--text-main);
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
}
.badge-vip-active {
  background: #fef3c7;
  color: #b45309;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}

/* VIP Pricing Grid */
.vip-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.vip-card {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.25s ease;
}
.vip-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.vip-card.popular {
  border-color: var(--accent);
  background: #fffcfc;
  box-shadow: 0 4px 15px rgba(228, 124, 128, 0.15);
}
.vip-card.gold-pass {
  border-color: var(--gold);
  background: #fffdf7;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.15);
}
.vip-card-badge {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.popular-tag {
  color: var(--accent);
}
.gold-tag {
  color: #b45309;
}
.vip-card-icon {
  font-size: 28px;
  margin-bottom: 8px;
}
.vip-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}
.vip-card-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}
.vip-card.popular .vip-card-price {
  color: var(--accent);
}
.vip-card.gold-pass .vip-card-price {
  color: #b45309;
}
.vip-card-coins {
  font-size: 13px;
  color: #475569;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.vip-card-features {
  list-style: none;
  font-size: 12.5px;
  color: #475569;
  margin-bottom: 20px;
  flex: 1;
}
.vip-card-features li {
  margin-bottom: 8px;
  position: relative;
  padding-left: 18px;
  line-height: 1.4;
}
.vip-card-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}
.btn-select-plan {
  width: 100%;
  min-height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-select-plan:hover {
  background: var(--primary);
  color: #ffffff;
}
.popular-btn {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
.popular-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.gold-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  border-color: transparent;
}
.gold-btn:hover {
  opacity: 0.92;
}

/* VietQR Checkout Section */
.vietqr-checkout-card {
  background: #ffffff;
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: 0 10px 25px rgba(0, 111, 72, 0.12);
}
.vietqr-checkout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: center;
}
@media (min-width: 640px) {
  .vietqr-checkout-grid {
    grid-template-columns: 240px 1fr;
  }
}
.vietqr-checkout-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.checkout-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #e2e8f0;
}

/* Redeem Giftcode Card */
.redeem-code-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 30px;
}

/* Native Affiliate Shelf */
.affiliate-corner-box {
  background: #ffffff;
  border: 1px solid #dcfce7;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
}
.affiliate-corner-header {
  margin-bottom: 18px;
}
.affiliate-corner-title {
  font-size: 17px;
  font-weight: 700;
  color: #166534;
}
.affiliate-corner-desc {
  font-size: 13px;
  color: #15803d;
  margin-top: 2px;
}
.affiliate-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.affiliate-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.2s;
}
.affiliate-card:hover {
  transform: translateY(-2px);
  border-color: #86efac;
}
.affiliate-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 2;
}
.affiliate-card-img {
  aspect-ratio: 1 / 1;
  background: #f1f5f9;
  overflow: hidden;
}
.affiliate-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.affiliate-card:hover .affiliate-card-img img {
  transform: scale(1.05);
}
.affiliate-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.affiliate-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.affiliate-card-tagline {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  flex: 1;
}
.affiliate-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  gap: 6px;
}
.affiliate-card-price {
  font-size: 13px;
  font-weight: 700;
  color: #dc2626;
}
.affiliate-buy-btn {
  font-size: 11.5px;
  font-weight: 600;
  color: #ffffff;
  background: #ee4d2d;
  padding: 4px 10px;
  border-radius: 12px;
  text-decoration: none;
  white-space: nowrap;
}
.affiliate-buy-btn:hover {
  background: #d73211;
}

/* Paywall in Reader */
.paywall-wrapper {
  position: relative;
  margin-top: 10px;
  margin-bottom: 30px;
}
.paywall-blur-overlay {
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--reader-bg) 90%);
  pointer-events: none;
  margin-top: -120px;
  position: relative;
  z-index: 2;
}
.vip-paywall-card {
  position: relative;
  z-index: 3;
  background: #ffffff;
  border: 2px solid #fde68a;
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  text-align: center;
  color: var(--text-main);
  margin-top: 12px;
}
body.global-dark .vip-paywall-card {
  background: #1f222a;
  border-color: #854d0e;
  color: #f1f5f9;
}
.vip-paywall-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  color: #b45309;
  margin-bottom: 8px;
}
body.global-dark .vip-paywall-header {
  color: #fde68a;
}
.vip-paywall-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 18px auto;
  line-height: 1.5;
}
.paywall-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto 18px auto;
}
@media (min-width: 480px) {
  .paywall-options-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.paywall-opt-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--text-main);
  min-height: 54px;
}
.paywall-opt-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
}
.paywall-opt-btn.primary-opt {
  background: linear-gradient(135deg, #006f48, #043825);
  color: #ffffff;
  border-color: transparent;
}
.paywall-opt-btn.gold-opt {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  border-color: transparent;
}
.paywall-opt-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}
.paywall-opt-sub {
  font-size: 11.5px;
  opacity: 0.88;
}
.paywall-giftcode-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 360px;
  margin: 12px auto 0 auto;
}
.paywall-giftcode-row input {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 600;
}
.paywall-giftcode-row button {
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #ffffff;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Stream 1: Mời Ly Trà Sữa Widget in Reader */
.tea-donate-widget {
  background: linear-gradient(135deg, #fff7ed, #fef2f2);
  border: 1.5px dashed #fca5a5;
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin: 24px 0 20px 0;
  text-align: center;
}
body.global-dark .tea-donate-widget {
  background: #231e20;
  border-color: #7f1d1d;
}
.tea-donate-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #991b1b;
  margin-bottom: 4px;
}
body.global-dark .tea-donate-title {
  color: #fca5a5;
}
.tea-donate-sub {
  font-size: 12.5px;
  color: #78350f;
  margin-bottom: 12px;
}
body.global-dark .tea-donate-sub {
  color: #cbd5e1;
}
.tea-pills-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.tea-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid #fca5a5;
  background: #ffffff;
  color: #991b1b;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.tea-pill-btn:hover {
  background: #fee2e2;
  transform: translateY(-1px);
}
body.global-dark .tea-pill-btn {
  background: #1f222a;
  border-color: #7f1d1d;
  color: #fca5a5;
}

/* Community Banner in Reader */
.reader-community-banner {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
body.global-dark .reader-community-banner {
  background: #1c1d22;
  border-color: #334155;
}
.reader-community-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.reader-community-icon {
  font-size: 24px;
}
.reader-community-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}
.reader-community-desc {
  font-size: 12px;
  color: var(--text-muted);
}
.reader-community-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.reader-community-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ========================================================
   ANTI-COPY & ANTI-DOWNLOAD CONTENT PROTECTION
   ======================================================== */
.reader-page-body,
.reader-container,
.chapter-body-content,
.chapter-body-content *,
.story-summary-text {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

/* Chống kéo thả ảnh để tải về máy */
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
}

/* Chống in và chống lưu dạng PDF qua lệnh Print của trình duyệt */
@media print {
  html, body, #app, .site-header, .site-footer, .reader-page, .reader-container, article {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
  }
}

/* ========================================================
   HANDS-FREE AI AUDIO READER & HIGHLIGHTING
   ======================================================== */
.audio-reader-box {
  background: linear-gradient(135deg, rgba(255, 241, 242, 0.85), rgba(254, 242, 242, 0.5));
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 24px;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.06);
  position: relative;
  transition: all 0.25s ease;
}
.audio-reader-box.reading {
  border-color: rgba(244, 63, 94, 0.5);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.12);
}
.audio-reader-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
}
.audio-reader-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.audio-icon-pulse {
  font-size: 24px;
  display: inline-block;
  transition: transform 0.3s;
}
.audio-reader-box.reading .audio-icon-pulse {
  animation: audioPulse 1.5s infinite;
}
@keyframes audioPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.audio-reader-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #9f1239;
  line-height: 1.2;
}
.audio-reader-subtitle {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}
.audio-reader-badge {
  font-size: 11px;
  font-weight: 600;
  background: #ffe4e6;
  color: #e11d48;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
}
.audio-reader-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.audio-main-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}
.audio-ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.audio-ctrl-btn.primary {
  background: var(--accent);
  color: #ffffff;
}
.audio-ctrl-btn.primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.audio-ctrl-btn.secondary {
  background: rgba(0, 0, 0, 0.06);
  color: #475569;
}
.audio-ctrl-btn.secondary:hover {
  background: rgba(0, 0, 0, 0.1);
}
.audio-settings-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.audio-speed-selector {
  display: flex;
  align-items: center;
  gap: 6px;
}
.audio-ctrl-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}
.audio-speed-pills {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  padding: 2px;
}
.speed-pill {
  background: transparent;
  border: none;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 14px;
  color: #64748b;
  cursor: pointer;
}
.speed-pill.active {
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.audio-select {
  font-size: 11.5px;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  outline: none;
}
.audio-progress-bar-wrap {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.audio-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 2px;
  overflow: hidden;
}
.audio-progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s ease;
}
.audio-progress-text {
  font-size: 11.5px;
  color: #64748b;
  white-space: nowrap;
}

/* Highlighting paragraph during TTS */
.chapter-body-content p.tts-reading-active {
  background: rgba(244, 63, 94, 0.08) !important;
  border-left: 4px solid var(--accent) !important;
  padding-left: 10px !important;
  border-radius: 4px;
  box-shadow: 0 1px 6px rgba(244, 63, 94, 0.06);
  transition: background 0.3s, border 0.3s;
}

/* Dark mode compatibility */
.global-dark .audio-reader-box,
body.theme-dark .audio-reader-box {
  background: #1e1b2e !important;
  border-color: #3b2a3f !important;
}
.global-dark .audio-reader-title,
body.theme-dark .audio-reader-title {
  color: #fda4af !important;
}
.global-dark .speed-pill.active,
body.theme-dark .speed-pill.active {
  background: #332840 !important;
  color: #fda4af !important;
}
.global-dark .audio-select,
body.theme-dark .audio-select {
  background: #231c30 !important;
  border-color: #4b3955 !important;
  color: #f1f5f9 !important;
}

/* ========================================================
   THREADED COMMENTS & LIKE BUTTON STYLES
   ======================================================== */
.comment-item {
  padding: 14px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fb7185, #f43f5e);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.comment-reply-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 10.5px;
  flex-shrink: 0;
}
.comment-like-btn {
  background: none;
  border: none;
  padding: 2px 6px;
  border-radius: 12px;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  transition: all 0.2s;
}
.comment-like-btn:hover {
  background: rgba(244, 63, 94, 0.08);
  color: #e11d48;
}
.comment-like-btn.liked {
  color: #e11d48;
  font-weight: 600;
}
.comment-reply-btn {
  background: none;
  border: none;
  padding: 2px 6px;
  border-radius: 12px;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
}
.comment-reply-btn:hover {
  background: rgba(0, 111, 72, 0.08);
}
.comment-replies {
  margin-top: 10px;
  margin-left: 14px;
  padding-left: 12px;
  border-left: 2px solid rgba(0, 0, 0, 0.08);
}
.reply-item {
  padding: 8px 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
}
.reply-item:last-child {
  border-bottom: none;
}
.sub-comment-form {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.02);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/* Dark Mode - Fresh Update Grid */
body.global-dark .fresh-card {
  background: #1e2028;
  border-color: #2e323e;
}
body.global-dark .fresh-title {
  color: #f1f5f9;
}
body.global-dark .fresh-focus {
  color: #fda4af;
}
body.global-dark .fresh-action {
  border-top-color: #2e323e;
}
body.global-dark .fresh-author-name {
  color: #94a3b8;
}
body.global-dark .fresh-read-btn {
  background: #381a24;
  color: #fda4af;
}
body.global-dark .fresh-read-btn:hover {
  background: #e11d48;
  color: #ffffff !important;
}
body.global-dark .section-subtitle {
  color: #94a3b8;
}


