/* Biên Khảo Kinh Văn — frontend (đọc học thuật, Á Đông tinh giản) */
:root {
  --cr-ink: #0f172a;
  --cr-ink-soft: #334155;
  --cr-navy: #1e3a4f;
  --cr-teal: #2d6a6b;
  --cr-teal-soft: #3d8a8c;
  --cr-muted: #64748b;
  --cr-body: #3f454d;
  --cr-line: rgba(15, 23, 42, 0.09);
  --cr-line-strong: rgba(15, 23, 42, 0.14);
  --cr-pali: #1e293b;
  --cr-paper: #faf8f4;
  --cr-paper-elevated: rgba(255, 255, 255, 0.88);
  --cr-warm: #f5f0e8;
  --cr-gold: #b8860b;
  --cr-radius: 16px;
  --cr-radius-sm: 12px;
  --cr-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --cr-shadow-lg: 0 20px 50px rgba(26, 58, 74, 0.1);
  --cr-font: "Noto Sans", "Inter", system-ui, -apple-system, sans-serif;
  --cr-serif: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  /* Nội dung học thuật — Pāli / Latin (Vi·En) / Hán */
  --cr-font-pali: "Gentium Plus", serif;
  --cr-font-body-serif: "Noto Serif", Georgia, "Times New Roman", serif;
  --cr-font-han: "BabelStoneHan", "Noto Serif SC", "Songti SC", serif;
}

/* Hán — file đặt tại public/assets/fonts/BabelStoneHan.ttf */
@font-face {
  font-family: "BabelStoneHan";
  src: url("/assets/fonts/BabelStoneHan.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

.font-gentium {
  font-family: "Gentium Plus", serif;
}

.font-noto {
  font-family: "Noto Serif", serif;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --------------------------------------------------------------------------- */
/* Trang chi tiết — nền & watermark */
/* --------------------------------------------------------------------------- */
.cr-detail-shell {
  --cr-cover: none;
  position: relative;
  isolation: isolate;
  min-height: 60vh;
  background-color: var(--cr-paper);
}
/* absolute (không dùng fixed): fixed + inset:0 phủ cả viewport → lớp gradient đè header, menu bị mờ */
.cr-detail-shell--has-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--cr-cover);
  background-size: cover;
  background-position: center top;
  opacity: 0.055;
  filter: saturate(0.85);
}
.cr-detail-shell--has-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    165deg,
    rgba(250, 248, 244, 0.94) 0%,
    rgba(252, 250, 246, 0.88) 35%,
    rgba(248, 245, 238, 0.92) 100%
  );
}
.cr-page--detail {
  position: relative;
  z-index: 1;
}

/* Trang nghiên cứu — nhấn mạnh khối học thuật (không chỉ “đọc bài”) */
.cr-page--research .cr-detail-head {
  padding-bottom: 1.25rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--cr-line-strong);
}
.cr-page--research .cr-section--panel {
  border-radius: var(--cr-radius);
  border-color: var(--cr-line-strong);
}

.cr-page {
  font-family: var(--cr-font);
  color: var(--cr-body);
  max-width: 1220px;
  margin: 0 auto;
  padding: clamp(1rem, 2.5vw, 1.75rem) clamp(1rem, 3vw, 1.5rem) clamp(3rem, 7vw, 5rem);
}

/* Trang Biên Khảo — gần full width viewport (bỏ max-width 1680/1720, lề tối thiểu) */
body.cr-bien-khao-wide #main .container {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-top: clamp(1.25rem, 3vw, 2.5rem);
  padding-bottom: clamp(1.5rem, 4vw, 3rem);
  padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}
/* Giống trang Đại Tạng Hán (taisho): nới + căn giữa khối nội dung */
body.cr-bien-khao-wide #main .container:has(.cr-bk-coll-page) {
  max-width: min(96vw, 1500px);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 2.5vw, 2rem);
  padding-right: clamp(1rem, 2.5vw, 2rem);
}
@media (min-width: 1600px) {
  body.cr-bien-khao-wide #main .container:has(.cr-bk-coll-page) {
    max-width: min(92vw, 1680px);
  }
}
@media (min-width: 480px) {
  body.cr-bien-khao-wide #main .container {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }
}
body.cr-bien-khao-wide .cr-page {
  max-width: none;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  padding-left: clamp(0.15rem, 0.8vw, 0.5rem);
  padding-right: clamp(0.15rem, 0.8vw, 0.5rem);
  padding-top: clamp(0.75rem, 2vw, 1.5rem);
  padding-bottom: clamp(2rem, 5vw, 4rem);
  box-sizing: border-box;
}
@media (min-width: 960px) {
  body.cr-bien-khao-wide .cr-detail-grid {
    grid-template-columns: minmax(176px, 232px) minmax(0, 1fr);
    gap: 1.75rem 2.25rem;
  }
}
@media (min-width: 1200px) {
  body.cr-bien-khao-wide .cr-detail-grid {
    grid-template-columns: minmax(188px, 248px) minmax(0, 1fr);
    gap: 2rem 2.75rem;
  }
}
body.cr-bien-khao-wide .cr-detail-cover {
  max-width: min(100%, 760px);
}
body.cr-bien-khao-wide .cr-breadcrumb {
  font-size: 1.2rem;
}
body.cr-bien-khao-wide .cr-detail-lead {
  font-size: 1.6rem;
  max-width: none;
}
body.cr-bien-khao-wide .cr-toc-link {
  font-size: 1.2rem;
}
body.cr-bien-khao-wide .cr-toc-title {
  font-size: 1rem;
}

/* Breadcrumb */
.cr-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.875rem;
  color: var(--cr-muted);
  margin-bottom: 1.75rem;
  line-height: 1.45;
}
.cr-breadcrumb a {
  color: var(--cr-ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}
.cr-breadcrumb a:hover {
  color: var(--cr-teal);
  border-bottom-color: rgba(45, 106, 107, 0.35);
}
.cr-breadcrumb-sep {
  color: #cbd5e1;
  user-select: none;
}
.cr-breadcrumb-current {
  color: var(--cr-muted);
  max-width: 100%;
}

/* --------------------------------------------------------------------------- */
/* Layout chi tiết: TOC + nội dung */
/* --------------------------------------------------------------------------- */
.cr-detail-grid {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 960px) {
  .cr-detail-grid {
    grid-template-columns: minmax(200px, 248px) minmax(0, 1fr);
    gap: 2rem 2.5rem;
  }
}

.cr-detail-toc-wrap {
  position: relative;
}
@media (min-width: 960px) {
  .cr-detail-toc-wrap {
    position: sticky;
    top: calc(1rem + max(0px, env(safe-area-inset-top)));
    align-self: start;
  }
}

.cr-toc-card {
  border: 1px solid var(--cr-line);
  padding: 1.15rem 1.2rem 1.25rem;
  background: var(--cr-paper-elevated);
  backdrop-filter: blur(10px);
  box-shadow: var(--cr-shadow);
}
.cr-toc-title {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--cr-muted);
  margin: 0 0 0.85rem;
}
.cr-toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: cr-toc;
}
.cr-toc-list li {
  counter-increment: cr-toc;
  border-bottom: 1px solid var(--cr-line);
}
.cr-toc-list li:last-child {
  border-bottom: 0;
}
.cr-toc-link {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.55rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cr-ink-soft);
  text-decoration: none !important;
  border-radius: 6px;
  margin: 0 -0.25rem;
  padding-left: 1.25rem;
  padding-right: 0.25rem;
  transition: color 0.2s, background 0.2s;
}
.cr-toc-link::before {
  content: counter(cr-toc, decimal-leading-zero);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--cr-teal);

  font-variant-numeric: tabular-nums;
  min-width: 1.25rem;
}
.cr-toc-link:hover {
  color: var(--cr-teal);
  background: rgba(45, 106, 107, 0.06);
}
.cr-toc-link.is-active {
  color: var(--cr-navy);
  background: rgba(45, 106, 107, 0.1);
}

