/* Yousuu-VI — "tàng thư các": giấy cũ & chu sa (sáng, mặc định) / mực tàu & đồng cổ (tối) */
:root {
  --ink: #f3ecdb;
  --ink-2: #ebe1cb;
  --surface: #faf6eb;
  --surface-2: #f0e8d5;
  --line: #d8cbae;
  --line-strong: #c0b190;
  --paper: #2f2837;
  --paper-dim: #5d5468;
  --muted: #82798c;
  --faint: #a2977f;
  --cinnabar: #bf3a27;
  --cinnabar-soft: rgba(191, 58, 39, 0.10);
  --brass: #8f6e28;
  --brass-2: #b3893b;
  --ok: #4e7d3c;
  --glow-1: #e9dcc2;
  --glow-2: #efe6d0;
  --ph-fg: #b1a28d;
  --ph-bg-1: #eee5d0;
  --ph-bg-2: #e1d5b9;
  --st-blue: #3d6f96;
  --st-stale: #857a60;
  --mark-fg: #a02e1d;
  --mark-hv: #7c5c1b;
  --tag-on-fg: #8c2f1f;
  --warn-fg: #a53a26;
  --rev-bg: rgba(120, 95, 55, 0.06);
  --rev-hv: #6b5d3c;
  --rev-vi: #4a4133;
  --sh-1: rgba(84, 62, 32, 0.16);
  --sh-2: rgba(84, 62, 32, 0.20);
  --sh-3: rgba(84, 62, 32, 0.26);
  --viz-pos: #2e6aa4; /* nhóm review 4–5★ — cặp diverging với nhóm 1–2★, đã qua CVD check */
  --sans: "Be Vietnam Pro", system-ui, sans-serif;
  --serif-vi: "Lora", Georgia, serif;
  --serif-zh: "Noto Serif SC", "Songti SC", serif;
}
html[data-theme="dark"] {
  --ink: #131017;
  --ink-2: #1a161f;
  --surface: #201b27;
  --surface-2: #272130;
  --line: #322b3c;
  --line-strong: #56495f;
  --paper: #e9e2d3;
  --paper-dim: #b5aca6;
  --muted: #877f93;
  --faint: #6b6377;
  --cinnabar: #d24a38;
  --cinnabar-soft: rgba(210, 74, 56, 0.14);
  --brass: #c9a25e;
  --brass-2: #8a6d3d;
  --ok: #7fb069;
  --glow-1: #2a1e2c;
  --glow-2: #201a2b;
  --ph-fg: #6d6180;
  --ph-bg-1: #2b2437;
  --ph-bg-2: #1d1926;
  --st-blue: #7ea6c9;
  --st-stale: #8a7f6a;
  --mark-fg: #f4c9b8;
  --mark-hv: #e5c98f;
  --tag-on-fg: #f2d9c4;
  --warn-fg: #e0907f;
  --rev-bg: rgba(0, 0, 0, 0.14);
  --rev-hv: #cdbfa4;
  --rev-vi: #d7cbb6;
  --sh-1: rgba(0, 0, 0, 0.35);
  --sh-2: rgba(0, 0, 0, 0.40);
  --sh-3: rgba(0, 0, 0, 0.50);
  --viz-pos: #4f95d1;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body {
  margin: 0; font-family: var(--sans); color: var(--paper);
  background:
    radial-gradient(1100px 500px at 85% -10%, var(--glow-1) 0%, transparent 60%),
    radial-gradient(900px 600px at -15% 20%, var(--glow-2) 0%, transparent 55%),
    var(--ink);
  min-height: 100vh;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.grain {
  position: fixed; inset: 0; pointer-events: none; opacity: .5; z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
.proverb {
  position: fixed; top: 40px; right: 28px; z-index: 0;
  writing-mode: vertical-rl; font-family: var(--serif-zh); font-weight: 700;
  font-size: clamp(40px, 7vw, 92px); color: var(--paper); opacity: .045;
  letter-spacing: .35em; pointer-events: none; user-select: none;
}
main, header.top { position: relative; z-index: 2; }

/* ---------- header ---------- */
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px clamp(16px, 4vw, 40px);
}
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.seal {
  width: 44px; height: 44px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(145deg, #d8503c, #b23225);
  color: #f7edda; font-family: var(--serif-zh); font-size: 26px; font-weight: 700;
  transform: rotate(-3deg);
  box-shadow: 0 4px 18px rgba(210, 74, 56, .35), inset 0 0 0 2px rgba(247, 237, 218, .22);
}
.brand-txt { font-weight: 700; font-size: 20px; letter-spacing: .02em; display: flex; flex-direction: column; line-height: 1.1; }
.brand-txt small { font-family: var(--serif-vi); font-style: italic; font-weight: 400; font-size: 12px; color: var(--muted); }
.top-right { display: flex; gap: 14px; align-items: center; }
.stat-line { font-size: 12.5px; color: var(--muted); }

/* ---------- hero ---------- */
main { max-width: 880px; margin: 0 auto; padding: 0 clamp(14px, 3vw, 24px) 80px; }
.hero { text-align: center; padding: clamp(28px, 6vh, 64px) 0 10px; transition: padding .35s ease; }
.hero h1 {
  font-family: var(--serif-vi); font-weight: 600; font-size: clamp(26px, 4.5vw, 42px);
  margin: 0 0 12px; letter-spacing: .01em; line-height: 1.24;
}
.hero h1 em { font-style: normal; color: var(--cinnabar); }
.hero .sub { max-width: 720px; color: var(--paper-dim); margin: 0 auto 26px; font-size: 14px; line-height: 1.7; }
.hero .sub strong { color: var(--brass); font-weight: 600; }
.hero .sub .accent { color: var(--brass); }
.hero.compact { padding: 8px 0 4px; }
.hero.compact h1, .hero.compact .sub, .hero.compact .examples { display: none; }

.searchwrap { position: relative; max-width: 640px; margin: 0 auto; }
#q {
  width: 100%; font: 500 clamp(17px, 2.4vw, 21px)/1.4 var(--sans);
  color: var(--paper); background: var(--surface);
  border: 1px solid var(--line); border-bottom: 2px solid var(--cinnabar);
  border-radius: 12px 12px 4px 4px; padding: 16px 52px 16px 20px; outline: none;
  transition: box-shadow .2s, border-color .2s;
}
#q:focus { box-shadow: 0 6px 30px rgba(210, 74, 56, .18); border-color: var(--line-strong); }
#q::placeholder { color: var(--faint); }
#q::-webkit-search-cancel-button { -webkit-appearance: none; }
.slash {
  position: absolute; right: 14px; top: 50%; translate: 0 -50%;
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px;
  color: var(--muted); font-size: 13px; background: var(--ink-2);
}
.examples { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; color: var(--muted); font-size: 13px; }
.examples button {
  font: 500 13px var(--sans); color: var(--paper-dim); background: transparent;
  border: 1px dashed var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.examples button:hover { color: var(--cinnabar); border-color: var(--cinnabar); }

/* ---------- toolbar & filters ---------- */
.toolbar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.sorts, .fields { display: flex; gap: 4px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.sorts button, .fields button {
  font: 500 13px var(--sans); color: var(--muted); background: transparent; border: 0;
  border-radius: 7px; padding: 6px 12px; cursor: pointer; transition: all .15s;
}
.sorts button.on, .fields button.on { background: var(--surface-2); color: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.sorts button:hover, .fields button:hover { color: var(--paper); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.filters select {
  font: 500 13px var(--sans); color: var(--paper-dim); background: var(--ink-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; cursor: pointer; outline: none;
}
.filters select:focus-visible { border-color: var(--cinnabar); }
.tagrow { display: flex; gap: 6px; flex-wrap: wrap; }
.tagrow button {
  font: 500 12px var(--sans); color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; cursor: pointer;
  transition: all .15s;
}
.tagrow button:hover { color: var(--paper); border-color: var(--muted); }
.tagrow button.on { color: var(--tag-on-fg); background: var(--cinnabar-soft); border-color: var(--cinnabar); }

.countline { margin: 22px 2px 10px; font-size: 13px; color: var(--muted); min-height: 18px; }
.countline .ms { color: var(--brass); font-weight: 600; }
.countline .approx { color: var(--cinnabar); }
.countline .synline { color: var(--brass); }

/* ---------- results ---------- */
.results { display: flex; flex-direction: column; gap: 10px; }
.card {
  display: flex; gap: 14px; padding: 14px; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--ink-2));
  border-radius: 12px; cursor: pointer; position: relative;
  color: inherit; text-decoration: none; /* card là <a> trỏ /book/<id> */
  animation: rise .28s cubic-bezier(.2,.7,.3,1) both; animation-delay: calc(var(--i) * 22ms);
  transition: border-color .15s, transform .15s;
}
.card:hover, .card.active { border-color: var(--line-strong); transform: translateY(-1px); }
.card.active { box-shadow: 0 0 0 1px var(--cinnabar), 0 8px 26px var(--sh-1); }
@keyframes rise { from { opacity: 0; transform: translateY(7px); } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; } }

.cover { width: 58px; height: 80px; border-radius: 6px; overflow: hidden; flex: none; background: var(--surface-2); position: relative; box-shadow: 0 3px 10px var(--sh-2); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; position: relative; z-index: 1; }
.cover .ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--serif-zh); font-size: 26px; font-weight: 700; color: var(--ph-fg);
  background: linear-gradient(160deg, var(--ph-bg-1), var(--ph-bg-2));
}
.card-main { min-width: 0; flex: 1; }
.tline { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.t-zh { font-family: var(--serif-zh); font-size: 18px; font-weight: 700; letter-spacing: .02em; }
.t-hv { font-family: var(--serif-vi); font-style: italic; font-size: 14.5px; color: var(--brass); }
.aline { margin-top: 3px; font-size: 13px; color: var(--paper-dim); }
.aline .a-hv { color: var(--muted); font-style: italic; font-family: var(--serif-vi); }
.meta { margin-top: 7px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); }
.scorebadge { color: var(--brass); font-weight: 700; font-size: 13px; }
.scorebadge .cnt { color: var(--muted); font-weight: 400; }
.noscore { color: var(--faint); }
.st { display: inline-flex; align-items: center; gap: 5px; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-0 { color: var(--st-blue); } .st-1 { color: var(--ok); } .st-2 { color: var(--st-stale); }
.tags-mini { margin-top: 7px; display: flex; gap: 5px; flex-wrap: wrap; }
.tags-mini span {
  font-size: 11.5px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 9px;
}
mark {
  background: transparent; color: var(--mark-fg); border-bottom: 2px solid var(--cinnabar);
  padding-bottom: 1px;
}
.t-hv mark { color: var(--mark-hv); border-bottom-color: var(--brass); }

.more-wrap { text-align: center; margin-top: 22px; }
.ghost-btn {
  font: 500 13.5px var(--sans); color: var(--paper-dim); background: transparent;
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 20px; cursor: pointer;
  transition: all .15s;
}
.ghost-btn:hover { color: var(--paper); border-color: var(--muted); }
.theme-btn { font-size: 15px; line-height: 1; padding: 8px 12px; }
body, .card, .sorts, .fields, .filters select, .cover .ph, #q, .rev, kbd, .slash {
  transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}

.empty { text-align: center; padding: 48px 0; color: var(--muted); }
.empty .zh { font-family: var(--serif-zh); font-size: 40px; opacity: .35; display: block; margin-bottom: 12px; }

/* ---------- trang chủ: định nghĩa, lối khám phá và FAQ ---------- */
.home-about, .home-faq { margin-top: clamp(58px, 8vw, 86px); padding-top: clamp(26px, 4vw, 38px); border-top: 1px solid var(--line-strong); }
.home-about-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr); gap: clamp(34px, 7vw, 74px); align-items: start; }
.home-kicker { margin: 0 0 8px; color: var(--cinnabar); font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.home-about h2, .home-faq h2 { margin: 0; font: 600 clamp(25px, 3.5vw, 34px)/1.25 var(--serif-vi); letter-spacing: .01em; }
.home-about-copy > p:last-child { margin: 15px 0 0; color: var(--paper-dim); font-size: 14px; line-height: 1.78; }
.home-facts { margin: 2px 0 0; }
.home-facts div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.home-facts div:last-child { border-bottom: 1px solid var(--line); }
.home-facts dt { color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.home-facts dd { margin: 0; color: var(--paper-dim); font-size: 12.5px; line-height: 1.55; }
.home-paths { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; margin-top: clamp(28px, 5vw, 46px); }
.home-paths a { min-width: 0; padding-top: 11px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.home-paths b, .home-paths span { display: block; }
.home-paths b { font: 600 14px var(--serif-vi); }
.home-paths span { margin-top: 5px; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.home-paths a:hover b { color: var(--cinnabar); }
.home-paths a:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 5px; border-radius: 2px; }
.home-faq { display: grid; grid-template-columns: minmax(210px, .72fr) minmax(0, 1.28fr); gap: clamp(40px, 8vw, 82px); }
.home-faq-head > p:last-child { margin: 14px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.65; }
.home-faq-list details { border-top: 1px solid var(--line); }
.home-faq-list details:last-child { border-bottom: 1px solid var(--line); }
.home-faq-list summary {
  position: relative; padding: 15px 34px 15px 0; list-style: none; cursor: pointer;
  font: 600 14px/1.55 var(--sans); color: var(--paper);
}
.home-faq-list summary h3 { display: inline; margin: 0; font: inherit; }
.home-faq-list summary::-webkit-details-marker { display: none; }
.home-faq-list summary::after {
  content: "+"; position: absolute; top: 13px; right: 2px;
  color: var(--brass); font: 500 20px/1 var(--serif-vi);
}
.home-faq-list details[open] summary { color: var(--cinnabar); }
.home-faq-list details[open] summary::after { content: "−"; }
.home-faq-list summary:hover { color: var(--cinnabar); }
.home-faq-list summary:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 3px; border-radius: 2px; }
.home-faq-list p { margin: -2px 34px 17px 0; color: var(--paper-dim); font-size: 12.5px; line-height: 1.72; }

@media (max-width: 720px) {
  .home-about-grid, .home-faq { grid-template-columns: 1fr; gap: 28px; }
  .home-paths { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .home-paths { grid-template-columns: 1fr; gap: 12px; }
}

/* ---------- trang chi tiết /book/<id> ---------- */
.bookmain { padding-top: 28px; }
.bk-loading { text-align: center; color: var(--muted); padding: 80px 0; }
.bk-head { display: flex; gap: 30px; margin-bottom: 10px; }
.bk-cover { width: 168px; height: 232px; border-radius: 10px; flex: none; box-shadow: 0 10px 34px var(--sh-3); }
.bk-cover .ph { font-size: 56px; }
.bk-info { min-width: 0; flex: 1; }
.bk-tzh { margin: 0 0 8px; line-height: 1.2; }
.bk-title-zh { display: block; font-family: var(--serif-zh); font-size: clamp(26px, 4.5vw, 36px); font-weight: 700; }
.bk-title-hv { display: block; margin-top: 6px; font-family: var(--serif-vi); font-style: italic; font-size: clamp(17px, 2.6vw, 21px); font-weight: 600; color: var(--brass); }
.bk-home { display: inline-block; margin-top: 14px; }
a.ghost-btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 560px) {
  .bk-head { gap: 18px; }
  .bk-cover { width: 110px; height: 152px; }
  .bk-cover .ph { font-size: 38px; }
}
.d-author { font-size: 14px; color: var(--paper-dim); }
.d-meta { display: flex; gap: 14px; flex-wrap: wrap; margin: 16px 0; font-size: 13px; color: var(--muted); }
.book-facts { display: flex; gap: 12px 18px; flex-wrap: wrap; margin: 16px 0; }
.book-facts div { min-width: 110px; }
.book-facts dt { margin-bottom: 3px; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.book-facts dd { margin: 0; font-size: 13px; color: var(--paper-dim); }
.book-summary p { margin: 0 0 8px; font-size: 14px; line-height: 1.7; color: var(--paper-dim); }
.book-summary .source-note { font-size: 12px; color: var(--muted); }
.book-summary a { color: var(--paper-dim); }
.d-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.d-tags > span, .d-tags > a { font-size: 12px; color: var(--paper-dim); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; }
.d-links { display: flex; gap: 10px; margin: 14px 0 6px; flex-wrap: wrap; }
.d-links a, .d-links button {
  font: 500 13px var(--sans); color: var(--paper-dim); text-decoration: none;
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; background: transparent; cursor: pointer;
}
.d-links a:hover, .d-links button:hover { color: var(--cinnabar); border-color: var(--cinnabar); }
.d-sec { font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 26px 0 12px; }

/* ---------- insights: histogram sao, cảnh báo, truyện tương tự ---------- */
.d-hist { display: flex; align-items: flex-end; gap: 14px; margin: 2px 0 14px; flex-wrap: wrap; }
.hb-row { display: flex; gap: 7px; align-items: flex-end; }
.hb { display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: default; }
.hb-bar { height: 36px; width: 17px; display: flex; align-items: flex-end; }
.hb-fill { width: 100%; background: linear-gradient(180deg, var(--brass), var(--brass-2)); border-radius: 3px 3px 0 0; }
.hb span { font-size: 10px; color: var(--muted); }
.hist-cap { font-size: 12.5px; color: var(--muted); padding-bottom: 2px; }
.polar { color: var(--cinnabar); font-weight: 600; cursor: help; }
.d-warn { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.warn-chip {
  font-size: 12px; color: var(--warn-fg); background: var(--cinnabar-soft);
  border: 1px solid rgba(210, 74, 56, .35); border-radius: 999px; padding: 4px 12px; cursor: help;
}
.sim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px 10px; margin-bottom: 6px; }
.sim-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: transparent; border: 0; padding: 0; cursor: pointer; font: inherit; text-align: center;
  color: inherit; text-decoration: none; /* sim-card là <a> trỏ /book/<id> */
}
.sim-card .cover { width: 100%; height: auto; aspect-ratio: 58 / 80; }
.sim-t {
  font-family: var(--serif-vi); font-style: italic; font-size: 12px; line-height: 1.35; color: var(--paper-dim);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sim-card:hover .sim-t { color: var(--cinnabar); }
.sim-s { font-size: 11px; color: var(--brass); }
.rev { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: var(--rev-bg); }
.rev-head { display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.rev-user { color: var(--paper-dim); font-weight: 600; }
.rev-score { color: var(--brass); }
.rev-body { font-size: 13.5px; line-height: 1.65; color: var(--paper-dim); white-space: pre-wrap; word-break: break-word; }
.rev-body.hv-mode { font-family: var(--serif-vi); font-style: italic; color: var(--rev-hv); }
.rev-body.vi-mode { color: var(--rev-vi); }
.rev-body u.ent { text-decoration: underline dotted var(--brass); text-underline-offset: 3px; cursor: help; }
.d-dich { font-size: 13px; color: var(--paper-dim); margin-top: 6px; font-style: italic; }
.rev-tabs { display: inline-flex; gap: 3px; margin-left: 10px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 7px; padding: 2px; vertical-align: middle; }
.rev-tabs button { font: 500 11.5px var(--sans); color: var(--muted); background: transparent; border: 0; border-radius: 5px; padding: 3px 9px; cursor: pointer; letter-spacing: 0; text-transform: none; }
.rev-tabs button.on { background: var(--surface-2); color: var(--paper); }
.rev-badge { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--brass); margin-left: 8px; }

footer { margin-top: 60px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 18px; }
footer a { color: var(--paper-dim); }
footer .hint { opacity: .8; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; font-size: 11px; background: var(--ink-2); }

/* ---------- mổ xẻ khía cạnh (trang book) ---------- */
.d-sec-note { font-weight: 400; font-size: 11px; letter-spacing: .02em; text-transform: none; color: var(--muted); margin-left: 10px; }
.asp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 36px; margin-bottom: 6px; }
.asp-row { display: flex; align-items: center; gap: 10px; cursor: default; }
.asp-label { flex: 0 0 142px; font-size: 12.5px; color: var(--paper-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asp-label i { font-style: normal; font-family: var(--serif-zh); color: var(--faint); font-size: 11px; margin-left: 3px; }
.asp-bar { flex: 1 1 auto; display: flex; gap: 2px; height: 10px; min-width: 60px; }
.asp-neg { background: var(--cinnabar); border-radius: 4px 0 0 4px; min-width: 3px; }
.asp-pos { background: var(--viz-pos); border-radius: 0 4px 4px 0; min-width: 3px; }
.asp-neg:only-child, .asp-pos:only-child { border-radius: 4px; }
.asp-nums { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.asp-small { display: inline-block; margin-left: 3px; padding: 1px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--cinnabar-soft); color: var(--paper-dim); font-size: 9px; font-style: normal; letter-spacing: .02em; vertical-align: 1px; }

/* ---------- /timeline: biên niên sử ---------- */
.tlmain { padding-top: 28px; overflow-x: hidden; }
.tl-hero h1 { font: 600 clamp(26px, 4.5vw, 36px)/1.25 var(--serif-vi); margin: 4px 0 10px; }
.tl-hero .sub { color: var(--paper-dim); margin: 0; }
.tl-tiles { display: flex; gap: 14px 40px; flex-wrap: wrap; margin: 24px 0 4px; }
.tl-tile b { display: block; font: 600 26px/1.15 var(--sans); color: var(--paper); }
.tl-tile span { font-size: 12px; color: var(--muted); }
.tl-chart-wrap { position: relative; }
.tl-chart-wrap svg { display: block; width: 100%; height: auto; }
.tl-chart-wrap svg text { font: 10.5px var(--sans); fill: var(--muted); }
.tl-chart-wrap svg .lbl { font-weight: 600; fill: var(--paper-dim); }
.tl-chart-wrap svg .ttl { font-weight: 600; font-size: 10px; letter-spacing: .12em; }
.tl-note { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; line-height: 1.6; }
.tl-tip {
  position: fixed; pointer-events: none; z-index: 30; opacity: 0; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 7px 11px; font-size: 12px; line-height: 1.55; color: var(--paper-dim);
  box-shadow: 0 6px 18px var(--sh-2);
}
.tl-tip b { color: var(--paper); }
.spark-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 12px 16px; }
.spark { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 7px; background: var(--rev-bg); }
.spark-name { font-size: 12.5px; font-weight: 600; color: var(--paper-dim); }
.spark-name i { font-style: normal; font-family: var(--serif-zh); font-weight: 500; color: var(--faint); margin-left: 4px; font-size: 11.5px; }
.spark-peak { float: right; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.spark svg { display: block; width: 100%; height: 46px; margin-top: 6px; }
.tl-year { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 28px; overflow: hidden; }
.tl-year-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.tl-year-head h2, .tl-year-head h3 { font: 600 30px/1 var(--serif-vi); margin: 0; color: var(--paper); }
.tl-year-head .meta { font-size: 12.5px; color: var(--muted); }
.tl-year-trends { margin: -3px 0 12px; font-size: 12px; color: var(--muted); line-height: 1.55; }
.tl-book-list { list-style: none; padding: 0; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; }
.tl-book-list > li { min-width: 0; }
.sim-n { font-size: 11px; color: var(--muted); }

/* ---------- /rank: bảng phong thần ---------- */
.tl-lead { color: var(--paper-dim); line-height: 1.7; max-width: 760px; margin: 0; }
.tl-lead b { color: var(--paper); }
.rk-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 22px 0 10px; }
.rk-tabs button {
  font: 500 12.5px var(--sans); color: var(--muted); background: var(--ink-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 13px; cursor: pointer;
}
.rk-tabs button:hover { color: var(--paper-dim); border-color: var(--line-strong); }
.rk-tabs button.on { background: var(--surface-2); color: var(--paper); border-color: var(--line-strong); }
.rk-panel h2 { font: 600 23px/1.25 var(--serif-vi); color: var(--paper); margin: 18px 0 5px; }
.rk-desc { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0 0 16px; max-width: 720px; }
.rk-list { display: flex; flex-direction: column; gap: 8px; list-style: none; padding: 0; margin: 0; }
.rk-item { display: block; }
.rk-row {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px 9px 10px;
  background: var(--rev-bg);
}
.rk-row:hover { border-color: var(--cinnabar); }
.rk-no { flex: 0 0 30px; text-align: center; font: 600 15px var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.rk-top3 .rk-no { color: var(--brass); font-size: 17px; }
.rk-cover { width: 40px; height: 55px; border-radius: 5px; box-shadow: 0 2px 6px var(--sh-2); }
.rk-cover .ph { font-size: 18px; }
.rk-mid { flex: 1 1 auto; min-width: 0; }
.rk-t {
  display: block; font-family: var(--serif-vi); font-size: 14.5px; color: var(--paper);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rk-row:hover .rk-t { color: var(--cinnabar); }
.rk-t i { font-style: normal; font-family: var(--serif-zh); font-size: 12px; color: var(--faint); margin-left: 6px; }
.rk-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-val { flex: 0 0 auto; text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rk-val b { display: block; font-size: 14px; color: var(--brass); }

/* ---------- /author: hồ sơ tác giả ---------- */
.au-kicker { font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 2px; }
.au-zh { font-family: var(--serif-zh); font-size: .62em; color: var(--faint); margin-left: 10px; font-weight: 500; }
.au-vi { color: var(--paper-dim); font-style: italic; margin: 2px 0 0; }
.au-vi b { color: var(--brass); font-weight: 600; }
.au-badges { margin-top: 10px; }
.au-badge { display: inline-block; font-size: 12.5px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 5px 11px; cursor: help; }
.au-good { color: var(--ok, #3c7a45); }
.au-bad { color: var(--cinnabar); }
.au-list { display: flex; flex-direction: column; gap: 8px; }
.au-card {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px 9px 10px;
  background: var(--rev-bg);
}
.au-card:hover { border-color: var(--cinnabar); }
.au-cover { width: 46px; height: 63px; border-radius: 5px; box-shadow: 0 2px 6px var(--sh-2); }
.au-cover .ph { font-size: 20px; }
.au-mid { flex: 1 1 auto; min-width: 0; }
.au-t { display: block; font-family: var(--serif-vi); font-size: 15px; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-card:hover .au-t { color: var(--cinnabar); }
.au-t i { font-style: normal; font-family: var(--serif-zh); font-size: 12px; color: var(--faint); margin-left: 6px; }
.au-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-adj { flex: 0 0 auto; text-align: right; font-size: 14px; color: var(--brass); font-variant-numeric: tabular-nums; }
.au-adj small { display: block; font-size: 10.5px; color: var(--muted); }
.a-author { text-decoration: none; color: inherit; border-bottom: 1px dotted var(--line-strong); }
.a-author:hover { color: var(--cinnabar); border-bottom-color: var(--cinnabar); }
.a-author:hover i { color: var(--cinnabar); }
.a-vi { font-size: .92em; color: var(--muted); font-style: italic; }

/* dòng điểm gu-chỉnh dưới histogram (trang book) */
.adj-line { font-size: 12.5px; color: var(--paper-dim); margin-top: 5px; cursor: help; }
.adj-line b { color: var(--brass); }
.adj-raw { color: var(--muted); }
.adj-more { font-size: 11.5px; color: var(--muted); margin-left: 8px; }
.adj-more:hover { color: var(--cinnabar); }

@media (max-width: 640px) {
  .proverb { display: none; }
  .toolbar { flex-direction: column; }
  .t-zh { font-size: 16.5px; }
  .rk-t i { display: none; }
  .rk-row { gap: 10px; padding-right: 10px; }
  .rk-val { font-size: 11px; }
  .rk-val b { font-size: 12.5px; }
  .tl-book-list {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84px;
    overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity;
  }
  .tl-book-list > li { scroll-snap-align: start; }
}
@media (max-width: 760px) {
  .asp-grid { grid-template-columns: 1fr; }
  .asp-label { flex-basis: 128px; }
}

/* /galaxy: thiên hà sách — canvas pan/zoom, chòm gu Louvain; dưới là sections */
.gxmain {
  width: min(1560px, 100%); margin: 0 auto; padding: 4px 18px 48px;
}
.gx-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.gx-h1 { font-family: var(--serif-vi); font-size: 24px; margin: 2px 0; color: var(--paper); }
.gx-sub { margin: 0; font-size: 12.5px; color: var(--muted); }
.gx-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 0 8px;
}
.gx-search { position: relative; flex: 0 1 300px; min-width: 210px; }
.gx-search input {
  width: 100%; font: 13.5px var(--sans); color: var(--paper);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 8px 12px; outline: none;
}
.gx-search input:focus { border-color: var(--brass-2); }
.gx-dd {
  display: none; position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: 0 8px 24px var(--sh-2); overflow: hidden;
}
.gx-dd button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 8px 12px; cursor: pointer; font: 13px var(--sans); color: var(--paper);
}
.gx-dd button:hover { background: var(--surface-2); }
.gx-dd button b { font-weight: 600; }
.gx-dd button small { display: block; color: var(--muted); font-size: 11px; }
.gx-dd-none { padding: 9px 12px; font-size: 12px; color: var(--muted); }
.gx-legend { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 auto; }
.gx-chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font: 12px var(--sans); color: var(--paper); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
}
.gx-chip:hover { border-color: var(--brass-2); }
.gx-chip.on { border-color: var(--cinnabar); background: var(--cinnabar-soft); }
.gx-chip i { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.gx-chip small { color: var(--muted); }
.gx-btns { display: flex; gap: 5px; }
.gx-btns .ghost-btn { padding: 5px 11px; }
.gx-wrap {
  position: relative; height: calc(100vh - 252px); min-height: 420px; overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: 14px;
  background:
    radial-gradient(ellipse 90% 75% at 50% 42%, var(--gx-neb-1) 0%, transparent 62%),
    radial-gradient(ellipse 130% 110% at 50% 50%, var(--gx-neb-2) 0%, var(--gx-void) 100%);
  box-shadow: inset 0 0 60px var(--sh-1);
}
:root { --gx-neb-1: rgba(191, 58, 39, 0.045); --gx-neb-2: #f6f0e0; --gx-void: #eadfbf; }
html[data-theme="dark"] {
  --gx-neb-1: rgba(144, 133, 233, 0.07); --gx-neb-2: #171320; --gx-void: #0d0a12;
}
.gx-wrap canvas { display: block; touch-action: none; cursor: grab; }
.gx-wrap canvas:active { cursor: grabbing; }
#gx-ov { position: absolute; inset: 0; pointer-events: none; }
.gx-tip {
  display: none; position: absolute; z-index: 20; max-width: 260px; pointer-events: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 8px 11px; font: 13px var(--sans); color: var(--paper);
  box-shadow: 0 6px 18px var(--sh-2);
}
.gx-tip b { font-family: var(--serif-vi); font-size: 13.5px; display: block; }
.gx-tip-a { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.gx-tip-m { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--paper-dim); margin-top: 4px; }
.gx-tip-m i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.gx-tip-go { display: block; font-size: 10.5px; color: var(--faint); margin-top: 4px; }
.gx-loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 14px var(--sans); color: var(--muted);
}
.gx-note { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); line-height: 1.55; margin: 8px 2px 0; }
@media (max-width: 720px) {
  .gx-note { display: none; }
  .gx-legend { order: 3; flex-basis: 100%; }
  .gxmain { padding: 2px 8px 8px; }
}
.sim-gx { font-size: 11.5px; font-weight: 400; color: var(--muted); margin-left: 10px; text-decoration: none; }
.sim-gx:hover { color: var(--cinnabar); }

/* /galaxy: sections dưới bản đồ */
.gx-sec { margin-top: 34px; }
.gx-sec .d-sec { margin-bottom: 12px; }
.gx-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.gx-cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.gx-cl-card { border: 1px solid var(--line); border-radius: 12px; background: var(--rev-bg); padding: 10px 12px; }
.gx-cl-head {
  display: flex; align-items: center; gap: 8px; width: 100%; cursor: pointer;
  background: none; border: 0; padding: 2px 0 8px; font: 600 14px var(--sans);
  color: var(--paper); text-align: left;
}
.gx-cl-head:hover b { color: var(--cinnabar); }
.gx-cl-head small { color: var(--muted); font-weight: 400; margin-left: auto; }
.gx-cl-books { display: flex; flex-direction: column; gap: 6px; }
.gx-bk { display: flex; align-items: center; gap: 9px; text-decoration: none; min-width: 0; border-radius: 8px; padding: 2px 4px; }
.gx-bk:hover { background: var(--surface-2); }
.gx-cover { width: 34px; height: 47px; border-radius: 4px; flex: 0 0 auto; box-shadow: 0 1px 4px var(--sh-1); }
.gx-cover .ph { font-size: 15px; }
.gx-bk-m { min-width: 0; display: flex; flex-direction: column; }
.gx-bk-m b { font-family: var(--serif-vi); font-weight: 600; font-size: 13.5px; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gx-bk:hover .gx-bk-m b { color: var(--cinnabar); }
.gx-bk-m small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gx-pair-list, .gx-bridge-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 10px 18px; }
.gx-pair, .gx-bridge {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 12px; background: var(--rev-bg); min-width: 0;
}
.gx-pair .gx-bk, .gx-bridge .gx-bk { flex: 1 1 0; min-width: 0; }
.gx-pair-mid { flex: 0 0 auto; font-size: 11px; color: var(--brass); text-align: center; max-width: 90px; }
.gx-bridge-m { flex: 1 1 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--paper-dim); }
.gx-bridge-m em { font-style: normal; color: var(--muted); }
@media (max-width: 640px) {
  .gx-pair-list, .gx-bridge-list { grid-template-columns: 1fr; }
  .gx-wrap { height: calc(100vh - 300px); min-height: 340px; }
}

/* ---------- /taste: hồ sơ gu local-first ---------- */
.taste-main { max-width: 980px; padding-top: 26px; }
.taste-hero { max-width: 790px; margin-bottom: 28px; }
.taste-hero h1 { margin: 4px 0 12px; font: 600 clamp(28px, 4.5vw, 42px)/1.2 var(--serif-vi); }
.taste-hero h1 em { color: var(--cinnabar); font-style: normal; }
.taste-hero > p:not(.au-kicker) { color: var(--paper-dim); line-height: 1.7; margin: 8px 0; }
.taste-privacy { border-left: 3px solid var(--brass); padding: 8px 0 8px 14px; font-size: 13px; }
.taste-privacy b { color: var(--paper); }
.taste-panel {
  margin: 18px 0; padding: clamp(16px, 3vw, 26px); border: 1px solid var(--line);
  border-radius: 14px; background: linear-gradient(180deg, var(--surface), var(--ink-2));
  box-shadow: 0 10px 34px var(--sh-1);
}
.taste-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.taste-panel-head h2, .taste-tools h2 { margin: 2px 0 0; font: 600 24px/1.25 var(--serif-vi); }
.taste-progress { flex: none; color: var(--brass); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; font-size: 11.5px; }
.taste-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.taste-subhead h3 { margin: 0; font-size: 14px; }
.taste-subhead h3 span { color: var(--brass); font-size: 11px; font-weight: 500; }
.taste-subhead p { min-height: 40px; margin: 5px 0 10px; color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.taste-seed-list { display: flex; flex-direction: column; gap: 6px; }
.taste-seed {
  display: flex; align-items: center; gap: 8px; min-height: 45px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--rev-bg);
}
.taste-seed.is-primary { border-color: var(--brass-2); background: color-mix(in srgb, var(--brass) 8%, transparent); }
.taste-seed-no { flex: 0 0 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-2); color: var(--muted); font: 600 11px var(--serif-zh); }
.taste-seed.is-primary .taste-seed-no { color: var(--brass); }
.taste-seed-name { flex: 1 1 auto; min-width: 0; }
.taste-seed-name a { display: block; overflow: hidden; color: var(--paper); text-decoration: none; text-overflow: ellipsis; white-space: nowrap; font: 500 12.5px var(--serif-vi); }
.taste-seed-name a:hover { color: var(--cinnabar); }
.taste-seed-name small { display: block; overflow: hidden; color: var(--faint); text-overflow: ellipsis; white-space: nowrap; font: 10.5px var(--serif-zh); }
.taste-seed-actions { flex: 0 0 auto; display: flex; gap: 4px; align-items: center; }
.taste-seed-actions button, .taste-search-actions button, .taste-rec-actions button {
  font: 500 11px var(--sans); color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; cursor: pointer;
}
.taste-seed-actions button:hover, .taste-search-actions button:hover, .taste-rec-actions button:hover { color: var(--cinnabar); border-color: var(--cinnabar); }
.taste-seed-actions button:disabled, .taste-search-actions button:disabled { opacity: .55; cursor: default; color: var(--muted); border-color: var(--line); }
.taste-primary-badge { color: var(--brass); font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; }
.taste-list-empty { color: var(--muted); border: 1px dashed var(--line); border-radius: 9px; padding: 12px; font-size: 12px; text-align: center; }
.taste-search-block { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.taste-search-block > label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; }
.taste-searchbox { position: relative; }
.taste-searchbox input {
  width: 100%; padding: 12px 42px 12px 14px; color: var(--paper); background: var(--ink-2);
  border: 1px solid var(--line); border-radius: 9px; outline: none; font: 500 15px var(--sans);
}
.taste-searchbox input:focus { border-color: var(--cinnabar); box-shadow: 0 0 0 3px var(--cinnabar-soft); }
.taste-searchbox > span { position: absolute; right: 14px; top: 50%; translate: 0 -50%; color: var(--muted); font-size: 20px; }
.taste-help, .taste-live { color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.taste-help { margin: 6px 0; }
.taste-live { min-height: 18px; margin: 8px 0; }
.taste-live.is-error { color: var(--warn-fg); }
.taste-search-results { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.taste-search-card { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--rev-bg); }
.taste-search-cover { flex: none; }
.taste-search-cover .cover,
.taste-rec-cover .cover,
.compare-cover .cover { display: block; }
.taste-search-cover .cover { width: 42px; height: 58px; }
.taste-search-main { flex: 1 1 auto; min-width: 0; }
.taste-search-title { display: block; overflow: hidden; color: var(--paper); text-decoration: none; text-overflow: ellipsis; white-space: nowrap; font: 600 13px var(--serif-vi); }
.taste-search-title:hover { color: var(--cinnabar); }
.taste-search-main > span, .taste-search-main > small { display: block; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
.taste-search-actions { flex: 0 0 auto; display: flex; flex-direction: column; gap: 5px; }
.taste-cta-row { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.taste-cta-row > span { color: var(--muted); font-size: 11.5px; }
.taste-primary {
  display: inline-flex; align-items: center; justify-content: center; padding: 9px 16px;
  color: #f7edda; background: linear-gradient(145deg, #cf4936, #a92e22);
  border: 1px solid #a92e22; border-radius: 9px; text-decoration: none;
  font: 600 13px var(--sans); cursor: pointer; box-shadow: 0 4px 14px rgba(191, 58, 39, .2);
}
.taste-primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.taste-results-panel { min-height: 180px; }
.taste-group { margin-top: 26px; }
.taste-group + .taste-group { border-top: 1px solid var(--line); padding-top: 24px; }
.taste-group-head { display: flex; gap: 18px; align-items: baseline; margin-bottom: 10px; }
.taste-group-head h3 { margin: 0; font: 600 20px var(--serif-vi); }
.taste-group-head p { margin: 0; color: var(--muted); font-size: 11.5px; }
.taste-rec-list { display: flex; flex-direction: column; gap: 10px; }
.taste-rec {
  display: flex; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--rev-bg); animation: rise .28s cubic-bezier(.2,.7,.3,1) both;
  animation-delay: calc(var(--i) * 18ms);
}
.taste-rec:hover { border-color: var(--line-strong); }
.taste-rec-cover { flex: none; }
.taste-rec-cover .cover { width: 68px; height: 94px; }
.taste-rec-main { flex: 1 1 auto; min-width: 0; }
.taste-rec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.taste-rec-title { color: var(--paper); text-decoration: none; font: 600 17px var(--serif-vi); }
.taste-rec-title:hover { color: var(--cinnabar); }
.taste-confidence { flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; color: var(--muted); font-size: 9.5px; }
.taste-confidence.is-high { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.taste-reasons { margin: 9px 0 7px; padding-left: 18px; color: var(--paper-dim); font-size: 11.5px; line-height: 1.55; }
.taste-reasons a { color: var(--brass); }
.taste-reasons .taste-negative { color: var(--muted); }
.taste-rec-stats { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.taste-rec-stats > span b { color: var(--brass); }
.taste-rec-stats .d-warn { margin: 0; }
.taste-rec-stats .warn-chip { padding: 3px 8px; font-size: 10px; }
.taste-aspects { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.taste-aspects > span { border: 1px solid var(--line); border-radius: 7px; padding: 4px 7px; color: var(--muted); font-size: 9.5px; }
.taste-aspects b { color: var(--paper-dim); }
.taste-rec-actions { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.taste-rec-actions button.is-on { color: var(--cinnabar); border-color: var(--cinnabar); background: var(--cinnabar-soft); }
.taste-rec-actions > a { padding: 5px 3px; color: var(--brass); font-size: 11px; text-decoration: none; }
.taste-decision-panel {
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 94% 8%, color-mix(in srgb, var(--brass) 10%, transparent), transparent 28%),
    linear-gradient(180deg, var(--surface), var(--ink-2));
}
.decision-watermark {
  position: absolute; z-index: 0; right: 20px; top: 10px;
  color: color-mix(in srgb, var(--brass) 7%, transparent); pointer-events: none;
  font: 700 112px/1 var(--serif-zh);
}
.taste-decision-panel > :not(.decision-watermark) { position: relative; z-index: 1; }
.decision-lock {
  display: flex; align-items: center; gap: 14px; padding: 15px 0 3px;
  border-top: 1px solid var(--line); color: var(--muted);
}
.decision-lock[hidden] { display: none; }
.decision-lock > span {
  flex: 0 0 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; color: var(--brass);
  font: 600 20px var(--serif-zh);
}
.decision-lock b { color: var(--paper-dim); font: 600 14px var(--serif-vi); }
.decision-lock p { margin: 3px 0 0; font-size: 11.5px; line-height: 1.55; }
#decision-workspace[hidden] { display: none; }
.decision-intro { max-width: 790px; }
.decision-intro > label { display: block; margin-bottom: 7px; color: var(--paper); font: 600 14px var(--serif-vi); }
.decision-query-row { display: flex; gap: 8px; }
.decision-query-row input {
  flex: 1 1 auto; min-width: 0; padding: 11px 13px; color: var(--paper);
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 9px;
  outline: none; font: 500 13px var(--sans);
}
.decision-query-row input:focus { border-color: var(--cinnabar); box-shadow: 0 0 0 3px var(--cinnabar-soft); }
.decision-unknown { margin: 7px 0 0; color: var(--warn-fg); font-size: 11px; }
.decision-filters {
  display: grid; grid-template-columns: 1fr 1fr; margin-top: 18px;
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.decision-filter-group {
  min-width: 0; margin: 0; padding: 13px 14px 14px; border: 0;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.decision-filter-wide { grid-column: 1 / -1; }
.decision-filter-group legend {
  padding: 0 5px 0 0; color: var(--paper-dim); font: 600 11.5px var(--sans);
}
.decision-filter-group legend small { color: var(--faint); font-size: 9.5px; font-weight: 400; }
.decision-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.decision-chips button {
  padding: 5px 9px; color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  font: 500 10.5px var(--sans); transition: color .15s, border-color .15s, background .15s;
}
.decision-chips button:hover { color: var(--paper); border-color: var(--line-strong); }
.decision-chips button[aria-pressed="true"] {
  color: var(--cinnabar); border-color: color-mix(in srgb, var(--cinnabar) 65%, var(--line));
  background: var(--cinnabar-soft);
}
.decision-evidence-note { margin: 11px 0 0; color: var(--faint); font-size: 10.5px; line-height: 1.55; }
.decision-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 15px; }
.decision-actions .taste-live { flex: 1 1 260px; min-height: 0; margin: 0 0 0 4px; }
.decision-results { margin-top: 18px; }
.decision-results:empty { display: none; }
.decision-picks {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong);
}
.decision-pick {
  min-width: 0; padding: 17px 16px 17px 0; animation: rise .28s cubic-bezier(.2,.7,.3,1) both;
  animation-delay: calc(var(--i) * 55ms);
}
.decision-pick + .decision-pick { padding-left: 16px; border-left: 1px solid var(--line); }
.decision-role { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.decision-role > span {
  min-width: 25px; height: 25px; display: grid; place-items: center;
  border: 1px solid var(--brass-2); border-radius: 50%; color: var(--brass);
  font: 600 11px var(--serif-zh);
}
.decision-role b { color: var(--paper); font: 600 13px var(--serif-vi); }
.decision-role small { display: block; margin-top: 1px; color: var(--faint); font-size: 9.5px; }
.decision-book { display: flex; gap: 11px; min-width: 0; }
.decision-pick-cover { flex: none; }
.decision-pick-cover .cover { display: block; width: 61px; height: 84px; }
.decision-book-main { min-width: 0; }
.decision-book-title {
  display: block; color: var(--paper); text-decoration: none;
  font: 600 14px/1.35 var(--serif-vi);
}
.decision-book-title:hover { color: var(--cinnabar); }
.decision-book-main > small { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.decision-proof { margin: 12px 0 0; padding: 0; list-style: none; color: var(--paper-dim); font-size: 10.5px; line-height: 1.55; }
.decision-proof li { position: relative; padding-left: 12px; }
.decision-proof li::before { position: absolute; left: 0; content: "·"; color: var(--brass); }
.decision-proof .is-caveat { color: var(--muted); }
.decision-pick-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.decision-pick-actions button {
  padding: 5px 8px; color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 7px; cursor: pointer; font: 500 10px var(--sans);
}
.decision-pick-actions button:hover, .decision-pick-actions button.is-on { color: var(--cinnabar); border-color: var(--cinnabar); }
.decision-pick-actions button.is-on { background: var(--cinnabar-soft); }
.decision-pick-actions a { align-self: center; color: var(--brass); text-decoration: none; font-size: 10.5px; }
.decision-empty {
  padding: 16px; border: 1px dashed var(--line); border-radius: 9px;
  color: var(--muted); font-size: 11.5px; line-height: 1.55;
}
.decision-empty b { display: block; margin-bottom: 3px; color: var(--paper-dim); font: 600 14px var(--serif-vi); }
.decision-empty button { margin-top: 10px; }
.taste-alert, .taste-tools {
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  margin: 18px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--rev-bg);
}
.taste-alert[hidden] { display: none; }
.taste-alert b, .taste-alert span { display: block; }
.taste-alert span, .taste-tools p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.taste-inline-actions { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.ghost-btn.danger { color: var(--warn-fg); }
.taste-tools h2 { font-size: 18px; }
.compare-tray {
  position: sticky; z-index: 10; bottom: 12px; display: flex; justify-content: space-between;
  align-items: center; gap: 14px; margin: 18px auto; padding: 10px 12px 10px 16px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface);
  box-shadow: 0 8px 28px var(--sh-3); color: var(--paper-dim); font-size: 12px;
}
.compare-tray[hidden] { display: none; }
.compare-tray .taste-primary { padding: 8px 14px; }

@media (max-width: 760px) {
  .taste-columns, .taste-search-results { grid-template-columns: 1fr; }
  .taste-subhead p { min-height: 0; }
  .taste-panel-head, .taste-group-head, .taste-alert, .taste-tools { align-items: flex-start; flex-direction: column; }
  .taste-progress { align-self: flex-start; }
  .decision-picks { grid-template-columns: 1fr; }
  .decision-pick, .decision-pick + .decision-pick { padding: 15px 0; border-left: 0; }
  .decision-pick + .decision-pick { border-top: 1px solid var(--line); }
}
@media (max-width: 540px) {
  .top { align-items: flex-start; }
  .top-right { justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
  .top-right .ghost-btn { padding: 7px 9px; }
  .taste-main { padding-top: 12px; }
  .taste-panel { padding: 14px; }
  .taste-seed-actions button { padding: 5px 6px; }
  .taste-primary-badge { display: none; }
  .taste-search-card { align-items: flex-start; }
  .taste-search-actions { flex-direction: row; flex-wrap: wrap; }
  .taste-rec { padding: 11px; gap: 10px; }
  .taste-rec-cover .cover { width: 52px; height: 72px; }
  .taste-rec-head { flex-direction: column; gap: 6px; }
  .taste-rec-title { font-size: 15px; }
  .taste-cta-row, .compare-tray { align-items: stretch; flex-direction: column; }
  .decision-query-row, .decision-actions { align-items: stretch; flex-direction: column; }
  .decision-filters { grid-template-columns: 1fr; }
  .decision-filter-wide { grid-column: auto; }
  .decision-actions .taste-live { flex-basis: auto; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .taste-rec, .decision-pick { animation: none; }
  .decision-chips button { transition: none; }
}

/* ---------- /compare: bảng 2–4 truyện ---------- */
.compare-main { max-width: 1180px; padding-top: 26px; }
.compare-hero { max-width: 780px; margin-bottom: 24px; }
.compare-hero h1 { margin: 4px 0 10px; font: 600 clamp(28px, 4.5vw, 40px)/1.2 var(--serif-vi); }
.compare-hero > p:not(.au-kicker) { color: var(--paper-dim); line-height: 1.7; }
.compare-status { margin: 12px 0; }
.compare-table-wrap { overflow-x: auto; padding-bottom: 8px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 10px 34px var(--sh-1); }
.compare-table { width: 100%; min-width: 650px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.compare-table caption { padding: 11px 14px; color: var(--muted); text-align: left; font-size: 10.5px; caption-side: bottom; }
.compare-table th, .compare-table td { padding: 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: top; }
.compare-table tr > :last-child { border-right: 0; }
.compare-table tbody tr:last-child > * { border-bottom: 0; }
.compare-table thead th { background: var(--ink-2); }
.compare-corner { width: 145px; color: var(--muted); text-align: left; font-size: 11px; }
.compare-book-head { min-width: 180px; text-align: center; }
.compare-cover { display: inline-block; margin-bottom: 8px; }
.compare-cover .cover { width: 72px; height: 99px; }
.compare-book-title, .compare-zh, .compare-author { display: block; }
.compare-book-title { color: var(--paper); text-decoration: none; font: 600 15px/1.4 var(--serif-vi); }
.compare-book-title:hover { color: var(--cinnabar); }
.compare-zh { color: var(--faint); font: 11px/1.4 var(--serif-zh); }
.compare-author { margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.compare-book-head button { margin-top: 8px; padding: 3px 7px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font: 500 9.5px var(--sans); }
.compare-book-head button:hover { color: var(--cinnabar); border-color: var(--cinnabar); }
.compare-table tbody th { color: var(--paper-dim); background: var(--ink-2); text-align: left; font-size: 11px; font-weight: 600; }
.compare-table tbody td { color: var(--paper-dim); font-size: 11.5px; }
.compare-table td > small, .compare-aspect small { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.compare-score { color: var(--brass); font-size: 15px; }
.compare-muted, .compare-empty { color: var(--faint); font-size: 10.5px; }
.compare-table .tags-mini { margin: 0; }
.compare-table .tags-mini span { padding: 2px 6px; font-size: 9.5px; }
.compare-hist { display: flex; align-items: flex-end; gap: 6px; height: 52px; }
.compare-hist > span { display: flex; flex: 1 1 0; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; height: 100%; }
.compare-hist i { display: block; width: 100%; max-width: 18px; min-height: 3px; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, var(--brass), var(--brass-2)); }
.compare-hist b { color: var(--muted); font-size: 8.5px; font-weight: 500; }
.compare-warnings { display: flex; flex-direction: column; gap: 5px; }
.compare-warnings span { color: var(--warn-fg); font-size: 10px; line-height: 1.45; }
.compare-warnings b { color: inherit; }
.compare-aspect b { display: block; color: var(--viz-pos); font-size: 10.5px; }
.compare-aspect small { color: var(--warn-fg); }

@media (max-width: 640px) {
  .compare-main { padding-top: 12px; }
  .compare-corner { width: 112px; }
  .compare-table th, .compare-table td { padding: 10px; }
}

/* ---------- /tag/<slug> trang thể loại + /tags danh mục ---------- */
.tg-crumb { margin: 18px 0 0; font-size: 12.5px; color: var(--muted); }
.tg-crumb a { color: var(--brass); text-decoration: none; }
.tg-crumb a:hover { color: var(--cinnabar); }
.tg-hero h1 i { margin-left: 10px; font: 500 0.62em var(--serif-zh); color: var(--paper-dim); font-style: normal; }
.tg-controls { display: flex; flex-direction: column; gap: 6px; margin: 16px 0 4px; }
.tg-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tg-chips button {
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: none; color: var(--muted); font: 500 12.5px var(--sans); cursor: pointer;
}
.tg-chips button:hover { color: var(--paper-dim); border-color: var(--line-strong); }
.tg-chips button.on { background: var(--surface-2); color: var(--tag-on-fg); border-color: var(--line-strong); }
.adjbadge { color: var(--brass); font-weight: 600; white-space: nowrap; }
.tg-crowdchip {
  padding: 1px 8px; border: 1px dashed var(--line-strong); border-radius: 999px;
  color: var(--muted); font-size: 10.5px; white-space: nowrap;
}
.tg-relrow { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 10px 0 14px; }
.tg-relcap { color: var(--muted); font-size: 12px; }
.tg-rel {
  padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--paper-dim); font-size: 12.5px; text-decoration: none; background: var(--surface);
}
.tg-rel:hover { border-color: var(--line-strong); color: var(--tag-on-fg); }
.tg-rel small { color: var(--faint); font-size: 10px; margin-left: 3px; }
.tg-grid { margin-top: 6px; }
.loadrow { display: flex; justify-content: center; margin: 14px 0 4px; }
.tg-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 26px; }
@media (max-width: 640px) { .tg-sides { grid-template-columns: 1fr; } }
.tg-side {
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  padding: 14px 16px 16px; box-shadow: 0 1px 0 var(--sh-1);
}
.tg-side h2 { margin: 0 0 2px; font: 600 15px var(--serif-vi); color: var(--paper); }
.tg-sidenote { margin: 0 0 10px; color: var(--muted); font-size: 11.5px; }
.tg-side svg { width: 100%; height: 96px; display: block; }
.tg-axis { display: flex; justify-content: space-between; color: var(--faint); font-size: 10.5px; margin-top: 4px; }
.tg-aulist { display: flex; flex-direction: column; gap: 2px; }
.tg-au {
  display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; border-radius: 8px;
  text-decoration: none; color: var(--paper);
}
.tg-au:hover { background: var(--surface-2); }
.tg-au-hv { font-weight: 600; font-size: 13.5px; }
.tg-au-zh { color: var(--paper-dim); font-family: var(--serif-zh); font-size: 12.5px; }
.tg-au-n { margin-left: auto; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.d-tag-a { text-decoration: none; }
a.d-tag-a:hover { color: var(--tag-on-fg); border-color: var(--line-strong); }
.d-crowd { margin-top: 6px; }
.d-crowdcap { color: var(--muted); font-size: 11px; margin-right: 2px; align-self: center; }
.d-crowd small { color: var(--faint); font-size: 9.5px; }
.tx-search {
  width: 100%; margin: 14px 0 6px; padding: 11px 16px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--paper);
  font: 500 14px var(--sans); outline: none; box-shadow: 0 1px 0 var(--sh-1);
}
.tx-search:focus { border-color: var(--brass-2); }
.tx-cap { margin: 18px 0 8px; font: 600 13px var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.tx-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.tx-chip {
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--paper-dim); font-size: 12.5px; text-decoration: none; background: var(--surface);
  display: inline-flex; align-items: baseline; gap: 6px;
}
.tx-chip:hover { border-color: var(--line-strong); color: var(--tag-on-fg); }
.tx-chip i { font-style: normal; font-family: var(--serif-zh); color: var(--faint); font-size: 11.5px; }
.tx-chip small { color: var(--faint); font-size: 10px; }
.tx-top .tx-chip { font-size: 14px; padding: 7px 15px; }
.tx-top .tx-chip i { font-size: 12.5px; }
.tagrow a.tagrow-all {
  font: 500 12px var(--sans); color: var(--brass); border: 1px dashed var(--line-strong);
  border-radius: 999px; padding: 4px 11px; text-decoration: none; transition: all .15s;
}
.tagrow a.tagrow-all:hover { color: var(--cinnabar); border-color: var(--cinnabar); }
