/*
  Teaching World — blog (list + article). Same visual language as the home page (home_module/home.css, ".hv2"):
  graph paper, deep ink, pencil-yellow actions, blue links. Everything is scoped under .bv2 so the purchased theme's
  element selectors cannot leak in. Dark mode follows the theme switcher (.active-dark-mode). RTL first.
*/
@font-face {
    font-family: "EstedadV";
    src: url("/static/assets/aghdasi-typo/typography/woff2/estedad.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

.bv2 {
    --ink: #13233f;
    --paper: #eef3fa;
    --grid: #d9e3f2;
    --surface: #ffffff;
    --blue: #2f57ef;
    --pencil: #ffc83d;
    --pen: #e5484d;
    --body: #47546c;
    --line: #dce4f0;
    --muted: #6f7b93;
    --code-bg: #0f1a33;
    --display: "EstedadV", "vazirmatn", "IranSans", sans-serif;
    font-family: "vazirmatn", "IranSans", sans-serif;
    color: var(--body);
    background: var(--surface);
    line-height: 1.9;
    overflow-x: clip;
}
.active-dark-mode .bv2 {
    --ink: #eaf0ff;
    --paper: #0e1830;
    --grid: #1a2849;
    --surface: #111c38;
    --blue: #86a2ff;
    --body: #b6c2db;
    --line: #243459;
    --muted: #8a98b8;
    --code-bg: #0a1224;
}

.bv2 *, .bv2 *::before, .bv2 *::after { box-sizing: border-box; }
.bv2 img { max-width: 100%; height: auto; display: block; }
.bv2 h1, .bv2 h2, .bv2 h3, .bv2 p, .bv2 ul, .bv2 ol, .bv2 figure, .bv2 blockquote { margin: 0; padding: 0; }
.bv2 ul, .bv2 ol { list-style: none; }
.bv2 li { margin: 0; }
.bv2 p, .bv2 li, .bv2 td, .bv2 figcaption { color: inherit; }
.bv2 hr { opacity: 1; }
.bv2 a { text-decoration: none; color: inherit; }
.bv2 a:focus-visible, .bv2 button:focus-visible, .bv2 summary:focus-visible, .bv2 [tabindex]:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.bv2 button { font-family: inherit; }
.bv2 .bv2-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.bv2 .bv2-wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.bv2 .bv2-narrow { width: min(780px, 100% - 40px); }
.bv2 .bv2-section { padding: clamp(48px, 7vw, 88px) 0; }
.bv2 .bv2-paper { background: var(--paper); }

/* type */
.bv2 .bv2-display { font-family: var(--display); font-weight: 800; color: var(--ink); font-size: clamp(32px, 4.6vw, 54px); line-height: 1.4; }
.bv2 .bv2-hash { color: var(--blue); margin-inline-end: 4px; }
.bv2 .bv2-title { font-family: var(--display); font-weight: 800; color: var(--ink); font-size: clamp(28px, 4.2vw, 46px); line-height: 1.5; }
.bv2 .bv2-h2 { font-family: var(--display); font-weight: 700; color: var(--ink); font-size: clamp(24px, 3vw, 34px); line-height: 1.5; }
.bv2 .bv2-h3 { font-family: var(--display); font-weight: 700; color: var(--ink); font-size: 20px; line-height: 1.6; }
.bv2 .bv2-lead { font-size: 18px; line-height: 2.1; max-width: 64ch; }
.bv2 .bv2-kicker { display: block; color: var(--blue); font-weight: 700; font-size: 15px; }
.bv2 .bv2-muted { color: var(--muted); }
.bv2 .bv2-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.bv2 .bv2-link { color: var(--blue); font-weight: 700; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; text-decoration-color: color-mix(in srgb, var(--blue) 35%, transparent); }
.bv2 .bv2-link:hover { text-decoration-color: var(--blue); }
.bv2 .bv2-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 32px; }
.bv2 .bv2-stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }

/* buttons */
.bv2 .bv2-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 26px; border: 0; border-radius: 10px; font-weight: 800; font-size: 16px; line-height: 1.4; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.bv2 .bv2-btn-pencil { background: var(--pencil); color: #13233f; box-shadow: 0 4px 0 #c8981b; }
.bv2 .bv2-btn-pencil:hover { transform: translateY(2px); box-shadow: 0 2px 0 #c8981b; color: #13233f; }
.bv2 .bv2-btn-ink { background: var(--ink); color: var(--surface); }
.bv2 .bv2-btn-ink:hover { background: var(--blue); color: #fff; }
.bv2 .bv2-btn-outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.bv2 .bv2-btn-outline:hover { background: var(--ink); color: var(--surface); }

/* breadcrumbs */
.bv2 .bv2-crumbs { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.bv2 .bv2-crumbs a { color: var(--muted); }
.bv2 .bv2-crumbs a:hover { color: var(--blue); }
.bv2 .bv2-crumbs [aria-current] { color: var(--ink); font-weight: 600; }

/* ───────── list: hero ───────── */
.bv2 .bv2-hero { position: relative; background: var(--paper); padding: clamp(36px, 5vw, 72px) 0 clamp(36px, 5vw, 56px); isolation: isolate; }
.bv2 .bv2-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 36px 36px; -webkit-mask-image: linear-gradient(#000 50%, transparent); mask-image: linear-gradient(#000 50%, transparent); }
.bv2 .bv2-hero .bv2-lead { margin-top: 12px; }
.bv2 .bv2-search { position: relative; display: flex; gap: 10px; max-width: 620px; margin-top: 28px; }
.bv2 .bv2-search i { position: absolute; inset-inline-start: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; pointer-events: none; }
.bv2 .bv2-search input { flex: 1 1 auto; min-width: 0; height: 52px; margin: 0; padding: 0 48px 0 16px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 16px; }
.bv2 .bv2-search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent); }
.bv2 .bv2-search .bv2-btn { min-height: 52px; }
.bv2 .bv2-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.bv2 .bv2-chip { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: 15px; transition: border-color .15s ease, color .15s ease; }
.bv2 .bv2-chip span { color: var(--muted); font-weight: 500; font-size: 13px; }
.bv2 .bv2-chip:hover { border-color: var(--blue); color: var(--blue); }
.bv2 .bv2-chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.bv2 .bv2-chip.is-active span { color: color-mix(in srgb, var(--surface) 70%, transparent); }

/* ───────── list: featured ───────── */
.bv2 .bv2-featured-wrap { padding-top: clamp(32px, 5vw, 56px); }
.bv2 .bv2-featured { position: relative; display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.bv2 .bv2-featured-img { overflow: hidden; border-radius: 16px; background: var(--paper); }
.bv2 .bv2-featured-img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .4s ease; }
.bv2 .bv2-featured:hover .bv2-featured-img img { transform: scale(1.03); }
.bv2 .bv2-featured-body { display: flex; flex-direction: column; gap: 14px; }
.bv2 .bv2-featured-title { font-family: var(--display); font-weight: 800; color: var(--ink); font-size: clamp(24px, 3vw, 36px); line-height: 1.55; }
.bv2 .bv2-featured:hover .bv2-featured-title { color: var(--blue); }
.bv2 .bv2-featured-body > p:not(.bv2-meta) { font-size: 17px; line-height: 2; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.bv2 .bv2-more { display: inline-flex; align-items: center; gap: 8px; color: var(--blue); font-weight: 700; }
.bv2 .bv2-more i { transition: transform .2s ease; }
.bv2 .bv2-featured:hover .bv2-more i { transform: translateX(-6px); }

/* ───────── list: cards + aside ───────── */
.bv2 .bv2-list-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(28px, 4vw, 56px); align-items: start; }
.bv2 .bv2-result { margin-bottom: 24px; color: var(--ink); font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.bv2 .bv2-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 28px; }
.bv2 .bv2-cards-3 { grid-template-columns: repeat(3, 1fr); }
.bv2 .bv2-card { position: relative; display: flex; flex-direction: column; gap: 16px; }
.bv2 .bv2-card-img { overflow: hidden; border-radius: 14px; background: var(--paper); }
.bv2 .bv2-card-img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .4s ease; }
.bv2 .bv2-card:hover .bv2-card-img img { transform: scale(1.04); }
.bv2 .bv2-card-ph { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 10; color: var(--blue); font-size: 34px; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px; }
.bv2 .bv2-card-body { display: flex; flex-direction: column; gap: 8px; }
.bv2 .bv2-label { align-self: flex-start; display: inline-block; padding: 2px 10px; border-radius: 6px; background: color-mix(in srgb, var(--blue) 10%, transparent); color: var(--blue); font-size: 13px; font-weight: 700; line-height: 1.9; }
.bv2 .bv2-card-title { font-family: var(--display); font-weight: 700; color: var(--ink); font-size: 20px; line-height: 1.65; }
.bv2 .bv2-card:hover .bv2-card-title { color: var(--blue); }
.bv2 .bv2-card-text { font-size: 15.5px; line-height: 1.95; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.bv2 .bv2-pages { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 48px; }
.bv2 .bv2-page { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 10px; color: var(--ink); font-weight: 700; }
.bv2 a.bv2-page:hover { border-color: var(--blue); color: var(--blue); }
.bv2 .bv2-page.is-active { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.bv2 .bv2-page-gap { color: var(--muted); padding: 0 4px; }

.bv2 .bv2-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 56px 24px; border: 1.5px dashed var(--line); border-radius: 16px; text-align: center; }
.bv2 .bv2-empty > i { font-size: 40px; color: var(--blue); }

.bv2 .bv2-aside { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 100px; }
.bv2 .bv2-box { padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.bv2 .bv2-box-title { font-family: var(--display); font-weight: 700; color: var(--ink); font-size: 18px; line-height: 1.6; margin-bottom: 14px; }
.bv2 .bv2-box-ink { background: var(--ink); border-color: var(--ink); color: color-mix(in srgb, var(--surface) 80%, transparent); }
.bv2 .bv2-box-ink .bv2-box-title { color: var(--surface); }
.bv2 .bv2-box-ink p { font-size: 15px; margin-bottom: 18px; }
.bv2 .bv2-box-ink .bv2-btn { width: 100%; }
.bv2 .bv2-popular { counter-reset: pop; display: flex; flex-direction: column; }
.bv2 .bv2-popular li { counter-increment: pop; position: relative; display: flex; flex-direction: column; padding: 12px 0 12px; padding-inline-start: 40px; border-top: 1px solid var(--line); }
.bv2 .bv2-popular li:first-child { border-top: 0; padding-top: 0; }
.bv2 .bv2-popular li::before { content: counter(pop, persian); position: absolute; inset-inline-start: 0; top: 10px; font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1; color: var(--pencil); -webkit-text-stroke: 1px #c8981b; }
.bv2 .bv2-popular li:first-child::before { top: -2px; }
.bv2 .bv2-popular a { color: var(--ink); font-weight: 600; font-size: 15.5px; line-height: 1.8; }
.bv2 .bv2-popular a:hover { color: var(--blue); }
.bv2 .bv2-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.bv2 .bv2-tag { display: inline-block; padding: 4px 12px; border-radius: 8px; background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 600; transition: background .15s ease, color .15s ease; }
.bv2 .bv2-tag:hover, .bv2 .bv2-tag.is-active { background: var(--blue); color: #fff; }

/* ───────── article ───────── */
.bv2-progress { position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 1000; pointer-events: none; }
.bv2-progress span { display: block; height: 100%; width: 0; background: #ffc83d; transform-origin: right; }
.bv2 .bv2-draft { background: #fff4d6; color: #6b4e00; border-bottom: 1px solid #f1d58a; padding: 12px 0; font-weight: 600; font-size: 15px; }
.bv2 .bv2-draft a { color: #2f57ef; text-decoration: underline; margin-inline-start: 8px; }
.bv2 .bv2-article-head { background: var(--paper); padding: clamp(32px, 5vw, 64px) 0 0; position: relative; isolation: isolate; }
.bv2 .bv2-article-head::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 36px 36px; -webkit-mask-image: linear-gradient(#000 40%, transparent 85%); mask-image: linear-gradient(#000 40%, transparent 85%); }
.bv2 .bv2-article-head:not(:has(.bv2-cover)) { padding-bottom: clamp(32px, 5vw, 56px); }
.bv2 .bv2-article-head .bv2-lead { margin-top: 14px; }
.bv2 .bv2-byline { display: flex; align-items: center; gap: 14px; margin-top: 26px; }
.bv2 .bv2-byline img, .bv2 .bv2-avatar-ph { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.bv2 .bv2-avatar-ph { display: grid; place-items: center; background: var(--ink); color: var(--pencil); font-family: var(--display); font-weight: 800; font-size: 20px; }
.bv2 .bv2-avatar-lg { flex-basis: 72px; width: 72px; height: 72px; font-size: 28px; }
.bv2 .bv2-byline-text { display: flex; flex-direction: column; line-height: 1.7; }
.bv2 .bv2-byline-text strong { color: var(--ink); font-size: 16px; }
.bv2 .bv2-cover { margin-top: clamp(28px, 4vw, 44px); position: relative; }
.bv2 .bv2-cover img { width: 100%; max-height: 620px; object-fit: cover; border-radius: 18px; box-shadow: 0 24px 50px -30px rgba(19, 35, 63, .55); }

.bv2 .bv2-article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: clamp(28px, 5vw, 72px); padding: clamp(40px, 6vw, 72px) 0 clamp(32px, 4vw, 48px); align-items: start; }
.bv2 .bv2-article { min-width: 0; max-width: 760px; width: 100%; justify-self: end; }
.bv2 .bv2-article-aside { position: sticky; top: 100px; }
.bv2 .bv2-sticky { display: flex; flex-direction: column; gap: 20px; }
.bv2 .bv2-toc ol { display: flex; flex-direction: column; gap: 2px; }
.bv2 .bv2-toc a { display: block; padding: 6px 12px; border-inline-start: 2px solid var(--line); color: var(--body); font-size: 14.5px; line-height: 1.8; transition: color .15s ease, border-color .15s ease; }
.bv2 .bv2-toc a:hover, .bv2 .bv2-toc a.is-active { color: var(--blue); border-color: var(--blue); }
.bv2 .bv2-toc .bv2-toc-l3 a { padding-inline-start: 26px; font-size: 14px; }
.bv2 .bv2-toc-inline { display: none; margin-bottom: 28px; border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; background: var(--paper); }
.bv2 .bv2-toc-inline summary { cursor: pointer; padding: 10px 0; color: var(--ink); font-weight: 700; }
.bv2 .bv2-toc-inline ol { padding-bottom: 12px; }

/* prose: the rendered blocks */
.bv2 .bv2-prose { color: var(--body); font-size: 18px; line-height: 2.15; }
.bv2 .bv2-prose > * + * { margin-top: 26px; }
.bv2 .bv2-prose .bv2-text p + p { margin-top: 18px; }
/* one line of an article text: its own bidi paragraph (English lines are dir="ltr", see markup.inline) */
.bv2 .bv2-line { display: block; }
.bv2 .bv2-prose .bv2-h2 { margin-top: 52px; font-size: clamp(23px, 2.6vw, 30px); scroll-margin-top: 110px; }
.bv2 .bv2-prose .bv2-h3 { margin-top: 36px; font-size: 21px; scroll-margin-top: 110px; }
.bv2 .bv2-prose > :first-child { margin-top: 0; }
.bv2 .bv2-prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, var(--blue) 40%, transparent); }
.bv2 .bv2-prose a:hover { text-decoration-color: var(--blue); }
.bv2 .bv2-prose strong { color: var(--ink); font-weight: 700; }
.bv2 .bv2-prose code { padding: 1px 6px; border-radius: 5px; background: var(--paper); color: var(--ink); font-family: Consolas, "Courier New", monospace; font-size: .86em; direction: ltr; unicode-bidi: isolate; }
.bv2 .bv2-prose figcaption { margin-top: 10px; color: var(--muted); font-size: 14.5px; line-height: 1.9; text-align: center; }

.bv2 .bv2-figure img { width: 100%; border-radius: 12px; background: var(--paper); }
.bv2 .bv2-figure-wide { margin-inline: clamp(-80px, -6vw, 0px); }
.bv2 .bv2-figure-full { margin-inline: calc(50% - 50vw + 10px); }
.bv2 .bv2-figure-full img { border-radius: 0; max-height: 80vh; object-fit: cover; }

.bv2 .bv2-gallery-items { display: grid; gap: 10px; }
.bv2 .bv2-gallery-grid .bv2-gallery-items { grid-template-columns: repeat(3, 1fr); }
.bv2 .bv2-gallery-grid[data-count="1"] .bv2-gallery-items { grid-template-columns: 1fr; }
.bv2 .bv2-gallery-grid[data-count="2"] .bv2-gallery-items, .bv2 .bv2-gallery-grid[data-count="4"] .bv2-gallery-items { grid-template-columns: repeat(2, 1fr); }
.bv2 .bv2-gallery-grid[data-count="3"] .bv2-gallery-item:first-child { grid-row: span 2; }
.bv2 .bv2-gallery-grid[data-count="3"] .bv2-gallery-items { grid-template-columns: 1.4fr 1fr; }
.bv2 .bv2-gallery-item { display: block; overflow: hidden; border-radius: 10px; background: var(--paper); cursor: zoom-in; }
.bv2 .bv2-gallery-item img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .35s ease; }
.bv2 .bv2-gallery-grid[data-count="3"] .bv2-gallery-item:first-child img { aspect-ratio: auto; }
.bv2 .bv2-gallery-item:hover img { transform: scale(1.04); }
.bv2 .bv2-gallery-slider .bv2-gallery-items { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; padding-bottom: 10px; scrollbar-width: thin; }
.bv2 .bv2-gallery-slider .bv2-gallery-item { flex: 0 0 82%; scroll-snap-align: center; }
.bv2 .bv2-gallery-slider .bv2-gallery-item img { aspect-ratio: 16 / 10; }

.bv2 .bv2-media video { width: 100%; border-radius: 12px; background: #000; }
.bv2 .bv2-embed { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.bv2 .bv2-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.bv2 .bv2-audio { padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.bv2 .bv2-audio-head { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; margin-bottom: 10px; }
.bv2 .bv2-audio-head i { color: var(--blue); font-size: 20px; }
.bv2 .bv2-audio audio { width: 100%; }
.bv2 .bv2-audio figcaption { text-align: start; }

.bv2 .bv2-quote { position: relative; margin-inline: 0; padding: 6px 0; padding-inline: 24px 0; border: 0; border-inline-start: 4px solid var(--pencil); border-radius: 0; background: none; font-style: normal; color: var(--ink); font-family: var(--display); font-size: 21px; font-weight: 600; line-height: 2; }
.bv2 .bv2-quote footer { font-style: normal; margin-top: 10px; font-family: "vazirmatn", sans-serif; font-size: 15px; font-weight: 500; color: var(--muted); }
.bv2 .bv2-quote::before, .bv2 .bv2-quote::after { content: none; }

.bv2 .bv2-list { display: flex; flex-direction: column; gap: 10px; }
.bv2 .bv2-list li { position: relative; padding-inline-start: 28px; }
.bv2 .bv2-list li::before { content: ""; position: absolute; inset-inline-start: 6px; top: .95em; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.bv2 .bv2-list-number { counter-reset: item; }
.bv2 .bv2-list-number li { counter-increment: item; padding-inline-start: 38px; }
.bv2 .bv2-list-number li::before { content: counter(item, persian); top: .25em; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--paper); color: var(--blue); font-weight: 800; font-size: 14px; line-height: 1; inset-inline-start: 0; }
.bv2 .bv2-list-check li::before { top: .55em; width: 7px; height: 13px; border-radius: 0; background: none; border: solid var(--pen); border-width: 0 3px 3px 0; transform: rotate(45deg); }

.bv2 .bv2-code { border-radius: 12px; overflow: hidden; background: var(--code-bg); }
.bv2 .bv2-code-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; background: rgba(255, 255, 255, .06); color: #9fb0d3; font-size: 13px; font-family: Consolas, monospace; }
.bv2 .bv2-copy { border: 1px solid rgba(255, 255, 255, .2); border-radius: 6px; background: transparent; color: #dfe7ff; font-size: 13px; padding: 2px 12px; cursor: pointer; }
.bv2 .bv2-copy:hover { background: rgba(255, 255, 255, .1); }
.bv2 .bv2-code pre { margin: 0; border: 0; border-radius: 0; background: transparent !important; padding: 18px 20px; overflow-x: auto; color: #e7edff; font-family: Consolas, "Courier New", monospace; font-size: 14.5px; line-height: 1.8; text-align: left; white-space: pre; tab-size: 4; }
.bv2 .bv2-code pre code { padding: 0; background: none; color: inherit; font-size: inherit; }
.bv2 .bv2-code figcaption { padding: 0 16px 12px; color: #9fb0d3; text-align: start; }

.bv2 .bv2-callout { display: flex; gap: 14px; padding: 18px 20px; border-radius: 12px; border: 1px solid; font-size: 16.5px; line-height: 2; }
.bv2 .bv2-callout > i { font-size: 22px; margin-top: 5px; }
.bv2 .bv2-callout-title { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.bv2 .bv2-callout p + p { margin-top: 10px; }
.bv2 .bv2-callout-info { background: color-mix(in srgb, var(--blue) 7%, var(--surface)); border-color: color-mix(in srgb, var(--blue) 25%, transparent); }
.bv2 .bv2-callout-info > i { color: var(--blue); }
.bv2 .bv2-callout-tip { background: color-mix(in srgb, var(--pencil) 16%, var(--surface)); border-color: color-mix(in srgb, #c8981b 40%, transparent); }
.bv2 .bv2-callout-tip > i { color: #b7860c; }
.bv2 .bv2-callout-warning { background: color-mix(in srgb, var(--pen) 8%, var(--surface)); border-color: color-mix(in srgb, var(--pen) 30%, transparent); }
.bv2 .bv2-callout-warning > i { color: var(--pen); }
.bv2 .bv2-callout-success { background: color-mix(in srgb, #1f9d6b 8%, var(--surface)); border-color: color-mix(in srgb, #1f9d6b 30%, transparent); }
.bv2 .bv2-callout-success > i { color: #1f9d6b; }

.bv2 .bv2-table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.bv2 .bv2-table table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.8; }
.bv2 .bv2-table table { margin: 0; border: 0; }
.bv2 .bv2-table th, .bv2 .bv2-table td { padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.bv2 .bv2-table th { background: var(--paper); color: var(--ink); font-weight: 700; white-space: nowrap; }
.bv2 .bv2-table tbody tr:last-child td { border-bottom: 0; }
.bv2 .bv2-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--paper) 45%, transparent); }

.bv2 .bv2-file { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border: 1.5px solid var(--line); border-radius: 12px; color: var(--ink) !important; text-decoration: none !important; transition: border-color .15s ease; }
.bv2 .bv2-file:hover { border-color: var(--blue); }
.bv2 .bv2-file > i { flex: 0 0 46px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 10px; background: var(--paper); color: var(--blue); font-size: 20px; }
.bv2 .bv2-file-text { display: flex; flex-direction: column; line-height: 1.7; min-width: 0; }
.bv2 .bv2-file-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bv2 .bv2-file-text span { color: var(--muted); font-size: 14px; }
.bv2 .bv2-cta { text-align: center; }
.bv2 .bv2-prose .bv2-cta a { text-decoration: none; }
.bv2 .bv2-prose .bv2-btn-pencil { color: #13233f; }
.bv2 .bv2-divider { border: 0; height: auto; margin: 44px 0; background: none; text-align: center; overflow: visible; }
.bv2 .bv2-divider::before { content: "✻ ✻ ✻"; color: var(--muted); letter-spacing: 18px; font-size: 16px; }

/* article footer */
.bv2 .bv2-article-tags { margin-top: 44px; }
.bv2 .bv2-share-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; padding: 18px 0; border-block: 1px solid var(--line); }
.bv2 .bv2-like { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 700; font-size: 15px; cursor: pointer; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.bv2 .bv2-like i { font-size: 18px; color: var(--pen); }
.bv2 .bv2-like:hover { border-color: var(--pen); }
.bv2 .bv2-like.is-liked { background: var(--pen); border-color: var(--pen); color: #fff; }
.bv2 .bv2-like.is-liked i { color: #fff; }
.bv2 .bv2-share { display: flex; flex-wrap: wrap; gap: 8px; }
.bv2 .bv2-sticky .bv2-share { gap: 6px; }
.bv2 .bv2-sticky .bv2-share a, .bv2 .bv2-sticky .bv2-share button { width: 38px; height: 38px; font-size: 16px; }
.bv2 .bv2-sticky .bv2-box { padding: 20px; }
.bv2 .bv2-share a, .bv2 .bv2-share button { width: 42px; height: 42px; display: grid; place-items: center; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 17px; cursor: pointer; transition: border-color .15s ease, color .15s ease; }
.bv2 .bv2-share a:hover, .bv2 .bv2-share button:hover { border-color: var(--blue); color: var(--blue); }
.bv2 .bv2-share button.is-done { border-color: #1f9d6b; color: #1f9d6b; }
.bv2 .bv2-author { display: flex; gap: 20px; margin-top: 36px; padding: 24px; border-radius: 16px; background: var(--paper); }
.bv2 .bv2-author img { flex: 0 0 72px; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.bv2 .bv2-author > div { display: flex; flex-direction: column; gap: 2px; }
.bv2 .bv2-author p { margin-top: 8px; font-size: 15.5px; line-height: 2; }

/* comments */
.bv2 .bv2-comment-form { margin-top: 24px; }
.bv2 .bv2-comment-form textarea { width: 100%; min-height: 140px; padding: 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-family: inherit; font-size: 16px; line-height: 2; resize: vertical; }
.bv2 .bv2-comment-form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 15%, transparent); }
.bv2 .bv2-comment-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 14px; }
.bv2 .bv2-error { color: var(--pen); font-size: 14px; margin-top: 6px; }
.bv2 .bv2-login-note { margin-top: 18px; padding: 18px 20px; border-radius: 12px; background: var(--paper); }
.bv2 .bv2-comments { margin-top: 36px; display: flex; flex-direction: column; }
.bv2 .bv2-comment { padding: 20px 0; border-top: 1px solid var(--line); }
.bv2 .bv2-comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.bv2 .bv2-comment-head img, .bv2 .bv2-comment-head .bv2-avatar-ph { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; font-size: 16px; }
.bv2 .bv2-comment-head strong { color: var(--ink); }
.bv2 .bv2-comment-text { margin-top: 10px; font-size: 16px; line-height: 2; }
.bv2 .bv2-replies { margin-top: 12px; padding-inline-start: 24px; border-inline-start: 2px solid var(--line); }
.bv2 .bv2-replies .bv2-comment { border-top: 0; padding: 12px 0; }

/* lightbox */
.bv2-lightbox { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 56px 64px; background: rgba(8, 14, 30, .92); }
.bv2-lightbox[hidden] { display: none; }
.bv2-lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.bv2-lightbox img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; border-radius: 6px; }
.bv2-lightbox figcaption { color: #dfe6f7; font-size: 15px; text-align: center; }
.bv2-lightbox button { position: absolute; width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 24px; cursor: pointer; }
.bv2-lightbox button:hover { background: rgba(255, 255, 255, .24); }
.bv2-lb-close { top: 14px; left: 14px; }
.bv2-lb-prev { right: 12px; top: 50%; transform: translateY(-50%); }
.bv2-lb-next { left: 12px; top: 50%; transform: translateY(-50%); }

/* ───────── responsive ───────── */
@media (max-width: 1199px) {
    .bv2 .bv2-figure-wide { margin-inline: 0; }
}
@media (max-width: 991px) {
    .bv2 .bv2-list-grid, .bv2 .bv2-article-grid { grid-template-columns: 1fr; }
    .bv2 .bv2-aside { position: static; display: grid; grid-template-columns: repeat(2, 1fr); }
    .bv2 .bv2-article { justify-self: center; }
    .bv2 .bv2-article-aside { display: none; }
    .bv2 .bv2-toc-inline { display: block; }
    .bv2 .bv2-featured { grid-template-columns: 1fr; }
    .bv2 .bv2-cards-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
    .bv2 .bv2-head { flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 24px; }
    .bv2 .bv2-cards, .bv2 .bv2-cards-3 { grid-template-columns: 1fr; gap: 32px; }
    .bv2 .bv2-aside { grid-template-columns: 1fr; }
    .bv2 .bv2-lead { font-size: 16.5px; }
    .bv2 .bv2-prose { font-size: 17px; line-height: 2.1; }
    .bv2 .bv2-quote { font-size: 19px; padding-inline-start: 20px; }
    .bv2 .bv2-gallery-grid .bv2-gallery-items, .bv2 .bv2-gallery-grid[data-count="3"] .bv2-gallery-items { grid-template-columns: repeat(2, 1fr); }
    .bv2 .bv2-gallery-grid[data-count="3"] .bv2-gallery-item:first-child { grid-row: auto; grid-column: span 2; }
    .bv2 .bv2-gallery-grid[data-count="1"] .bv2-gallery-items { grid-template-columns: 1fr; }
    .bv2 .bv2-author { flex-direction: column; gap: 12px; padding: 20px; }
    .bv2 .bv2-share-row { flex-direction: column; align-items: flex-start; }
    .bv2 .bv2-cover img { border-radius: 12px; }
    .bv2-lightbox { padding: 56px 12px; }
    .bv2-lb-prev, .bv2-lb-next { top: auto !important; bottom: 14px; transform: none !important; }
}
@media (max-width: 520px) {
    .bv2 .bv2-search { flex-direction: column; }
    .bv2 .bv2-search input { flex: none; width: 100%; }
    .bv2 .bv2-search i { top: 26px; }
    .bv2 .bv2-search .bv2-btn { width: 100%; }
    .bv2 .bv2-chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -20px; padding: 2px 20px 6px; scrollbar-width: none; }
    .bv2 .bv2-chip { flex: 0 0 auto; }
    .bv2 .bv2-file { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .bv2 *, .bv2 *::before { transition: none !important; }
    .bv2 .bv2-card:hover .bv2-card-img img, .bv2 .bv2-featured:hover .bv2-featured-img img, .bv2 .bv2-gallery-item:hover img { transform: none; }
}
@media print {
    .bv2-progress, .bv2 .bv2-article-aside, .bv2 .bv2-share-row, .bv2 #comments, .bv2 .bv2-toc-inline { display: none !important; }
}