@media (max-width: 959px) {
  .cr-toc-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .cr-toc-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .cr-toc-list li {
    border: 0;
  }
  .cr-toc-link {
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--cr-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    font-size: 0.82rem;
  }
  .cr-toc-link::before {
    display: none;
  }
}

.cr-detail-main {
  min-width: 0;
}

/* Header bài */
.cr-detail-head {
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}
.cr-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 1rem;
}
.cr-detail-time {
  font-size: 1.2rem;
  color: var(--cr-muted);
  font-variant-numeric: tabular-nums;
}
.cr-detail-title {
  font-family: var(--cr-serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  color: var(--cr-navy);
  margin: 0 0 0.65rem;
  line-height: 1.18;
  letter-spacing: -0.02em;
}
.cr-detail-lead {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--cr-ink-soft);
  max-width: 52rem;
  margin: 0 0 1.25rem;
}

.cr-detail-cover {
  margin: 0;
  border-radius: var(--cr-radius);
  overflow: hidden;
  box-shadow: var(--cr-shadow-lg);
  border: 1px solid var(--cr-line);
  max-width: min(100%, 760px);
}
.cr-detail-cover img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}
@media (max-width: 768px) {
  .cr-detail-cover,
  body.cr-bien-khao-wide .cr-detail-cover {
    max-width: 100%;
  }
}

.cr-detail-sections {
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 4vw, 2.5rem);
}

/* Sections & panel */
.cr-section {
  scroll-margin-top: calc(96px + env(safe-area-inset-top));
}
.cr-section--panel {
  border: 1px solid var(--cr-line);
  padding: 1.5rem 1.65rem 1.65rem;
  backdrop-filter: blur(8px);
}
.cr-section--sources {
  border: 1px solid var(--cr-line);
  border-radius: var(--cr-radius);
  padding: 1.35rem 1.5rem 1.5rem;
  background: var(--cr-paper-elevated);
  box-shadow: var(--cr-shadow);
}

/* Nguồn & Bản quyền — tone giấy ngà, serif, tối giản */
.cr-section--copyright {
  margin-top: 1.25rem;
  border: 1px solid var(--cr-line);
  border-radius: var(--cr-radius-sm);
  padding: 1.15rem 1.3rem 1.25rem;
  background: #f8f6f2;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.cr-section--copyright .cr-section-head {
  margin-bottom: 0.6rem;
}
.cr-section--copyright .cr-section-title {
  font-family: var(--cr-font-body-serif);
  font-size: clamp(1.12rem, 1.85vw, 1.42rem);
  font-weight: 700;
}
.cr-copyright-emoji {
  margin-right: 0.2rem;
}
.cr-copyright {
  font-family: var(--cr-font-body-serif);
  color: var(--cr-ink-soft);
}
.cr-copyright-summary {
  margin: 0 0 0.75rem;
}
.cr-copyright-summary-line {
  margin: 0 0 0.35rem;
  font-size: clamp(0.9rem, 1.3vw, 1.05rem);
  line-height: 1.55;
}
.cr-copyright-summary-line:last-child {
  margin-bottom: 0;
}
.cr-copyright-oneline__label {
  font-weight: 600;
  color: var(--cr-navy);
}
.cr-copyright-link {
  color: var(--cr-teal);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  word-break: break-all;
}
.cr-copyright-link:hover {
  color: #1d4f50;
}
.cr-copyright-toggle {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(45, 106, 107, 0.32);
  background: rgba(255, 255, 255, 0.75);
  color: var(--cr-teal);
  font-size: 1.2rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cr-copyright-toggle:hover {
  background: #fff;
  border-color: var(--cr-teal);
  color: #1d4f50;
}
.cr-copyright-toggle:focus-visible {
  outline: 2px solid rgba(45, 106, 107, 0.45);
  outline-offset: 2px;
}
.cr-copyright-details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cr-line);
}
.cr-copyright-details[hidden] {
  display: none !important;
}
.cr-copyright-card {
  margin-bottom: 1rem;
}
.cr-copyright-card:last-child {
  margin-bottom: 0;
}
.cr-copyright-h {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cr-muted);
  font-family: var(--cr-font-body-serif);
}
.cr-copyright-p {
  margin: 0;
  font-size: clamp(0.93rem, 1.4vw, 1.4rem);
  line-height: 1.65;
}
.cr-copyright-license-badge {
  margin: 0 0 0.9rem;
}
.cr-copyright-license-img {
  display: block;
  max-width: min(100%, 420px);
  width: auto;
  height: auto;
}

.cr-section-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
  border: 0;
  padding: 0;
}
.cr-section-mark {
  width: 2px;
  align-self: stretch;
  min-height: 1.5rem;
  background: linear-gradient(180deg, var(--cr-teal), var(--cr-teal-soft));
  border-radius: 2px;
  flex-shrink: 0;
  margin-top: 0.2rem;
}
.cr-section-title {
  font-family: var(--cr-serif);
  font-size: clamp(1.45rem, 2.35vw, 1.85rem);
  color: var(--cr-navy);
  margin: 0;
  font-weight: 700;
  line-height: 1.25;
}

.cr-panel {
  margin-top: 0.25rem;
}

