/* ==========================================================================
   TruyệnHub — Design System "Thư Các Tiểu Thư" (Editorial Coral & Blush Silk)
   Mobile-first, tactile 3D bookbinding craft, zero generic grids
   ========================================================================== */

:root {
  /* Bảng màu thương hiệu: Cam san hô ấm + Lụa hồng phấn + Hoàng kim cổ điển */
  --coral-50: #fff3ef;
  --coral-100: #fde3db;
  --coral-300: #f39d88;
  --coral-500: #e56247;
  --coral-600: #cf4d34;
  --coral-700: #ae3b26;
  --pink-50: #fff6f8;
  --pink-100: #fce7ed;
  --pink-200: #f6c4d0;
  --pink-300: #eea3b5;
  --rose-500: #e27e96;
  --rose-600: #c95d78;
  --gold-100: #fcf2da;
  --gold-300: #e8cc88;
  --gold-500: #c79d42;
  --gold-600: #9d7724;
  --mint-100: #dcf4e8;
  --mint-700: #267f63;
  --peach-100: #ffebd6;
  --peach-700: #be5d26;

  /* Nền giấy trà ngà ấm & mực tím trầm */
  --ivory: #fcf6f1;
  --paper: #fffdfb;
  --line: #efe0d9;
  --line-strong: #e3cbc1;
  --ink: #341f29;
  --ink-2: #5b424e;
  --muted: #8b727d;
  --white: #ffffff;

  /* Gradient & đổ bóng tinh tế */
  --grad-primary: linear-gradient(135deg, #ee7458 0%, #e56247 42%, #df7692 100%);
  --grad-soft: linear-gradient(155deg, #fff6f2 0%, #fdeaf0 100%);
  --grad-gold: linear-gradient(135deg, #f8e5b4 0%, #dbb35c 52%, #b8892e 100%);
  --shadow-sm: 0 1px 3px rgba(96, 38, 56, 0.05), 0 4px 12px rgba(214, 111, 136, 0.07);
  --shadow-md: 0 10px 28px rgba(168, 72, 96, 0.13);
  --shadow-lg: 0 20px 48px rgba(140, 52, 76, 0.18);
  --shadow-btn: 0 8px 20px -6px rgba(229, 98, 71, 0.52);

  /* Kiểu chữ văn chương */
  --font-display: 'Lora', 'Palatino Linotype', 'Times New Roman', serif;
  --font-body: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Kích thước */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --header-h: 62px;
  --bottom-nav-h: 64px;
  --container: 1220px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; max-width: 100%; overflow-x: clip; }
body {
  margin: 0;
  max-width: 100%;
  overflow-x: clip;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.56;
  color: var(--ink);
  background-color: var(--ivory);
  background-image:
    radial-gradient(1100px 480px at 105% -6%, rgba(246, 196, 208, 0.36), transparent 62%),
    radial-gradient(900px 420px at -8% 2%, rgba(253, 227, 219, 0.48), transparent 60%),
    radial-gradient(800px 500px at 50% 48%, rgba(255, 240, 244, 0.4), transparent 70%);
  background-repeat: no-repeat;
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom));
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.24; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--coral-500); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.serif { font-family: var(--font-display); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
@media (max-width: 1023.98px) {
  .hide-mobile { display: none !important; }
}
main { min-height: 60vh; }

/* ---------- Buttons & Icons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: var(--radius-pill);
  border: 1.5px solid transparent; font-weight: 600; font-size: 14.5px; white-space: nowrap;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s, color 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--grad-primary); color: #fff; box-shadow: var(--shadow-btn); }
.btn-primary:hover { box-shadow: 0 12px 26px -8px rgba(229, 98, 71, 0.68); transform: translateY(-1px); }
.btn-outline { background: var(--white); border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--coral-300); color: var(--coral-600); background: #fffaf8; }
.btn-soft { background: var(--coral-50); color: var(--coral-600); border-color: rgba(243, 157, 136, 0.32); }
.btn-soft:hover { background: var(--coral-100); }
.btn-gold { background: var(--grad-gold); color: #442f09; box-shadow: 0 8px 20px -8px rgba(185, 140, 52, 0.58); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--pink-50); color: var(--coral-600); }
.btn-block { width: 100%; }
.btn-lg { min-height: 50px; font-size: 15.5px; padding: 0 24px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn[disabled], .btn.is-loading { opacity: 0.6; pointer-events: none; }
.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 16px; height: 16px; }
.icon-xs { width: 13px; height: 13px; }

/* ---------- Chips / Tags / Badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.88); border: 1px solid var(--line-strong);
  font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
  box-shadow: 0 1px 2px rgba(96, 38, 56, 0.03);
  transition: all 0.2s var(--ease);
}
.chip:hover, .chip.is-active { border-color: var(--coral-300); color: var(--coral-600); background: var(--coral-50); transform: translateY(-1px); }
.chip.is-active { font-weight: 600; }
.tag { color: var(--rose-600); font-weight: 500; font-size: 13.5px; }
.tag:hover { color: var(--coral-600); text-decoration: underline; }
.tag-pill {
  display: inline-flex; align-items: center; height: 29px; padding: 0 12px;
  border-radius: var(--radius-pill); border: 1px solid var(--pink-200);
  background: var(--pink-50); color: var(--rose-600); font-size: 13px; font-weight: 500;
  transition: all 0.2s var(--ease);
}
.tag-pill:hover { background: var(--pink-100); border-color: var(--pink-300); transform: translateY(-1px); }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700; white-space: nowrap; letter-spacing: 0.01em; }
.badge-full { background: var(--mint-100); color: var(--mint-700); }
.badge-ongoing { background: var(--peach-100); color: var(--peach-700); }
.badge-hot { background: var(--grad-primary); color: #fff; box-shadow: 0 2px 6px rgba(229, 98, 71, 0.35); }
.badge-vip { background: var(--grad-gold); color: #462f08; }
.badge-free { background: var(--pink-100); color: var(--rose-600); }

/* ---------- Top Salon Strip & Header ---------- */
.salon-strip {
  background: linear-gradient(90deg, #f9eae4 0%, #fbe9ef 50%, #f9eae4 100%);
  border-bottom: 1px solid rgba(224, 194, 202, 0.65);
  font-size: 12.5px;
  color: var(--ink-2);
}
.salon-strip-inner { height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.salon-motto { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--ink-2); }
.salon-motto .icon { color: var(--coral-500); }
.salon-links { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.salon-links a:hover { color: var(--coral-600); }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(252, 246, 241, 0.88);
  backdrop-filter: saturate(170%) blur(16px); -webkit-backdrop-filter: saturate(170%) blur(16px);
  border-bottom: 1px solid rgba(232, 212, 204, 0.85);
  transition: transform 0.3s var(--ease);
}
.site-header.is-hidden { transform: translateY(-100%); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); flex: none; }
.logo-crest { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 4px 10px rgba(229, 98, 71, 0.25)); }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-word { display: inline-flex; align-items: flex-start; font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.logo-word b { color: var(--coral-500); font-weight: 700; }
.logo-word svg { width: 19px; height: 19px; margin: -5px 0 0 -2px; transform: rotate(14deg); }
.logo-tag { font-family: var(--font-body); font-size: 9px; font-weight: 700; letter-spacing: 0.2em; color: var(--rose-600); margin-top: 2px; }

.main-nav { display: none; }
.header-search { display: none !important; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.coin-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 8px 0 9px; border-radius: var(--radius-pill);
  background: var(--grad-primary); color: #fff; font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow-btn);
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.coin-pill .coin { width: 21px; height: 21px; }
.coin-pill .plus { width: 21px; height: 21px; border-radius: 50%; background: rgba(255, 255, 255, 0.26); display: grid; place-items: center; font-size: 15px; line-height: 1; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--pink-100); border: 2px solid #fff; box-shadow: var(--shadow-sm); display: grid; place-items: center; font-weight: 700; color: var(--rose-600); font-size: 15px; overflow: hidden; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: transparent; border: 0; color: var(--ink-2); transition: background 0.2s, color 0.2s; }
.icon-btn:hover { background: var(--pink-50); color: var(--coral-600); }

/* Dropdown thể loại (desktop) */
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 12px;
  border-radius: var(--radius-pill); font-weight: 600; font-size: 14px; white-space: nowrap;
  color: var(--ink-2); transition: all 0.2s var(--ease);
}
.nav-link:hover, .nav-link.is-active { color: var(--coral-600); background: rgba(229, 98, 71, 0.09); }
.mega {
  position: absolute; top: calc(100% + 8px); left: -12px; width: 540px; padding: 16px;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: all 0.22s var(--ease);
}
.nav-item:hover .mega, .nav-item:focus-within .mega { opacity: 1; visibility: visible; transform: none; }
.mega a { display: flex; align-items: center; justify-content: space-between; padding: 8px 11px; border-radius: 10px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.mega a small { font-size: 11px; color: var(--rose-600); background: var(--pink-50); padding: 1px 7px; border-radius: 99px; font-weight: 600; }
.mega a:hover { background: var(--pink-50); color: var(--coral-600); }

/* ---------- Search ---------- */
.search-box { position: relative; display: flex; align-items: center; }
.search-box input {
  width: 100%; height: 45px; padding: 0 16px 0 42px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--line-strong); background: rgba(255, 255, 255, 0.92); font-size: 15.5px; outline: none;
  box-shadow: inset 0 1px 2px rgba(96, 38, 56, 0.03);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.search-box input:focus { background: #fff; border-color: var(--coral-300); box-shadow: 0 0 0 4px rgba(229, 98, 71, 0.11); }
.search-box .icon { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.mobile-search { padding: 4px 0 8px; }

/* Instant Search Dropdown (Hybrid Meilisearch / D1) */
.instant-search-drop {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 95;
  min-width: 280px; max-height: 420px; overflow-y: auto;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 6px;
}
.instant-search-drop .is-item {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 11px;
  transition: background 0.16s;
}
.instant-search-drop .is-item:hover { background: var(--pink-50); }
.instant-search-drop .is-item img { width: 38px; height: 52px; border-radius: 6px; object-fit: cover; flex: none; background: var(--line); }
.instant-search-drop .is-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.instant-search-drop .is-meta strong { font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.instant-search-drop .is-meta small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.instant-search-drop .is-all {
  display: block; text-align: center; padding: 9px 10px; margin-top: 4px;
  border-top: 1px dashed var(--line); font-size: 13px; font-weight: 600; color: var(--coral-600);
}

/* Thanh thông báo khi xem thử giao diện Trạm Nhân Bản trên staging */
.tenant-preview-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 7px 16px; background: linear-gradient(90deg, #0b1324, #172748);
  color: #f4c86a; font-size: 12.5px; border-bottom: 1px solid rgba(244, 200, 106, 0.35);
}
.tenant-preview-bar code { color: #7dd3fc; font-weight: 600; }
.tenant-preview-bar a { color: #fff; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: rgba(244, 200, 106, 0.18); border: 1px solid rgba(244, 200, 106, 0.4); }
.tenant-preview-bar a:hover { background: rgba(244, 200, 106, 0.32); }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(255, 253, 251, 0.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-bottom);
  box-shadow: 0 -6px 24px rgba(168, 72, 96, 0.08);
}
.bottom-nav ul { list-style: none; margin: 0 auto; padding: 6px 6px; display: grid; grid-template-columns: repeat(5, 1fr); max-width: 560px; }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px; border-radius: 16px; font-size: 11px; font-weight: 600; color: var(--muted); -webkit-tap-highlight-color: transparent; }
.bottom-nav a .icon { width: 22px; height: 22px; }
.bottom-nav a.is-active { color: var(--coral-600); }
.bottom-nav a.is-active .nav-ico { background: var(--grad-primary); color: #fff; box-shadow: var(--shadow-btn); }
.bottom-nav .nav-ico { width: 46px; height: 29px; border-radius: 15px; display: grid; place-items: center; transition: all 0.25s var(--ease); }

/* ---------- Editorial Section Headings ---------- */
.section { padding: 24px 0 6px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-heading { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.section-eyebrow {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-body); font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--rose-600);
}
.section-eyebrow .icon { color: var(--coral-500); }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 700; color: var(--ink); }
.section-title .sprig { width: 42px; height: 21px; color: var(--rose-500); opacity: 0.8; flex: none; }
.section-more {
  font-size: 13.5px; font-weight: 600; color: var(--coral-600);
  display: inline-flex; align-items: center; gap: 2px; white-space: nowrap;
  padding: 5px 11px; border-radius: var(--radius-pill); background: rgba(229, 98, 71, 0.08);
  transition: background 0.2s, transform 0.2s;
}
.section-more:hover { background: rgba(229, 98, 71, 0.15); transform: translateX(2px); }

/* ---------- Hero Editorial Stage ---------- */
.hero { padding-top: 12px; }
.slider { position: relative; }
.slides { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px 6px; }
.slides::-webkit-scrollbar { display: none; }
.slide {
  position: relative; flex: 0 0 93%; scroll-snap-align: center; border-radius: 24px; overflow: hidden;
  min-height: 228px; display: flex; align-items: center; color: #fff; background: #3f1d2b;
  box-shadow: 0 16px 38px rgba(74, 24, 44, 0.24); isolation: isolate;
}
.slide-bg { position: absolute; inset: -28px; z-index: -2; background-size: cover; background-position: center; filter: blur(26px) saturate(145%); opacity: 0.68; transform: scale(1.12); transition: transform 6s ease; }
.slide:hover .slide-bg { transform: scale(1.18); }
.slide::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 86% 18%, rgba(255, 222, 232, 0.26), transparent 48%),
    radial-gradient(circle at 18% 85%, rgba(238, 116, 88, 0.22), transparent 45%),
    linear-gradient(118deg, rgba(42, 18, 29, 0.92) 0%, rgba(74, 31, 49, 0.84) 55%, rgba(114, 48, 69, 0.72) 100%);
}
.slide-frame {
  position: absolute; inset: 9px; z-index: 0; pointer-events: none;
  border: 1px solid rgba(255, 236, 228, 0.22); border-radius: 17px;
}
.slide-body { position: relative; z-index: 1; padding: 20px; width: 100%; display: flex; gap: 16px; align-items: center; }
.slide-cover-wrap { flex: none; display: block; position: relative; }
.slide-cover {
  width: 90px; aspect-ratio: 2/3; border-radius: 4px 10px 10px 4px; object-fit: cover;
  background: var(--pink-100);
  box-shadow: 3px 3px 0 rgba(255, 248, 242, 0.88), 5px 5px 0 rgba(40, 14, 24, 0.35), 0 14px 28px rgba(12, 4, 8, 0.45);
}
.slide-text { flex: 1; min-width: 0; }
.slide-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 7px; }
.eyebrow-pill {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px;
  border-radius: var(--radius-pill); background: rgba(255, 243, 214, 0.16);
  border: 1px solid rgba(255, 232, 184, 0.38); color: #ffe9b5;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
}
.slide-title { font-size: 19.5px; font-weight: 700; line-height: 1.28; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slide-author { font-size: 12.5px; color: rgba(255, 238, 242, 0.85); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slide-author b { color: #fff; font-weight: 600; }
.slide-desc { display: none; }
.slide-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.slide-meta .tag-pill { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.3); color: #fff; backdrop-filter: blur(6px); height: 25px; font-size: 11.5px; }
.slide-actions { display: flex; gap: 8px; margin-top: 11px; }
.slide-actions .btn { min-height: 36px; padding: 0 15px; font-size: 13px; }
.slide-actions .btn-outline { display: none; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 8px; background: var(--pink-200); transition: all 0.3s var(--ease); }
.dots button.is-active { width: 26px; background: var(--grad-primary); }
.petals { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; border-radius: 24px; }
.petal { position: absolute; top: -20px; width: 11px; height: 9px; background: radial-gradient(circle at 30% 30%, #ffe4ec, #f29eb3); border-radius: 12px 1px 12px 1px; opacity: 0.78; animation: fall linear infinite; }
@keyframes fall { to { transform: translate3d(-60px, 360px, 0) rotate(300deg); opacity: 0; } }

/* ---------- Category chips row ---------- */
.chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
.chip-row::-webkit-scrollbar { display: none; }

/* ---------- Physical 3D Hardcover Book Card ---------- */
.book-row { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin: 0 -16px; padding: 6px 16px 14px; }
.book-row::-webkit-scrollbar { display: none; }
.book-row > .book { flex: 0 0 32%; min-width: 112px; max-width: 154px; scroll-snap-align: start; }
.book-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 13px; }
.book { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.book-cover {
  position: relative; aspect-ratio: 2 / 3;
  border-radius: 4px 12px 12px 4px;
  overflow: hidden; background: var(--pink-100);
  box-shadow:
    2px 2px 0 #f6ece5,
    3px 3px 0 #e4cfc5,
    0 8px 18px rgba(124, 52, 72, 0.13);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
/* Nếp gấp gáy sách đóng bìa cứng chân thực */
.book-cover::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,0.34) 0%, rgba(42,16,26,0.2) 3.6%, rgba(255,255,255,0.26) 5.8%, rgba(42,16,26,0.04) 8.5%, transparent 14%);
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book:hover .book-cover {
  transform: translateY(-5px) rotate(-0.5deg);
  box-shadow:
    3px 4px 0 #f6ece5,
    5px 6px 0 #dfc7bc,
    0 16px 30px rgba(156, 62, 86, 0.22);
}
.book-cover .badges { position: absolute; left: 7px; bottom: 7px; z-index: 2; display: flex; gap: 4px; flex-wrap: wrap; }
.book-cover .badges .badge { box-shadow: 0 2px 6px rgba(34, 14, 22, 0.16); backdrop-filter: blur(4px); }
/* Dải lụa đánh dấu trang mạ vàng cho truyện VIP */
.vip-mark {
  position: absolute; top: 0; right: 9px; z-index: 2;
  padding: 5px 7px 9px;
  background: var(--grad-gold); color: #462f08;
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; line-height: 1;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 79%, 0 100%);
  filter: drop-shadow(0 3px 5px rgba(84, 52, 10, 0.28));
}
.hot-flag { position: absolute; top: 7px; left: 8px; z-index: 2; }
.book-title { font-family: var(--font-display); font-size: 14.5px; font-weight: 700; line-height: 1.34; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book:hover .book-title { color: var(--coral-600); }
.book-sub { font-size: 12px; color: var(--muted); margin-top: -3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Curated VIP Salon Showcase ---------- */
.vip-salon {
  position: relative;
  padding: 20px 16px;
  border-radius: 24px;
  background: linear-gradient(145deg, #fff8f4 0%, #fdecef 52%, #fdf4e8 100%);
  border: 1px solid #efd0d8;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.68), var(--shadow-md);
}
.salon-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.salon-lead {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(235, 204, 212, 0.8);
  box-shadow: var(--shadow-sm);
}
.salon-lead-cover { width: 104px; flex: none; }
.salon-lead-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.salon-kicker {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 9px; border-radius: var(--radius-pill);
  background: var(--gold-100); border: 1px solid var(--gold-300);
  color: var(--gold-600); font-size: 11px; font-weight: 700;
}
.salon-lead-title { font-size: 18px; font-weight: 700; line-height: 1.3; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.salon-lead-title a:hover { color: var(--coral-600); }
.salon-lead-by { font-size: 12.5px; color: var(--muted); }
.salon-lead-by a { color: var(--coral-600); font-weight: 600; }
.salon-lead-desc { font-size: 13.5px; color: var(--ink-2); line-height: 1.58; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.salon-lead-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.salon-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.salon-card {
  display: flex; gap: 12px; align-items: center;
  padding: 11px 12px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(235, 208, 215, 0.75);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, border-color 0.25s;
  min-width: 0;
}
.salon-card:hover { background: #fff; border-color: var(--coral-300); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.salon-card-cover { width: 62px; flex: none; }
.salon-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.salon-card-badges { display: flex; align-items: center; gap: 6px; }
.salon-card-stat { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.salon-card-title { font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.salon-card:hover .salon-card-title { color: var(--coral-600); }
.salon-card-sub { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.salon-card-foot { font-size: 12px; color: var(--rose-600); font-weight: 500; display: flex; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Panels & Crowned Ranking Podium ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 16px; position: relative; }
.panel-lace::before {
  content: ''; position: absolute; inset: -5px; border-radius: calc(var(--radius-lg) + 5px); z-index: -1;
  background: radial-gradient(circle, var(--pink-200) 2px, transparent 2.6px) 0 0 / 9px 9px;
  -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  padding: 5px;
}
.panel-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.panel-title { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.tabs { display: flex; gap: 4px; background: var(--pink-50); padding: 4px; border-radius: var(--radius-pill); margin-bottom: 10px; border: 1px solid var(--pink-100); }
.tabs button, .tab-link { flex: 1; height: 33px; border: 0; border-radius: var(--radius-pill); background: transparent; font-size: 13px; font-weight: 600; color: var(--muted); display: grid; place-items: center; transition: all 0.2s; }
.tabs button.is-active, .is-active-tab { background: var(--white); color: var(--coral-600); box-shadow: var(--shadow-sm); }

.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rank-item { display: flex; align-items: center; gap: 11px; padding: 7px 6px; border-radius: 13px; transition: background 0.2s; min-width: 0; }
.rank-item:hover { background: var(--pink-50); }
.rank-no { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--muted); background: #f8eef1; }
.rank-item.is-top1 {
  background: linear-gradient(135deg, #fff7f0 0%, #fde9ef 100%);
  border: 1px solid #f2cbd6;
  padding: 10px 10px; margin-bottom: 4px; border-radius: 16px;
}
.rank-item.is-top1 .rank-no { background: var(--grad-gold); color: #462f08; box-shadow: 0 3px 8px rgba(185, 140, 52, 0.35); }
.rank-item.is-top2 .rank-no { background: #fce2e8; color: var(--rose-600); }
.rank-item.is-top3 .rank-no { background: #fde6dc; color: var(--coral-600); }
.rank-cover { width: 42px; height: 62px; flex: none; border-radius: 3px 8px 8px 3px; object-fit: cover; background: var(--pink-100); box-shadow: 2px 2px 6px rgba(96, 38, 56, 0.14); }
.rank-item.is-top1 .rank-cover { width: 54px; height: 80px; }
.rank-info { min-width: 0; flex: 1; }
.rank-crown { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold-600); margin-bottom: 2px; }
.rank-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.rank-item.is-top1 .rank-title { font-family: var(--font-display); font-size: 15.5px; font-weight: 700; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rank-author { font-size: 12px; color: var(--ink-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-meta { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Editorial Update Ledger & Genre Cabinet ---------- */
.ledger-panel { padding: 4px 16px; }
.update-list { list-style: none; margin: 0; padding: 0; }
.update-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line-strong); align-items: center; min-width: 0; }
.update-item:last-child { border-bottom: 0; }
.update-thumb { flex: none; }
.update-cover { width: 50px; height: 74px; border-radius: 3px 8px 8px 3px; object-fit: cover; background: var(--pink-100); box-shadow: 2px 2px 6px rgba(96, 38, 56, 0.12); }
.update-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.update-top { display: flex; align-items: center; gap: 6px; }
.update-cat { font-size: 11.5px; font-weight: 600; color: var(--rose-600); background: var(--pink-50); padding: 1px 8px; border-radius: var(--radius-pill); }
.update-title { display: block; font-family: var(--font-display); font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.update-title:hover { color: var(--coral-600); }
.update-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.update-meta .dot::before { content: '·'; }
.update-chap {
  flex: none; display: inline-flex; align-items: center; gap: 2px;
  height: 30px; padding: 0 11px; border-radius: var(--radius-pill);
  background: var(--coral-50); border: 1px solid rgba(243, 157, 136, 0.4);
  color: var(--coral-600); font-size: 12.5px; font-weight: 700; white-space: nowrap;
  transition: all 0.2s;
}
.update-chap:hover { background: var(--grad-primary); color: #fff; border-color: transparent; }

.genre-cabinet { background: linear-gradient(165deg, #fffdfb 0%, #fff4f7 100%); }
.genre-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.genre-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px;
  border-radius: var(--radius-pill); background: #fff; border: 1px solid var(--line-strong);
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  transition: all 0.2s var(--ease);
}
.genre-pill b { font-size: 11px; font-weight: 700; color: var(--rose-600); background: var(--pink-50); padding: 1px 7px; border-radius: 99px; }
.genre-pill:hover { border-color: var(--coral-300); color: var(--coral-600); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* ---------- Story Detail Page ---------- */
.story-hero { position: relative; overflow: hidden; padding: 20px 0 6px; isolation: isolate; }
.story-hero-bg { position: absolute; inset: -40px; z-index: -2; background-size: cover; background-position: center; filter: blur(38px) saturate(135%); opacity: 0.48; }
.story-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(255, 236, 241, 0.36) 0%, var(--ivory) 82%); }
.story-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.story-cover { width: 174px; position: relative; }
.story-cover .is-edition {
  border-radius: 5px 15px 15px 5px;
  box-shadow:
    4px 4px 0 #f8efe9,
    7px 7px 0 #e4cfc5,
    0 22px 44px rgba(108, 40, 60, 0.24);
}
.story-kicker { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.story-title { font-size: 27px; font-weight: 700; line-height: 1.26; }
.story-byline { font-size: 14px; color: var(--ink-2); }
.story-byline a { color: var(--coral-600); font-weight: 600; }
.story-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; align-items: center; font-size: 13.5px; color: var(--ink-2); }
.stat-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.85); border: 1px solid var(--line-strong); font-weight: 500; }
.stat-chip b { color: var(--ink); }
.stars { color: #e8a72c; letter-spacing: 1px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px 8px; justify-content: center; }

.cta-card { margin-top: 8px; padding: 18px; display: flex; flex-direction: column; gap: 11px; width: 100%; }
.ticket-card {
  background: linear-gradient(155deg, #fffdf9 0%, #fff4f6 100%);
  border: 1px solid #eccad3;
}
.cta-combo { position: relative; }
.save-badge { position: absolute; top: -11px; right: 16px; z-index: 2; background: var(--gold-100); color: var(--gold-600); border: 1px solid var(--gold-300); box-shadow: 0 3px 8px rgba(185, 140, 52, 0.22); font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: var(--radius-pill); }
.cta-row { display: flex; gap: 10px; align-items: center; }
.cta-row .btn { flex: 1; }
.cta-sub-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; padding-top: 6px; border-top: 1px dashed var(--line-strong); }
.owned-note { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--mint-700); font-weight: 600; font-size: 14px; }
.note-box { display: flex; gap: 10px; padding: 12px 15px; border-radius: var(--radius); background: rgba(255, 246, 248, 0.9); border: 1px solid var(--pink-200); color: var(--ink-2); font-size: 13.5px; line-height: 1.52; text-align: left; }
.note-box .icon { color: var(--rose-500); margin-top: 1px; }

.synopsis-box { padding: 20px 20px 16px; }
.desc { position: relative; color: var(--ink-2); font-size: 15.5px; line-height: 1.82; white-space: pre-line; }
.desc::first-letter { font-family: var(--font-display); font-size: 2.35em; font-weight: 700; line-height: 0.9; float: left; padding: 3px 9px 0 0; color: var(--coral-600); }
.desc.is-clamped { max-height: 9.8em; overflow: hidden; }
.desc.is-clamped::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3.2em; background: linear-gradient(transparent, var(--paper)); }
.link-btn { background: none; border: 0; color: var(--coral-600); font-weight: 600; padding: 8px 0 0; font-size: 14px; }

.toc-panel { padding: 16px; }
.chapter-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.chapter-tools input { flex: 1; height: 40px; border-radius: var(--radius-pill); border: 1.5px solid var(--line-strong); padding: 0 14px; background: var(--ivory); font-size: 14.5px; min-width: 0; outline: none; }
.chapter-tools input:focus { background: #fff; border-color: var(--coral-300); }
.chapter-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.chapter-list li { min-width: 0; }
.chapter-list a { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 8px; border-bottom: 1px dashed var(--line); font-size: 14.5px; min-width: 0; border-radius: 10px; transition: background 0.18s, color 0.18s; }
.chapter-list a:hover { color: var(--coral-600); background: var(--pink-50); }
.ch-idx { flex: none; font-family: var(--font-display); font-size: 12.5px; font-weight: 700; color: var(--rose-600); background: var(--pink-50); min-width: 28px; height: 22px; padding: 0 6px; border-radius: 6px; display: grid; place-items: center; }
.chapter-list .ch-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.chapter-list .ch-lock { display: inline-flex; align-items: center; gap: 4px; color: #543a0a; background: var(--gold-100); border: 1px solid var(--gold-300); height: 23px; padding: 0 8px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; white-space: nowrap; }
.chapter-list .ch-owned { color: var(--mint-700); font-size: 13px; font-weight: 600; }
.chapter-list a.is-read { color: var(--muted); }
.chapter-list a.is-read .ch-idx { color: var(--muted); background: #f3ece9; }

.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: calc(var(--bottom-nav-h) + var(--safe-bottom)); z-index: 55; padding: 10px 16px;
  background: linear-gradient(180deg, rgba(252, 246, 241, 0) 0%, rgba(252, 246, 241, 0.96) 30%); transform: translateY(120%); transition: transform 0.3s var(--ease);
}
.sticky-cta.is-visible { transform: none; }
.sticky-cta .inner { display: flex; gap: 8px; max-width: 560px; margin: 0 auto; }
.sticky-cta .btn-outline { flex: 0 0 auto; }
.sticky-cta .btn-primary { flex: 1; }

/* ---------- Listing / Filter / Categories ---------- */
.page-head { padding: 20px 0 8px; }
.page-title { font-size: 27px; font-weight: 700; margin-top: 2px; }
.page-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a:hover { color: var(--coral-600); }
.breadcrumb span + span::before, .breadcrumb a + span::before, .breadcrumb a + a::before { content: '›'; margin-right: 6px; color: var(--pink-300); }

.filter-shell {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin: 12px 0 18px; padding: 10px 14px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm);
}
.filter-bar { display: flex; gap: 8px; align-items: center; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; margin-right: 2px; }
.filter-count { font-size: 13px; font-weight: 600; color: var(--rose-600); background: var(--pink-50); padding: 4px 11px; border-radius: var(--radius-pill); white-space: nowrap; }
.select {
  flex: none; cursor: pointer; height: 36px; border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong); background: var(--ivory); padding: 0 28px 0 13px;
  font-size: 13.5px; font-weight: 500; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c95d78' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.select:hover { border-color: var(--coral-300); background-color: #fff; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty svg { width: 80px; height: 80px; margin: 0 auto 12px; color: var(--pink-300); }
.pagination { display: flex; justify-content: center; gap: 6px; margin: 24px 0 8px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 14px; padding: 0 10px; }
.pagination a:hover { border-color: var(--coral-300); color: var(--coral-600); }
.pagination .is-current { background: var(--grad-primary); color: #fff; border-color: transparent; box-shadow: var(--shadow-btn); }

.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-top: 12px; }
.cat-tile {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
  padding: 16px 16px 14px; border-radius: 18px;
  background: linear-gradient(160deg, #fffdfb 0%, #fff5f7 100%);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm);
  transition: all 0.25s var(--ease);
}
.cat-tile:hover { border-color: var(--coral-300); transform: translateY(-3px); box-shadow: var(--shadow-md); background: var(--grad-soft); }
.cat-ord { position: absolute; top: 8px; right: 12px; font-family: var(--font-display); font-size: 24px; font-weight: 700; font-style: italic; color: var(--pink-200); opacity: 0.7; line-height: 1; }
.cat-name { font-size: 18px; font-weight: 700; color: var(--ink); padding-right: 26px; }
.cat-count { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 600; color: var(--rose-600); }

/* ---------- Bottom Sheet & Modal ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(52, 31, 41, 0.44); opacity: 0; visibility: hidden; transition: all 0.25s var(--ease); backdrop-filter: blur(2px); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 91; max-height: 88vh; overflow-y: auto;
  background: var(--paper); border-radius: 24px 24px 0 0; padding: 10px 18px calc(20px + var(--safe-bottom));
  transform: translateY(105%); transition: transform 0.35s var(--ease); box-shadow: 0 -12px 40px rgba(122, 52, 70, 0.22);
}
.sheet::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 5px; background: var(--line-strong); margin: 0 auto 12px; }
.sheet.is-open { transform: none; }
.sheet.is-open + .sheet-backdrop, .sheet-backdrop.is-open { opacity: 1; visibility: visible; }
.sheet-title { font-size: 22px; font-weight: 700; text-align: center; }
.sheet-sub { text-align: center; color: var(--muted); font-size: 14px; margin-top: 2px; }
.lace-top { position: relative; }
.lace-top::after { content: ''; position: absolute; left: 0; right: 0; top: -9px; height: 10px; background: radial-gradient(circle at 6px 10px, var(--paper) 6px, transparent 6.5px) 0 0 / 12px 10px repeat-x; }
.option-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 54px; padding: 0 2px; border-bottom: 1px solid var(--line); }
.option-row:last-child { border-bottom: 0; }
.combo-card { border: 1.5px solid var(--gold-300); background: linear-gradient(135deg, #fffaf0, #fdf1dc); border-radius: var(--radius); padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.combo-card strong { font-size: 16px; }
.combo-card small { display: block; color: var(--gold-600); font-weight: 600; font-size: 13px; }
.alert { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 500; }
.alert-warn { background: var(--coral-50); color: var(--coral-700); }
.alert-ok { background: var(--mint-100); color: var(--mint-700); }
.alert-info { background: var(--pink-50); color: var(--ink-2); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 30px; background: var(--line-strong); transition: background 0.2s; }
.switch span::before { content: ''; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.15); transition: transform 0.25s var(--ease); }
.switch input:checked + span { background: var(--coral-500); }
.switch input:checked + span::before { transform: translateX(20px); }

/* ---------- Forms ---------- */
.auth-wrap { max-width: 440px; margin: 0 auto; padding: 28px 16px 40px; }
.auth-card { padding: 28px 22px; }
.auth-title { font-size: 28px; text-align: center; }
.auth-sub { text-align: center; color: var(--muted); margin: 6px 0 20px; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.input, .textarea { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: #fff; font-size: 16px; outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.textarea { padding: 12px 14px; min-height: 120px; resize: vertical; line-height: 1.6; }
.input:focus, .textarea:focus { border-color: var(--coral-300); box-shadow: 0 0 0 4px rgba(229, 98, 71, 0.1); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line-strong); }
.btn-google { background: #fff; border: 1.5px solid var(--line-strong); color: var(--ink); }
.btn-google:hover { border-color: var(--pink-300); }
.form-foot { text-align: center; font-size: 14px; margin-top: 16px; color: var(--muted); }
.form-foot a { color: var(--coral-600); font-weight: 600; }
.form-error { margin-bottom: 14px; }

/* ---------- Wallet / Topup ---------- */
.balance-card { position: relative; overflow: hidden; padding: 22px; border-radius: var(--radius-lg); background: linear-gradient(135deg, #fde3e9 0%, #fbd0da 50%, #f8c9bd 100%); border: 1px solid #f2bdc9; box-shadow: var(--shadow-md); }
.balance-card .label { font-size: 14px; color: var(--ink-2); }
.balance-card .value { font-family: var(--font-display); font-size: 34px; font-weight: 700; }
.balance-card .coin-big { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); width: 72px; height: 72px; filter: drop-shadow(0 8px 16px rgba(185, 140, 52, 0.4)); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-58%) rotate(-6deg); } }
.pkg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pkg { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 94px; border-radius: var(--radius); border: 1.5px solid var(--line-strong); background: #fff; cursor: pointer; transition: all 0.2s var(--ease); text-align: center; }
.pkg input { position: absolute; opacity: 0; }
.pkg strong { font-family: var(--font-display); font-size: 20px; }
.pkg span { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.pkg:hover { border-color: var(--pink-300); transform: translateY(-2px); }
.pkg:has(input:checked) { border-color: var(--coral-500); background: var(--coral-50); box-shadow: 0 0 0 3px rgba(229, 98, 71, 0.12); }
.pkg .bonus { position: absolute; top: 6px; right: 6px; background: var(--pink-100); color: var(--rose-600); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 8px; }
.pkg .pop { position: absolute; top: 10px; left: -24px; transform: rotate(-45deg); background: var(--grad-primary); color: #fff; font-size: 10px; font-weight: 700; width: 90px; text-align: center; padding: 2px 0; }
.qr-card { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 16px; }
.qr-card img { width: 100%; max-width: 260px; margin: 0 auto; border-radius: 12px; border: 1px solid var(--line); }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line-strong); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv b { font-size: 15px; word-break: break-all; text-align: right; }
.copy-btn { border: 0; background: var(--pink-50); color: var(--rose-600); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.copy-btn:hover { background: var(--pink-100); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; }
.status-pending { background: var(--peach-100); color: var(--peach-700); }
.status-approved, .status-paid { background: var(--mint-100); color: var(--mint-700); }
.status-rejected, .status-expired { background: #f3e6ea; color: var(--muted); }

/* ---------- Account ---------- */
.account-head { display: flex; align-items: center; gap: 14px; padding: 18px 0 8px; }
.account-head .avatar { width: 60px; height: 60px; font-size: 24px; }
.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list a, .menu-list button { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 4px; border: 0; background: none; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 500; text-align: left; }
.menu-list a:hover, .menu-list button:hover { color: var(--coral-600); }
.menu-list .icon { color: var(--rose-500); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
.plus-xu { color: var(--mint-700); font-weight: 700; }
.minus-xu { color: var(--coral-600); font-weight: 700; }

/* ---------- Editorial Footer ---------- */
.site-footer {
  margin-top: 48px; padding: 18px 0 28px;
  border-top: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(255, 250, 246, 0.5) 0%, rgba(252, 231, 237, 0.55) 100%);
  font-size: 14px; color: var(--ink-2);
}
.footer-ornament { display: flex; justify-content: center; margin-bottom: 16px; color: var(--rose-500); }
.footer-ornament .fleuron { width: 120px; height: 20px; }
.footer-promises {
  display: grid; grid-template-columns: 1fr; gap: 12px;
  padding: 16px; margin-bottom: 26px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.72); border: 1px solid var(--line);
}
.promise-item { display: flex; align-items: flex-start; gap: 12px; }
.promise-ico { width: 38px; height: 38px; flex: none; border-radius: 12px; background: var(--pink-50); border: 1px solid var(--pink-200); color: var(--coral-600); display: grid; place-items: center; }
.promise-item strong { display: block; font-family: var(--font-display); font-size: 15.5px; color: var(--ink); }
.promise-item p { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.48; }
.footer-grid { display: grid; gap: 22px; }
.footer-grid h3 { font-family: var(--font-body); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--rose-600); margin-bottom: 10px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px 14px; }
.footer-grid a:hover { color: var(--coral-600); }
.copyright { margin-top: 24px; padding-top: 16px; border-top: 1px dashed var(--line-strong); font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: calc(var(--bottom-nav-h) + 16px + var(--safe-bottom)); transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { pointer-events: auto; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: toastIn 0.35s var(--ease); }
.toast.ok { background: #267f63; }
.toast.err { background: var(--coral-700); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Misc ---------- */
.fade-in { animation: fadeIn 0.5s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } }
.grid-2 { display: grid; gap: 16px; }

/* ==========================================================================
   Tablet ≥ 640px
   ========================================================================== */
@media (min-width: 640px) {
  .container { padding: 0 24px; }
  .slides { margin: 0 -24px; padding: 4px 24px 6px; }
  .chip-row, .book-row { margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
  .slide { flex-basis: 82%; min-height: 268px; }
  .slide-cover { width: 112px; }
  .book-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 16px; }
  .book-row > .book { flex-basis: 22%; }
  .vip-salon { padding: 24px 22px; }
  .salon-lead-cover { width: 124px; }
  .salon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .pkg-grid { grid-template-columns: repeat(3, 1fr); }
  .qr-card { grid-template-columns: 240px 1fr; align-items: center; }
  .chapter-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .footer-promises { grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 18px 22px; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

/* ==========================================================================
   Desktop ≥ 1024px
   ========================================================================== */
@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  .bottom-nav, .mobile-search, .sticky-cta { display: none !important; }
  .hide-desktop { display: none !important; }
  :root { --header-h: 74px; }
  .logo-crest { width: 38px; height: 38px; }
  .logo-word { font-size: 25px; }
  .main-nav { display: flex; align-items: center; gap: 2px; margin-left: 14px; }
  .header-search { display: flex !important; flex: 0 1 268px; min-width: 205px; margin-left: auto; }
  .header-search input { height: 40px; padding: 0 14px 0 38px; font-size: 13.5px; }
  .header-search .icon { left: 12px; width: 18px; height: 18px; }
  .header-actions { margin-left: 8px; }
  .coin-pill { height: 40px; padding: 0 9px 0 11px; font-size: 14px; }

  .home-top { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 24px; align-items: stretch; }
  .slides { margin: 0; padding: 0; overflow: hidden; }
  .slide { flex-basis: 100%; min-height: 396px; align-items: center; }
  .slide-frame { inset: 12px; border-radius: 16px; }
  .slide-body { padding: 36px 76px; gap: 30px; justify-content: flex-start; align-items: center; }
  .slide-cover { display: block; width: 162px; border-radius: 5px 14px 14px 5px; }
  .slide-text { flex: 1; min-width: 0; }
  .slide-title { font-size: 29px; line-height: 1.24; }
  .slide-author { font-size: 14px; margin-top: 6px; }
  .slide-desc {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin-top: 10px; font-family: var(--font-display); font-style: italic;
    font-size: 15.5px; color: rgba(255, 245, 247, 0.92); line-height: 1.6;
  }
  .slide-meta .tag-pill { height: 27px; font-size: 12.5px; }
  .slide-actions { display: flex; gap: 10px; margin-top: 16px; }
  .slide-actions .btn { min-height: 44px; padding: 0 20px; font-size: 14.5px; }
  .slide-actions .btn-outline { display: inline-flex; background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.5); backdrop-filter: blur(6px); }
  .slide-actions .btn-outline:hover { background: rgba(255, 255, 255, 0.25); color: #fff; border-color: #fff; }
  .slider-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.6); background: rgba(255, 253, 251, 0.92); box-shadow: var(--shadow-md); display: grid; place-items: center; color: var(--ink); z-index: 3; transition: transform 0.2s, background 0.2s, color 0.2s; }
  .slider-arrow:hover { transform: translateY(-50%) scale(1.08); color: var(--coral-600); background: #fff; }
  .slider-arrow.prev { left: 14px; }
  .slider-arrow.next { right: 14px; }

  .section { padding: 36px 0 8px; }
  .section-title { font-size: 26px; }
  .vip-salon { padding: 28px 28px; border-radius: 28px; }
  .salon-body { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.3fr); gap: 20px; align-items: stretch; }
  .salon-body.is-single { grid-template-columns: minmax(0, 1fr); }
  .salon-lead { padding: 22px; align-items: center; gap: 20px; }
  .salon-lead-cover { width: 148px; }
  .salon-lead-title { font-size: 22px; }
  .salon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .salon-card { padding: 13px 14px; }
  .salon-card-cover { width: 68px; }

  .book-row { overflow: visible; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px; margin: 0; padding: 6px 0 12px; }
  .book-row > .book { min-width: 0; max-width: none; }
  .book-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 28px 22px; }
  .book-title { font-size: 15px; }
  .home-split { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 28px; align-items: start; }

  .story-hero { padding: 38px 0 12px; }
  .story-head { flex-direction: row; align-items: flex-start; text-align: left; gap: 40px; }
  .story-cover { width: 244px; flex: none; }
  .story-kicker, .story-stats, .tag-list { justify-content: flex-start; }
  .story-title { font-size: 35px; line-height: 1.22; }
  .story-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 13px; padding-top: 4px; }
  .cta-card { max-width: 560px; }
  .story-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
  .synopsis-box { padding: 24px 26px 18px; }
  .toc-panel { padding: 20px 22px; }
  .chapter-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 460px; border-radius: 24px; transform: translate(-50%, -46%) scale(0.96); opacity: 0; visibility: hidden; transition: all 0.25s var(--ease); }
  .sheet.is-open { transform: translate(-50%, -50%); opacity: 1; visibility: visible; }
  .sheet::before { display: none; }
  .toast-wrap { bottom: 24px; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .petals { display: none; }
}