/* Mục nhiều tab (Chú giải / Tham chiếu / Sơ khảo): phóng chữ + font Vi·An / Hán */
.cr-panel--with-tab-font {
  --cr-tab-font-scale: 1;
}
.cr-tab-font-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--cr-radius-sm);
  border: 1px solid var(--cr-line-strong);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.96), rgba(248, 246, 240, 0.88));
}
.cr-panel--with-tab-font .cr-tab-panel .cr-prose:not(.cr-prose--zh) {
  font-family: var(--cr-font-body-serif);
  font-size: calc(2rem * var(--cr-tab-font-scale, 1));
}
.cr-panel--with-tab-font .cr-tab-panel .cr-prose.cr-prose--zh {
  font-family: var(--cr-font-han);
  font-size: calc(2.2rem * var(--cr-tab-font-scale, 1));
}
.cr-panel--with-tab-font .cr-tab-panel .cr-empty {
  font-size: calc(1.05rem * var(--cr-tab-font-scale, 1));
}

/* --------------------------------------------------------------------------- */
/* Ghi chép kinh văn — so sánh song song (1 / 2 / 4 cột) */
/* --------------------------------------------------------------------------- */
.cr-panel--scripture {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.cr-section--scripture.cr-section--panel {
  border-radius: var(--cr-radius);
}

/* Control bar — một hệ thống: ngôn ngữ gốc · bản dịch · chế độ xem */
.cr-scripture-control {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--cr-radius-sm);
  border: 1px solid var(--cr-line-strong);
}
.cr-scripture-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem 1.5rem;
  align-items: end;
}
.cr-scripture-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}
.cr-scripture-control-group--view {
  grid-column: 1 / -1;
}
.cr-scripture-control-label {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cr-muted);
}
.cr-scripture-select {
  width: 100%;
  max-width: 22rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--cr-radius-sm);
  border: 1px solid var(--cr-line);
  background: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cr-navy);
  font-family: inherit;
}
.cr-scripture-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.cr-scripture-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--cr-ink-soft);
  cursor: pointer;
  user-select: none;
}
.cr-scripture-check input {
  width: 1.5rem;
  height: 1.5rem;
  accent-color: var(--cr-teal);
}
.cr-scripture-check--empty {
  opacity: 0.45;
  cursor: not-allowed;
}
.cr-scripture-font-zoom {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.cr-scripture-font-btn {
  min-width: 2.5rem;
  padding: 0.4rem 0.55rem;
  border-radius: var(--cr-radius-sm);
  border: 1px solid var(--cr-line);
  background: rgba(255, 255, 255, 0.95);
  color: var(--cr-navy);
  font-size: 1.05rem;
  font-weight: 800;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cr-scripture-font-btn:hover {
  border-color: rgba(45, 106, 107, 0.45);
  color: var(--cr-teal);
}
.cr-scripture-font-btn:focus-visible {
  outline: 2px solid rgba(45, 106, 107, 0.45);
  outline-offset: 2px;
}
.cr-scripture-font-value {
  min-width: 3.25rem;
  padding: 0.4rem 0.45rem;
  border-radius: var(--cr-radius-sm);
  border: 1px dashed var(--cr-line);
  background: rgba(248, 246, 240, 0.65);
  color: var(--cr-muted);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-align: center;
}
.cr-scripture-font-value:hover {
  border-color: rgba(45, 106, 107, 0.35);
  color: var(--cr-navy);
}
[data-cr-scripture-compare] {
  --cr-scripture-font-scale: 1;
}
.cr-scripture-view-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.cr-scripture-view-btn {
  border: 1px solid var(--cr-line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--cr-muted);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-size: 1.38rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.cr-scripture-view-btn:hover {
  color: var(--cr-navy);
  border-color: rgba(45, 106, 107, 0.35);
}
.cr-scripture-view-btn.is-active {
  color: var(--cr-navy);
  border-color: rgba(45, 106, 107, 0.55);
  background: #fff;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
}
.cr-scripture-grid {
  display: grid;
  gap: 1rem 1.25rem;
  align-items: start;
}
.cr-scripture-grid[data-cr-view-mode="compare"] {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.cr-scripture-grid[data-cr-view-mode="compare"] .cr-scripture-cell--primary {
  grid-column: 1;
  grid-row: 1;
}
.cr-scripture-grid[data-cr-view-mode="compare"] .cr-scripture-cell--vi,
.cr-scripture-grid[data-cr-view-mode="compare"] .cr-scripture-cell--en,
.cr-scripture-grid[data-cr-view-mode="compare"] .cr-scripture-cell--zh {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
}

.cr-scripture-grid[data-cr-view-mode="scholar"] {
  grid-template-columns: repeat(var(--cr-scholar-cols, 2), minmax(0, 1fr));
}

.cr-scripture-grid[data-cr-view-mode="read"] {
  grid-template-columns: minmax(0, 1fr);
}
.cr-scripture-grid[data-cr-view-mode="read"] .cr-scripture-cell--primary,
.cr-scripture-grid[data-cr-view-mode="read"] .cr-scripture-cell--vi,
.cr-scripture-grid[data-cr-view-mode="read"] .cr-scripture-cell--en,
.cr-scripture-grid[data-cr-view-mode="read"] .cr-scripture-cell--zh {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}

.cr-scripture-cell {
  margin: 0;
  padding: 1rem 1.1rem 1.15rem;
  border-radius: var(--cr-radius-sm);
  background: #fff;
  min-width: 0;
}
.cr-scripture-cell-head {
  margin: 0 0 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--cr-line);
}
.cr-scripture-cell-kicker {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cr-muted);
  margin-bottom: 0.15rem;
}
.cr-scripture-cell-title {
  margin: 0;
  font-family: var(--cr-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cr-navy);
  line-height: 1.25;
}
/* Việt / Anh: chỉ .cr-prose; Pāli: --pali; Trung: --zh */
.cr-scripture-cell-body .cr-prose {
  font-family: var(--cr-font-body-serif);
  font-size: calc(clamp(1.05rem, 1.9vw, 1.35rem) * var(--cr-scripture-font-scale, 1));
  line-height: 1.85;
}
.cr-scripture-cell-body .cr-prose.cr-prose--pali {
  font-family: var(--cr-font-pali);
  font-size: calc(clamp(1.1rem, 2vw, 1.45rem) * var(--cr-scripture-font-scale, 1));
  line-height: 1.9;
  color: var(--cr-pali);
}
.cr-scripture-cell-body .cr-prose.cr-prose--zh {
  font-family: var(--cr-font-han);
  font-size: calc(clamp(1.05rem, 1.9vw, 1.35rem) * var(--cr-scripture-font-scale, 1));
}
.cr-scripture-cell-body .cr-empty {
  font-size: calc(0.95rem * var(--cr-scripture-font-scale, 1));
}

@media (max-width: 1100px) {
  .cr-scripture-grid[data-cr-view-mode="scholar"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cr-scripture-grid[data-cr-view-mode="scholar"] .cr-scripture-cell--primary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .cr-scripture-control-grid {
    grid-template-columns: 1fr;
  }
  .cr-scripture-grid[data-cr-view-mode="compare"] {
    grid-template-columns: 1fr;
  }
  .cr-scripture-grid[data-cr-view-mode="compare"] .cr-scripture-cell--primary,
  .cr-scripture-grid[data-cr-view-mode="compare"] .cr-scripture-cell--vi,
  .cr-scripture-grid[data-cr-view-mode="compare"] .cr-scripture-cell--en,
  .cr-scripture-grid[data-cr-view-mode="compare"] .cr-scripture-cell--zh {
    grid-column: 1;
    grid-row: auto;
  }
  .cr-scripture-grid[data-cr-view-mode="scholar"] {
    grid-template-columns: 1fr;
  }
}

/* Segmented tabs — cỡ lớn hơn, dễ đọc & bấm */
.cr-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0;
  padding: 0.45rem 0.5rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--cr-line);
}
.cr-tabs--segmented {
  width: fit-content;
  max-width: 100%;
}
.cr-tab {
  border: 0;
  background: transparent;
  color: var(--cr-muted);
  padding: 0.82rem 1.55rem;
  border-radius: 999px;
  font-size: 1.125rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.35;
  min-height: 3.15rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.cr-tab:hover {
  color: var(--cr-ink-soft);
  background: rgba(255, 255, 255, 0.65);
}
.cr-tab[aria-selected="true"] {
  background: #fff;
  color: var(--cr-navy);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.1);
}
@media (max-width: 560px) {
  .cr-tabs--segmented {
    width: 100%;
    border-radius: var(--cr-radius-sm);
    flex-direction: column;
    align-items: stretch;
  }
  .cr-tab {
    border-radius: var(--cr-radius-sm);
    text-align: left;
    font-size: 1.05rem;
    min-height: 2.95rem;
  }
}

.cr-tab-panel {
  display: none;
  margin-top: 1.1rem;
  padding: 1.35rem 1.45rem;
  border-radius: var(--cr-radius-sm);
  border: 1px solid var(--cr-line);
  background: #fff;
  min-height: 100px;
}
.cr-tab-panel.is-active {
  display: block;
}

.cr-empty {
  margin: 0;
  color: var(--cr-muted);
  font-style: italic;
  font-size: 1.05rem;
}

.cr-badge {
  display: inline-block;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.cr-badge--updating {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.14), rgba(251, 191, 36, 0.12));
  color: #9a3412;
  border: 1px solid rgba(217, 119, 6, 0.2);
}
.cr-badge--done {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.12), rgba(34, 197, 94, 0.1));
  color: #166534;
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.cr-prose {
  font-family: var(--cr-font-body-serif);
  font-size: 2rem;
  line-height: 1.9;
  color: var(--cr-ink-soft);
}
.cr-prose p:first-child {
  margin-top: 0;
}
.cr-prose p:last-child {
  margin-bottom: 0;
}
.cr-prose.cr-prose--pali {
  font-family: var(--cr-font-pali);
  font-size: 2.2rem;
  color: var(--cr-pali);
  line-height: 1.94;
}
.cr-prose.cr-prose--zh {
  font-family: var(--cr-font-han);
  font-size: 2.2rem;
  line-height: 2;
}

/* Đối chiếu — lưới song song (soạn thảo: <div class="cr-parallel">…) */
.cr-prose--comparative .cr-parallel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
  margin: 1rem 0;
}
.cr-prose--comparative .cr-parallel__col {
  border-left: 3px solid rgba(45, 106, 107, 0.35);
  padding-left: 1rem;
  min-width: 0;
}
@media (max-width: 720px) {
  .cr-prose--comparative .cr-parallel {
    grid-template-columns: 1fr;
  }
}

/* Trích dẫn đối chiếu dạng thẻ (khi không dùng cr-parallel) */
.cr-prose--comparative blockquote.cr-compare-quote {
  margin: 1rem 0;
  padding: 1rem 1.15rem 1rem 1.35rem;
  border-left: 4px solid rgba(45, 106, 107, 0.55);
  border-radius: 0 var(--cr-radius-sm) var(--cr-radius-sm) 0;
  background: rgba(45, 106, 107, 0.06);
  font-size: 0.95em;
  color: var(--cr-ink-soft);
}
.cr-prose--comparative blockquote.cr-compare-quote cite {
  display: block;
  margin-top: 0.65rem;
  font-size: 0.88em;
  font-style: normal;
  font-weight: 700;
  color: var(--cr-navy);
  letter-spacing: 0.02em;
}

/* Sơ khảo — mục lục phụ */
.cr-analysis-root {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cr-subtoc--analysis {
  font-size: 0.88rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--cr-line);
  border-radius: var(--cr-radius-sm);
  background: rgba(255, 255, 255, 0.82);
}
.cr-subtoc--analysis .cr-subtoc__label {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--cr-muted);
}
.cr-subtoc--analysis ol {
  margin: 0.35rem 0 0;
  padding-left: 1.35rem;
}
.cr-subtoc--analysis li {
  margin: 0.2rem 0;
}
.cr-subtoc--analysis a {
  color: var(--cr-teal);
  text-decoration: none;
  font-weight: 600;
}
.cr-subtoc--analysis a:hover {
  text-decoration: underline;
}
.cr-prose--analysis h2,
.cr-prose--analysis h3 {
  scroll-margin-top: calc(96px + env(safe-area-inset-top));
}

/* Tài liệu tham khảo */
.cr-sources {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cr-source-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.15rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--cr-line);
}
.cr-source-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.cr-source-item:first-child {
  padding-top: 0;
}
.cr-source-num {
  font-family: var(--cr-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: #cbd5e1;
  line-height: 1.2;
}
.cr-source-body {
  min-width: 0;
}
.cr-source-type {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--cr-teal);
  margin-bottom: 0.35rem;
}
.cr-source-title {
  font-weight: 700;
  color: var(--cr-navy);
  margin: 0 0 0.35rem;
  font-size: 1.06rem;
  line-height: 1.4;
}
.cr-source-meta {
  font-size: 0.9rem;
  color: var(--cr-muted);
  margin: 0.2rem 0;
  word-break: break-word;
}
.cr-source-meta a {
  color: var(--cr-teal);
  text-decoration: none;
  border-bottom: 1px solid rgba(45, 106, 107, 0.25);
}
.cr-source-meta a:hover {
  border-bottom-color: var(--cr-teal);
}
.cr-source-note {
  font-size: 0.92rem;
  color: #64748b;
  margin-top: 0.4rem;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------- */
/* Trang landing */
/* --------------------------------------------------------------------------- */
.cr-hero {
  text-align: center;
  padding-bottom: clamp(1.75rem, 4vw, 2.75rem);
  border-bottom: 1px solid var(--cr-line);

  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}
.cr-hero-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cr-muted);
  margin: 0 0 0.5rem;
  font-weight: 700;
}
.cr-hero-title {
  font-family: var(--cr-serif);
  font-size: clamp(2.1rem, 3.6vw, 2.85rem);
  color: var(--cr-navy);
  margin: 0 0 0.75rem;
  font-weight: 700;
  line-height: 1.2;
}
.cr-hero-lead {
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.8;
  font-size: 1.08rem;
  color: var(--cr-ink-soft);
}
.cr-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2rem;
  margin-top: 1.5rem;
  font-size: 1.45rem;
  color: var(--cr-muted);
}
.cr-stats strong {
  font-weight: 700;
  color: var(--cr-ink);
  font-variant-numeric: tabular-nums;
}

.cr-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.35rem);
}
@media (max-width: 820px) {
  .cr-cat-grid {
    grid-template-columns: 1fr;
  }
}

.cr-cat-card {
  display: block;
  text-decoration: none !important;
  color: inherit;
  border: 1px solid var(--cr-line);
  border-radius: var(--cr-radius);
  padding: 1.4rem 1.5rem;
  background: var(--cr-paper-elevated);
  box-shadow: var(--cr-shadow);
  transition: box-shadow 0.35s ease, transform 0.35s ease, border-color 0.25s ease;
  min-height: 120px;
}
.cr-cat-card:hover {
  box-shadow: var(--cr-shadow-lg);
  transform: translateY(-3px);
  border-color: rgba(45, 106, 107, 0.35);
}
.cr-cat-card__label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cr-teal);
  font-weight: 800;
  margin: 0 0 0.5rem;
}
.cr-cat-card__title {
  font-family: var(--cr-serif);
  font-size: 1.35rem;
  color: var(--cr-navy);
  margin: 0 0 0.5rem;
  font-weight: 700;
  line-height: 1.35;
}
.cr-cat-card__desc {
  margin: 0;
  font-size: 0.92rem;
  color: var(--cr-muted);
  line-height: 1.55;
}

.cr-landing-cats-head {
  margin-bottom: 0.55rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.cr-book-shelf {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 1rem;
  align-items: start;
}

.cr-book-shelf__item {
  text-decoration: none !important;
  color: inherit;
  min-width: 0;
}

.cr-book-shelf__cover {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  background: #fff;
}

.cr-book-shelf__cover img {
  width: 100%;
  aspect-ratio: 9 / 13;
  object-fit: cover;
  display: block;
}

.cr-book-shelf__title {
  display: block;
  margin-top: 0.55rem;
  font-family: var(--cr-serif);
  font-size: 1.55rem;
  line-height: 1.35;
  color: var(--cr-navy);
}

.cr-book-shelf__meta {
  display: grid;
  gap: 0.18rem;
  margin-top: 0.45rem;
  font-size: 1.22rem;
  color: #6b7280;
  line-height: 1.4;
}
.cr-book-shelf__meta strong {
  color: #1f2937;
  font-weight: 700;
}

.cr-cat-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  max-width: 1100px;
  margin: 0 auto;
}

.cr-cat-rich-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 0.9rem;
  text-decoration: none !important;
  color: inherit;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  padding: 0.8rem 0.95rem;
  min-height: 210px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
  position: relative;
  overflow: hidden;
}

.cr-cat-rich-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
  border-color: var(--cr-accent);
}

.cr-cat-rich-card__media {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--cr-accent) 28%, rgba(148, 163, 184, 0.28));

  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.cr-cat-rich-card__media::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  z-index: 1;
}

.cr-cat-rich-card__media img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  display: block;
}

.cr-cat-rich-card__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cr-cat-rich-card__top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.18rem;
}

.cr-cat-rich-card__icon {
  font-size: 1rem;
  line-height: 1;
}

.cr-cat-rich-card__kicker {
  color: var(--cr-accent);
  font-size: 0.74rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 700;
}

.cr-cat-rich-card__title {
  margin: 0.05rem 0 0;
  font-family: var(--cr-serif);
  color: var(--cr-navy);
  font-size: 1.2rem;
  line-height: 1.25;
}

.cr-cat-rich-card__desc {
  margin: 0.22rem 0 0;
  color: var(--cr-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.cr-cat-rich-card__stats {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.55rem;
  font-size: 0.76rem;
  color: #475569;
}

.cr-cat-rich-card__stats strong {
  color: var(--cr-accent);
  font-weight: 700;
}

@media (max-width: 860px) {
  .cr-book-shelf { gap: 0.65rem; }
  .cr-cat-rich-card {
    grid-template-columns: 120px minmax(0, 1fr);
    min-height: 190px;
  }
}

.cr-categories-table-wrap {
  border: 1px solid var(--cr-line);
  border-radius: var(--cr-radius);
  background: #fff;
  box-shadow: var(--cr-shadow);
  overflow: hidden;
}
.cr-categories-table-head {
  padding: 1rem 1.2rem 0.85rem;
  border-bottom: 1px solid var(--cr-line);
  background: rgba(248, 250, 252, 0.65);
}
.cr-categories-table-note {
  margin: 0.35rem 0 0;
  color: var(--cr-muted);
  font-size: 0.92rem;
}
.cr-categories-table-scroll {
  overflow: auto;
}
.cr-categories-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}
.cr-categories-table th,
.cr-categories-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--cr-line);
  font-size: 0.92rem;
  text-align: left;
  vertical-align: middle;
}
.cr-categories-table th {
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--cr-muted);
  font-weight: 700;
  background: rgba(248, 250, 252, 0.45);
}
.cr-categories-table__thumb {
  width: 72px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--cr-line);
  background: var(--cr-warm);
}
.cr-categories-table__title {
  color: var(--cr-navy);
  font-weight: 700;
  line-height: 1.35;
}
.cr-categories-table__desc {
  margin-top: 0.2rem;
  color: var(--cr-muted);
  line-height: 1.45;
  font-size: 0.84rem;
}
.cr-categories-table__status {
  display: inline-block;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(22, 163, 74, 0.24);
  background: rgba(22, 163, 74, 0.09);
  color: #166534;
  font-size: 0.76rem;
  font-weight: 700;
}

/* --------------------------------------------------------------------------- */
/* Danh sách chuyên mục */
/* --------------------------------------------------------------------------- */
.cr-list-hero {
  border-left: 3px solid var(--cr-teal);
  padding-left: 1.25rem;
  margin-bottom: 1.75rem;
}
.cr-list-title {
  font-family: var(--cr-serif);
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  color: var(--cr-navy);
  margin: 0 0 0.5rem;
}
.cr-list-desc {
  margin: 0;
  color: var(--cr-muted);
  line-height: 1.65;
  max-width: 720px;
}

/* --------------------------------------------------------------------------- */
/* Trang chuyên mục Biên Khảo — layout giống /chinese-canon/taisho-shinshu-daizokyo */
/* --------------------------------------------------------------------------- */
.cr-bk-coll-page {
  --bk-navy: #17324d;
  --bk-ink: #1a2332;
  --bk-muted: #6b6a63;
  --bk-gold: #a68b4a;
  position: relative;
  min-height: 50vh;
  font-family: "Inter", system-ui, sans-serif;
  color: #3d3d38;
  overflow-x: hidden;
  margin: 0 calc(-1 * clamp(0.15rem, 0.8vw, 0.5rem));
  padding: 0 clamp(0.15rem, 0.8vw, 0.5rem) 1rem;
  box-sizing: border-box;
}
.cr-bk-coll-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  background: transparent;
}
.cr-bk-coll-bg__wash {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}
.cr-bk-coll-bg__wash--a {
  width: min(90vw, 52rem);
  height: min(90vw, 52rem);
  left: -18%;
  top: -8%;
  background: radial-gradient(circle, rgba(30, 77, 95, 0.14) 0%, transparent 68%);
}
.cr-bk-coll-bg__wash--b {
  width: min(80vw, 42rem);
  height: min(80vw, 42rem);
  right: -12%;
  bottom: 5%;
  background: radial-gradient(circle, rgba(166, 139, 74, 0.09) 0%, transparent 65%);
}
.cr-bk-coll-bg__orbit {
  position: absolute;
  left: -4rem;
  top: 16%;
  width: min(32rem, 75vw);
  height: min(32rem, 75vw);
  border-radius: 50%;
  border: 1px solid rgba(120, 113, 97, 0.12);
  opacity: 0.85;
}
.cr-bk-coll-bg__orbit::after {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 1px solid rgba(120, 113, 97, 0.06);
}
.cr-bk-coll-inner {
  position: relative;
  z-index: 1;
  max-width: min(100%, 1680px);
  width: 100%;
  margin: 0 auto;
  padding: clamp(1.75rem, 4vw, 3rem) clamp(0.5rem, 2vw, 1.5rem) clamp(2.5rem, 6vw, 4rem);
}
.cr-bk-coll-breadcrumb {
  font-size: clamp(0.88rem, 1.1vw, 1.02rem);
  letter-spacing: 0.05em;
  color: #8a877c;
  margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
}
.cr-bk-coll-breadcrumb a {
  color: #6f6c62;
  text-decoration: none;
  transition: color 0.2s ease;
}
.cr-bk-coll-breadcrumb a:hover {
  color: var(--bk-ink);
}
.cr-bk-coll-bc-dot {
  margin: 0 0.5rem;
  color: #c4bfb2;
  font-weight: 300;
}
.cr-bk-coll-bc-current {
  color: #4a4840;
  font-weight: 500;
}
.cr-bk-coll-hero-grid {
  display: grid;
  gap: clamp(2rem, 4vw, 2.9rem);
  align-items: start;
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  .cr-bk-coll-hero-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }
}
.cr-bk-coll-hero-main {
  position: relative;
  padding: 0 0 0 clamp(0.75rem, 2vw, 1.35rem);
}
.cr-bk-coll-hero-aside {
  width: fit-content;
  max-width: 100%;
}
@media (min-width: 1024px) {
  .cr-bk-coll-hero-aside {
    justify-self: end;
    margin-right: -8.4rem;
  }
}
@media (min-width: 640px) {
  .cr-bk-coll-hero-main {
    padding-left: 1.65rem;
  }
}
.cr-bk-coll-hero-accent {
  position: absolute;
  left: 0;
  top: 0.2rem;
  bottom: 2.5rem;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(166, 139, 74, 0.55), rgba(30, 77, 95, 0.18) 55%, transparent);
  opacity: 0.95;
}
.cr-bk-coll-kicker {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
  font-size: clamp(0.72rem, 1vw, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bk-gold);
}
.cr-bk-coll-kicker-line {
  display: block;
  width: 3rem;
  height: 1px;
  background: linear-gradient(90deg, var(--bk-gold), rgba(166, 139, 74, 0.15));
}
.cr-bk-coll-h1 {
  font-family: "Cormorant Garamond", "Noto Serif SC", Georgia, serif;
  font-size: clamp(2.35rem, 5.5vw, 4rem);
  font-weight: 600;
  color: #152433;
  line-height: 1.08;
  margin: 1.35rem 0 0;
  letter-spacing: 0.02em;
}
.cr-bk-coll-hero-rule {
  height: 1px;
  max-width: 16rem;
  margin: clamp(1.35rem, 2.8vw, 2rem) 0 0;
  background: linear-gradient(90deg, rgba(166, 139, 74, 0.55), rgba(30, 77, 95, 0.12), transparent);
  border: 0;
}
.cr-bk-coll-lead-block {
  margin-top: clamp(1.25rem, 2.5vw, 1.85rem);
  max-width: 70rem;
}
.cr-bk-coll-lead-block .cr-bk-coll-lead + .cr-bk-coll-lead {
  margin-top: 1.1em;
}
.cr-bk-coll-lead {
  margin: 0;
  max-width: none;
  font-size: clamp(1.05rem, 1.5vw, 1.68rem);
  line-height: 1.9;
  color: #5a5850;
  font-weight: 400;
}
.cr-bk-coll-lead--rich p {
  margin: 0 0 0.7rem;
}
.cr-bk-coll-lead--rich p:last-child {
  margin-bottom: 0;
}
.cr-bk-coll-lead--rich ul,
.cr-bk-coll-lead--rich ol {
  margin: 0.2rem 0 0.8rem 1.2rem;
}
.cr-bk-coll-lead--rich li {
  margin: 0.15rem 0;
}
.cr-bk-coll-lead--nam-truyen {
  font-size: clamp(0.98rem, 1.18vw, 1.66rem);
  line-height: 2.05;
  text-align: left;
}
.cr-bk-coll-meta-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 0;
  margin: clamp(2rem, 3.8vw, 2.75rem) 0 0;
  padding-top: clamp(1.5rem, 2.8vw, 2rem);
  border-top: 1px solid rgba(90, 88, 80, 0.1);
}
.cr-bk-coll-meta-pair {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 5.5rem;
  padding-right: 1.25rem;
}
.cr-bk-coll-meta-pair dt {
  margin: 0;
  font-family: "Gentium Plus", "Gentium Book Plus", Georgia, serif;
  font-size: clamp(0.65rem, 0.9vw, 1.24rem);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #9c988a;
}
.cr-bk-coll-meta-pair dd {
  margin: 0;
  font-family: "Gentium Plus", "Gentium Book Plus", Georgia, serif;
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
  font-weight: 600;
  color: #2a3540;
  line-height: 1.2;
}
.cr-bk-coll-meta-sep {
  align-self: stretch;
  width: 1px;
  min-height: 3rem;
  margin: 0 0.35rem;
  background: linear-gradient(180deg, transparent, rgba(166, 139, 74, 0.35), transparent);
}
.cr-bk-coll-copyright {
  margin: 1.2rem 0 0;
  font-size: clamp(0.92rem, 1.18vw, 1.3rem);
  line-height: 1.8;
  color: #777468;
}
@media (max-width: 520px) {
  .cr-bk-coll-meta-sep {
    display: none;
  }
  .cr-bk-coll-meta-pair {
    flex: 1 1 42%;
    border-bottom: 1px solid rgba(90, 88, 80, 0.08);
    padding-bottom: 0.85rem;
  }
}
.cr-bk-coll-cover-card {
  width: fit-content;
  max-width: min(100%, 560px);
  border-radius: 1.35rem;
  border: 1px solid rgba(120, 113, 97, 0.15);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 34px rgba(26, 35, 50, 0.08);
  backdrop-filter: blur(4px);
  overflow: hidden;
}
.cr-bk-coll-cover-img-wrap {
  width: min(100%, 660px);
  aspect-ratio: 5 / 6;
  margin: 0 auto;
  overflow: hidden;
  display: block;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  background: transparent;
}
.cr-bk-coll-cover-img {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center;
  background: transparent;
}
.cr-bk-coll-cover-body {
  padding: clamp(1.35rem, 2.5vw, 1.85rem) clamp(1.35rem, 2.5vw, 2rem);
}
.cr-bk-coll-cover-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.cr-bk-coll-cover-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  font-weight: 600;
  color: #1e2d3a;
  margin: 0;
  line-height: 1.2;
}
.cr-bk-coll-cover-tag {
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid rgba(166, 139, 74, 0.45);
  background: rgba(255, 252, 245, 0.9);
  color: #6b5c38;
  font-size: clamp(0.68rem, 0.95vw, 0.78rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.45rem 0.85rem;
}
.cr-bk-coll-cover-desc {
  margin: 1rem 0 0;
  font-size: clamp(0.92rem, 1.2vw, 1.5rem);
  line-height: 1.78;
  color: #6f6d65;
}
.cr-bk-coll-panel--list {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding: 0;
  border: 0;
  background: transparent;
}
.cr-bk-vcat-shell {
  max-width: 1540px;
  margin: 0 auto;
}
.cr-bk-vcat-catalog {
  position: relative;
  padding: clamp(1.25rem, 2.5vw, 2rem) clamp(1rem, 2vw, 1.75rem) clamp(1.25rem, 2vw, 1.5rem);
  z-index: 1;
  font-family: "Inter", system-ui, sans-serif;
}
.cr-bk-vcat-header {
  display: grid;
  grid-template-columns: 1fr minmax(0, 340px);
  gap: 1.25rem;
  align-items: end;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid rgba(176, 138, 71, 0.18);
  margin-bottom: 1.25rem;
}
.cr-bk-vcat-eyebrow {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: #9a5b61;
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.cr-bk-vcat-h1 {
  margin: 0 0 0.5rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  line-height: 1.1;
  font-weight: 600;
  color: #23303a;
}
.cr-bk-vcat-subtitle {
  margin: 0;
  max-width: 46rem;
  color: #6f7a7a;
  font-size: 0.95rem;
  line-height: 1.7;
}
.cr-bk-vcat-search {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(38, 50, 56, 0.08);
  border-radius: 18px;
  padding: 0.5rem 0.85rem;
  min-height: 52px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.cr-bk-vcat-search svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #80909d;
}
.cr-bk-vcat-search input {
  border: 0;
  outline: none;
  width: 100%;
  font-size: 0.9rem;
  background: transparent;
  color: #36454f;
}
.cr-bk-vcat-grid {
  display: grid;
  gap: 1.25rem;
}
.cr-bk-entry-card {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) minmax(120px, 200px);
  min-height: 220px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.78));
  border: 1px solid rgba(176, 138, 71, 0.14);
  box-shadow: 0 18px 40px rgba(26, 44, 58, 0.07);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cr-bk-entry-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 50px rgba(26, 44, 58, 0.1);
}
.cr-bk-entry-spine {
  background-color: #083244;
  background-image: url('/uploads/lotus_enhanced.jpg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  color: #e9f3f7;
  padding: 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.cr-bk-entry-spine small {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 0.35rem;
}
.cr-bk-entry-code {
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0.15rem 0 0.65rem;
}
.cr-bk-entry-count .cr-badge {
  font-size: 0.8rem;
  padding: 0.2rem 0.45rem;
}
.cr-bk-entry-meta-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}
.cr-bk-entry-series {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #cfb06d;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.cr-bk-entry-source {
  font-size: 0.72rem;
  line-height: 1.45;
  opacity: 0.9;
}
.cr-bk-entry-content {
  padding: 1.15rem 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  background: #fff;
}
.cr-bk-entry-code-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #31536b;
  background: rgba(14, 74, 103, 0.08);
  border: 1px solid rgba(14, 74, 103, 0.12);
  padding: 0.22rem 0.5rem;
  border-radius: 6px;
  margin-bottom: 0.35rem;
}
.cr-bk-entry-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.15rem, 2vw, 2.45rem);
  line-height: 1.2;
  margin: 0 0 0.35rem;
  font-weight: 600;
}
.cr-bk-entry-title a {
  color: #1458a8;
  text-decoration: none;
  transition: color 0.2s ease;
}
.cr-bk-entry-title a:hover {
  color: #0d4a8c;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.cr-bk-entry-desc {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.55;
  color: #5c6670;
}
.cr-bk-entry-updated {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: #94a3b8;
}
.cr-bk-entry-actions {
  align-self: flex-end;
  width: 100%;
  max-width: 220px;
}
.cr-bk-entry-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  padding: 0 1.15rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: 0.25s ease;
  box-sizing: border-box;
}
.cr-bk-entry-btn--primary {
  border: 0;
  color: #fff !important;
  background: linear-gradient(135deg, #0d4a67, #1b67a0);
  box-shadow: 0 10px 22px rgba(21, 95, 150, 0.22);
  width: 100%;
}
.cr-bk-entry-btn--primary:hover {
  transform: translateY(-1px);
  color: #fff !important;
}
.cr-bk-entry-art {
  position: relative;
  background: linear-gradient(135deg, #f7f4ee, #f2ede5);
  overflow: hidden;
  min-height: 180px;
}
.cr-bk-entry-art-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 100% 100%;
  opacity: 0.45;
  pointer-events: none;
}
.cr-bk-coll-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--bk-muted);
}
.cr-bk-coll-back {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--bk-navy);
  text-decoration: none;
  font-weight: 500;
}
.cr-bk-coll-back:hover {
  text-decoration: underline;
}
.cr-bk-vcat-pagination {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(176, 138, 71, 0.15);
}
@media (max-width: 1200px) {
  .cr-bk-entry-card {
    grid-template-columns: 180px minmax(0, 1fr);
  }
  .cr-bk-entry-art {
    display: none;
  }
}
@media (max-width: 820px) {
  .cr-bk-vcat-header {
    grid-template-columns: 1fr;
  }
  .cr-bk-entry-card {
    grid-template-columns: 1fr;
  }
  .cr-bk-entry-spine {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }
  .cr-bk-entry-meta-bottom {
    display: none;
  }
  .cr-bk-entry-actions {
    max-width: none;
    align-self: stretch;
  }
}

.cr-search {
  margin: 1.5rem 0 2rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.cr-search input[type="search"] {
  flex: 1 1 240px;
  max-width: 420px;
  padding: 0.6rem 0.95rem;
  border: 1px solid var(--cr-line);
  border-radius: 999px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}
.cr-search input[type="search"]:focus {
  outline: 2px solid rgba(45, 106, 107, 0.25);
  outline-offset: 1px;
}
.cr-search button {
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: 0;
  background: var(--cr-teal);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.2s;
}
.cr-search button:hover {
  filter: brightness(1.06);
}

.cr-dossier {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 1.1rem 1.35rem;
  align-items: center;
  padding: 1.35rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--cr-line);
  border-radius: var(--cr-radius);
  background: var(--cr-paper-elevated);
  box-shadow: var(--cr-shadow);
  transition: box-shadow 0.25s, border-color 0.25s;
}
.cr-dossier:hover {
  border-color: rgba(45, 106, 107, 0.2);
}
@media (max-width: 720px) {
  .cr-dossier {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .cr-dossier__cta {
    justify-self: start;
  }
}

.cr-dossier__side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  min-width: 88px;
}
.cr-dossier__badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--cr-teal);
  text-transform: uppercase;
  line-height: 1.3;
  text-align: center;
}
.cr-dossier__id {
  font-size: 1.5rem;
  font-weight: 800;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.cr-dossier__main {
  min-width: 0;
}
.cr-dossier__thumb {
  width: 88px;
  height: 88px;
  border-radius: var(--cr-radius-sm);
  object-fit: cover;
  background: var(--cr-warm);
  border: 1px solid var(--cr-line);
}
.cr-dossier__title {
  font-family: var(--cr-serif);
  font-size: 1.28rem;
  margin: 0 0 0.35rem;
  color: var(--cr-navy);
  font-weight: 700;
}
.cr-dossier__excerpt {
  margin: 0;
  font-size: 0.95rem;
  color: var(--cr-muted);
  line-height: 1.55;
}
.cr-dossier__meta {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-top: 0.5rem;
}
.cr-dossier__cta .cr-btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(45, 106, 107, 0.4);
  color: var(--cr-teal);
  font-weight: 600;
  text-decoration: none !important;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.2s;
}
.cr-dossier__cta .cr-btn:hover {
  background: rgba(45, 106, 107, 0.08);
}

.cr-pager {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.cr-pager a,
.cr-pager span {
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--cr-line);
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--cr-ink-soft);
}
.cr-pager .active {
  background: rgba(45, 106, 107, 0.12);
  border-color: rgba(45, 106, 107, 0.35);
  font-weight: 700;
}

/* --- Hình ảnh / Tư liệu — thẻ phụ lục: bìa 3:1 + tiêu đề + gợi ý + nút + (flat, bo góc) --- */
.cr-section--gallery.cr-gallery-phv {
  scroll-margin-top: calc(96px + env(safe-area-inset-top));
  margin-bottom: clamp(1.25rem, 3.5vw, 2rem);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.cr-gallery-phv .phv-imglib-widget {
  margin-bottom: 0;
}
.cr-gallery-phv-card {
  max-width: 30%;
  background: #fff;
  border: 1px solid rgba(45, 106, 107, 0.14);
  border-radius: 14px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 10px 40px rgba(30, 58, 79, 0.07);
  overflow: hidden;
}
.cr-gallery-phv-cover {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: #e8edf2;
  cursor: zoom-in;
  overflow: hidden;
  border-radius: 0;
  line-height: 0;
  text-align: left;
  transition: opacity 0.2s ease;
}
.cr-gallery-phv-cover:hover {
  opacity: 0.96;
}
.cr-gallery-phv-cover:focus-visible {
  outline: 2px solid var(--cr-teal);
  outline-offset: 2px;
}
.cr-gallery-phv-cover-img {
  width: 100%;
  aspect-ratio: 3 / 1;
  height: auto;
  max-height: min(52vh, 520px);
  object-fit: cover;
  display: block;
}
.cr-gallery-phv-card-body {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem 1.15rem;
  background: #fff;
}
.cr-gallery-phv-card-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.cr-gallery-phv-card-title {
  font-family: var(--cr-font-serif, "Noto Serif", Georgia, "Times New Roman", serif);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1e3a5f;
  line-height: 1.25;
}
.cr-gallery-phv-card-hint {
  font-size: 0.94rem;
  font-weight: 500;
  color: #64748b;
  line-height: 1.4;
}
.cr-gallery-phv-card-plus {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(100, 116, 139, 0.35);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}
.cr-gallery-phv-card-plus:hover {
  border-color: rgba(45, 106, 107, 0.45);
  color: var(--cr-teal, #2d6a6b);
  background: rgba(45, 106, 107, 0.06);
  box-shadow: 0 2px 8px rgba(30, 58, 79, 0.08);
}
.cr-gallery-phv-card-plus:focus-visible {
  outline: 2px solid var(--cr-teal);
  outline-offset: 2px;
}
.cr-gallery-phv .phv-imglib-open {
  cursor: pointer;
}
@media (max-width: 480px) {
  .cr-gallery-phv-card-body {
    flex-direction: column;
    align-items: stretch;
  }
  .cr-gallery-phv-card-plus {
    align-self: flex-start;
  }
}
/* Modal flat: vuông góc, giao diện phẳng — chỉ trong Biên Khảo */
.cr-gallery-phv .toolbar__inner.toolbar-controls.phv-imglib-modal__dialog {
  border-radius: 0;
  border-color: rgba(45, 106, 107, 0.2);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.16);
}
.cr-gallery-phv .phv-imglib-modal__header {
  border-bottom-color: rgba(45, 106, 107, 0.12);
}
.cr-gallery-phv .phv-imglib-thumb {
  border-radius: 0;
}
.cr-gallery-phv .phv-imglib-thumb-img-wrap {
  border-radius: 0;
}
.cr-gallery-phv .phv-imglib-modal__title {
  color: var(--cr-navy, #0f172a);
}
.cr-gallery-phv .phv-imglib-modal__subtitle {
  color: var(--cr-muted, #64748b);
}
