/* ============================================================
   GEOFlow Theme 22 — BioJuris Pharmalaw
   Medical-law academic index UI, migrated from design draft.
   Color/typography source of truth: :root --bj-* below.
   tokens.json is a design snapshot only; do not treat it as runtime input.
   Self-contained: no external CDN fonts; icons via lucide-icons.js.
   Body: Noto Sans SC (OFL), code: JetBrains Mono (OFL), self-hosted woff2.
   ============================================================ */

@font-face {
    font-family: "Noto Sans SC";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("./fonts/noto-sans-sc-latin-400-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Noto Sans SC";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("./fonts/noto-sans-sc-latin-700-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Noto Sans SC";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("./fonts/noto-sans-sc-chinese-simplified-400-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Noto Sans SC";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("./fonts/noto-sans-sc-chinese-simplified-700-normal.woff2") format("woff2");
}

@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("./fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("./fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2");
}

:root {
    --bj-page: #f6faff;
    --bj-surface: #ffffff;
    --bj-surface-subtle: #F8F9FA;
    --bj-surface-container: #eaeef4;
    --bj-surface-container-low: #f0f4fa;
    --bj-surface-container-high: #e4e9ee;
    --bj-primary: #6b011b;
    --bj-primary-container: #8b1e2f;
    --bj-on-primary: #ffffff;
    --bj-secondary: #455f87;
    --bj-tertiary: #003a30;
    --bj-ink: #111827;
    --bj-ink-secondary: #4B5563;
    --bj-ink-tertiary: #9CA3AF;
    --bj-line: #E5E7EB;
    --bj-line-strong: #D1D5DB;
    --bj-badge-nmpa: #0284C7;
    --bj-badge-fda: #4338CA;
    --bj-badge-patent: #B45309;
    --bj-badge-clinical: #059669;
    --bj-badge-litigation: #991B1B;
    --bj-badge-compliance: #4F46E5;
    --bj-danger: #ba1a1a;
    --bj-live: #22c55e;
    --bj-live-ink: #15803d;
    --bj-paper: #fdfcf9;
    --bj-paper-mid: #f7f4ee;
    --bj-paper-line: #e7e2d8;
    --bj-paper-rule: #d8d2c4;
    --bj-paper-fold: #efe9dc;
    --bj-code-bg: #0f172a;
    --bj-code-ink: #e2e8f0;
    --bj-toast-bg: #111827;
    --bj-toast-ink: #ffffff;

    --bj-sidebar-w: 256px;
    --bj-sidebar-w-collapsed: 64px;
    --bj-header-h: 56px;
    --bj-shell: 1280px;
    --bj-radius-sm: 4px;
    --bj-radius-md: 6px;
    --bj-radius-lg: 8px;
    --bj-radius-xl: 12px;
    --bj-radius-pill: 9999px;

    --bj-font: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
    --bj-font-code: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

    --bj-border: 1px solid var(--bj-line);
    --bj-shadow-card: 0 1px 2px rgba(17, 24, 39, 0.03);
    --bj-shadow-hover: 0 2px 8px -2px rgba(17, 24, 39, 0.05), 0 1px 3px -1px rgba(17, 24, 39, 0.03);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

.bj-body {
    margin: 0;
    background: var(--bj-page);
    color: var(--bj-ink);
    font-family: var(--bj-font);
    font-size: 14px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

.bj-body a:not(.bj-button):not(.bj-tab):not(.bj-nav__item):not(.bj-pagination__page):not(.bj-pagination__control):not(.bj-tag) {
    color: var(--bj-primary);
    text-decoration: none;
}
.bj-body a:not(.bj-button):not(.bj-tab):not(.bj-nav__item):not(.bj-pagination__page):not(.bj-pagination__control):not(.bj-tag):hover {
    text-decoration: underline;
}

[data-lucide] {
    display: inline-flex;
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    stroke-width: 1.8;
}

.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;
}

.bj-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 999;
    padding: 8px 16px;
    background: var(--bj-primary);
    color: var(--bj-on-primary);
    border-radius: 0 0 var(--bj-radius-md) 0;
}
.bj-skip-link:focus { left: 0; }

.bj-shell {
    max-width: var(--bj-shell);
    margin: 0 auto;
    padding: 0 24px;
}

.bj-main { margin-left: var(--bj-sidebar-w); min-height: 60vh; }

.bj-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bj-live);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bj-live) 18%, transparent);
}

.bj-code {
    font-family: var(--bj-font-code);
    font-size: 11.5px;
    letter-spacing: 0.02em;
    background: var(--bj-surface-container-low);
    border: var(--bj-border);
    border-radius: var(--bj-radius-sm);
    padding: 1px 6px;
    white-space: nowrap;
}

/* ---------- Sidebar (desktop) ---------- */
.bj-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--bj-sidebar-w);
    display: flex;
    flex-direction: column;
    background: var(--bj-surface);
    border-right: var(--bj-border);
    z-index: 60;
    transition: width 0.22s ease;
}
.bj-sidebar__inner { flex: 1 1 auto; display: flex; flex-direction: column; overflow-y: auto; padding: 16px 12px; }
.bj-sidebar__brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bj-icon-btn.bj-sidebar__close { display: none; flex-shrink: 0; }
.bj-sidebar__footer { margin-top: auto; padding-top: 8px; }

.bj-brand { display: flex; align-items: center; gap: 10px; color: var(--bj-ink); flex-wrap: nowrap; min-width: 0; }
.bj-brand:hover { text-decoration: none; }
/* Brand mark is the <img> itself — no wrapper; size/radius live here */
.bj-brand__mark {
    display: block;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: var(--bj-radius-lg);
    object-fit: contain;
    background: var(--bj-surface);
}
.bj-brand__meta { display: flex; flex-direction: column; min-width: 0; }
.bj-brand__name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}
.bj-brand__tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--bj-primary);
    background: rgba(107, 1, 27, 0.08);
    border: 1px solid rgba(107, 1, 27, 0.2);
    border-radius: var(--bj-radius-pill);
    padding: 0 6px;
    line-height: 16px;
}
.bj-brand__sub { font-size: 12px; color: var(--bj-ink-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bj-sidebar__label {
    display: block;
    margin-top: 20px;
    padding: 0 10px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bj-ink-tertiary);
}

.bj-sidebar__nav {
    margin-top: 16px;
}

.bj-nav > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.bj-nav > ul > li { display: flex; min-width: 0; }
.bj-nav > ul > li > .bj-nav__item { flex: 1; min-width: 0; }
.bj-nav__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--bj-radius-md);
    color: var(--bj-ink-secondary);
    font-size: 13.5px;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.bj-nav__icon { font-size: 16px; color: var(--bj-ink-tertiary); }
.bj-nav__label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bj-nav__item:hover { background: var(--bj-surface-container-low); color: var(--bj-ink); text-decoration: none; }
.bj-nav__item.is-active {
    background: rgba(107, 1, 27, 0.09);
    color: var(--bj-primary);
    font-weight: 600;
}
.bj-nav__item.is-active .bj-nav__icon { color: var(--bj-primary); }
.bj-nav__count {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--bj-ink-tertiary);
    background: var(--bj-surface-container);
    border-radius: var(--bj-radius-pill);
    padding: 0 8px;
    line-height: 18px;
}

.bj-index-card {
    border: var(--bj-border);
    border-radius: var(--bj-radius-lg);
    padding: 12px;
    background: var(--bj-surface-container-low);
    margin-bottom: 12px;
}
.bj-index-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--bj-ink);
}
.bj-index-card__body { margin: 8px 0 0; font-size: 12px; color: var(--bj-ink-secondary); line-height: 1.6; }

.bj-sidebar__tools { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.bj-sidebar__spacer { flex: 1 1 auto; }
.bj-sidebar__note { font-size: 11px; color: var(--bj-ink-tertiary); }

/* Collapse toggle button (sidebar right edge) */
.bj-sidebar__collapse-btn {
    position: absolute;
    top: 50%;
    right: -13px;
    transform: translateY(-50%);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 52px;
    padding: 0;
    border: var(--bj-border);
    border-left: 0;
    border-radius: 0 var(--bj-radius-md) var(--bj-radius-md) 0;
    background: var(--bj-surface);
    color: var(--bj-ink-tertiary);
    font-size: 15px;
    cursor: pointer;
    box-shadow: 2px 0 8px -4px rgba(17, 24, 39, 0.18);
    transition: color 0.15s ease, background-color 0.15s ease;
}
.bj-sidebar__collapse-btn:hover { color: var(--bj-primary); background: var(--bj-surface-container-low); }

/* Collapsed state: icon-only narrow rail (hide role elements, keep structure) */
body.bj-sidebar-collapsed .bj-sidebar { width: var(--bj-sidebar-w-collapsed); }
body.bj-sidebar-collapsed .bj-main { margin-left: var(--bj-sidebar-w-collapsed); }
body.bj-sidebar-collapsed .bj-footer { margin-left: var(--bj-sidebar-w-collapsed); }
body.bj-sidebar-collapsed .bj-sidebar__inner { padding: 12px 6px; align-items: stretch; }
body.bj-sidebar-collapsed .bj-sidebar__footer { padding-top: 8px; }
body.bj-sidebar-collapsed .bj-sidebar__brand { justify-content: center; }
body.bj-sidebar-collapsed .bj-brand { justify-content: center; }
body.bj-sidebar-collapsed .bj-brand__mark { width: 32px; height: 32px; }
body.bj-sidebar-collapsed .bj-brand__meta,
body.bj-sidebar-collapsed .bj-sidebar__label,
body.bj-sidebar-collapsed .bj-nav__label,
body.bj-sidebar-collapsed .bj-nav__count,
body.bj-sidebar-collapsed .bj-index-card,
body.bj-sidebar-collapsed .bj-sidebar__spacer,
body.bj-sidebar-collapsed .bj-sidebar__note { display: none; }
body.bj-sidebar-collapsed .bj-nav__item { justify-content: center; gap: 0; padding: 10px 0; }
body.bj-sidebar-collapsed .bj-nav__icon { font-size: 18px; }
body.bj-sidebar-collapsed .bj-sidebar__tools {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    margin-top: 8px;
}

.bj-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: var(--bj-border);
    border-radius: var(--bj-radius-md);
    background: var(--bj-surface);
    color: var(--bj-ink-secondary);
    cursor: pointer;
    font-size: 17px;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.bj-icon-btn:hover { background: var(--bj-surface-container-low); color: var(--bj-ink); }

.bj-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bj-surface-container-high);
    color: var(--bj-ink-secondary);
    font-size: 15px;
}
.bj-avatar--primary { background: var(--bj-primary); color: var(--bj-on-primary); font-size: 13px; font-weight: 600; }
.bj-avatar--secondary { background: var(--bj-secondary); color: var(--bj-on-primary); font-size: 13px; font-weight: 600; }
.bj-avatar--sm { width: 28px; height: 28px; font-size: 13px; }

/* ---------- Nav overlay (mobile uses .bj-sidebar as drawer) ---------- */
.bj-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 70;
}
.bj-drawer-backdrop.is-open { opacity: 1; visibility: visible; }
body.bj-nav-open { overflow: hidden; }

/* ---------- Buttons / chips / badges ---------- */
.bj-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--bj-radius-md);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    padding: 10px 18px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.bj-button--primary { background: var(--bj-primary); color: var(--bj-on-primary); }
a.bj-button--primary,
a.bj-button--primary:link,
a.bj-button--primary:visited {
    color: var(--bj-on-primary);
    -webkit-text-fill-color: var(--bj-on-primary);
}
.bj-button--primary:hover,
a.bj-button--primary:hover {
    background: var(--bj-primary-container);
    color: var(--bj-on-primary);
    -webkit-text-fill-color: var(--bj-on-primary);
    text-decoration: none;
}
.bj-button--ghost { background: transparent; border-color: var(--bj-line-strong); color: var(--bj-ink-secondary); }
.bj-button--ghost:hover { border-color: var(--bj-primary); color: var(--bj-primary); text-decoration: none; }

.bj-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--bj-ink-secondary);
    background: var(--bj-surface-container-low);
    border: var(--bj-border);
    border-radius: var(--bj-radius-pill);
    padding: 3px 10px;
    line-height: 18px;
    white-space: nowrap;
}
.bj-chip--live {
    color: var(--bj-live-ink);
    background: color-mix(in srgb, var(--bj-live) 10%, transparent);
    border-color: color-mix(in srgb, var(--bj-live) 25%, transparent);
}
.bj-chip--code { font-family: var(--bj-font-code); letter-spacing: 0.02em; }

.bj-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    line-height: 20px;
    padding: 0 9px;
    border-radius: var(--bj-radius-pill);
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.bj-badge--is-default { background: rgba(69, 95, 135, 0.12); color: var(--bj-secondary); }
.bj-badge--is-patent { background: rgba(180, 83, 9, 0.12); color: var(--bj-badge-patent); }
.bj-badge--is-fda { background: rgba(67, 56, 202, 0.12); color: var(--bj-badge-fda); }
.bj-badge--is-nmpa { background: rgba(2, 132, 199, 0.12); color: var(--bj-badge-nmpa); }
.bj-badge--is-clinical { background: rgba(5, 150, 105, 0.12); color: var(--bj-badge-clinical); }
.bj-badge--is-litigation { background: rgba(153, 27, 27, 0.12); color: var(--bj-badge-litigation); }
.bj-badge--is-compliance { background: rgba(79, 70, 229, 0.12); color: var(--bj-badge-compliance); }

.bj-text-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--bj-primary);
}
.bj-text-link:hover { text-decoration: none; color: var(--bj-primary-container); }

/* ---------- Hero (home) ---------- */
.bj-hero {
    padding: 48px 24px 40px;
    background:
        radial-gradient(1000px 300px at 85% -40%, rgba(107, 1, 27, 0.06), transparent 70%),
        var(--bj-surface);
    border-bottom: var(--bj-border);
}
.bj-hero__inner { max-width: 860px; margin: 0 auto; text-align: center; }
.bj-hero__status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--bj-ink-secondary);
    background: var(--bj-surface-container-low);
    border: var(--bj-border);
    border-radius: var(--bj-radius-pill);
    padding: 5px 14px;
}
.bj-hero__title {
    margin: 20px 0 12px;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.bj-hero__lead {
    margin: 0 auto 24px;
    max-width: 620px;
    font-size: 15px;
    color: var(--bj-ink-secondary);
}
.bj-hero__search {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 560px;
    margin: 0 auto;
    height: 52px;
    padding: 0 6px 0 18px;
    border: 1px solid var(--bj-line-strong);
    border-radius: var(--bj-radius-pill);
    background: var(--bj-surface);
    box-shadow: var(--bj-shadow-card);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bj-hero__search:focus-within { border-color: var(--bj-primary); box-shadow: 0 0 0 3px rgba(107, 1, 27, 0.1); }
.bj-hero__search input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 14px;
    color: var(--bj-ink);
}
.bj-hero__search input::placeholder { color: var(--bj-ink-tertiary); }
.bj-hero__search-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: var(--bj-radius-pill);
    flex-shrink: 0;
}
.bj-hero__notice { margin: 14px 0 0; font-size: 12.5px; color: var(--bj-badge-litigation); }
.bj-search-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-top: 14px;
}
.bj-search-chips__label {
    font-size: 12px;
    color: var(--bj-ink-secondary);
}
.bj-search-chips ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.bj-search-chips a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--bj-line, #d7dce3);
    color: var(--bj-ink);
    text-decoration: none;
    font-size: 13px;
}
.bj-search-chips a:hover,
.bj-search-chips a[aria-current="page"] {
    border-color: var(--bj-primary);
    color: var(--bj-primary);
}
/* ---------- Page hero (category / archive) ---------- */
.bj-page-hero {
    padding: 40px 24px 32px;
    background: var(--bj-surface);
    border-bottom: var(--bj-border);
}
.bj-page-hero__inner { max-width: var(--bj-shell); margin: 0 auto; }
.bj-page-hero__grid {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 32px;
}
.bj-stat { margin: 0; }
.bj-stat__label { margin: 0; font-size: 12px; color: var(--bj-ink-tertiary); font-weight: 400; }
.bj-stat__value { margin: 0; font-size: 40px; font-weight: 800; line-height: 1.1; color: var(--bj-primary); }
.bj-stat__hint { margin: 0; font-size: 12px; color: var(--bj-ink-secondary); }
.bj-page-hero__index { text-align: right; }
.bj-page-hero__index .bj-stat__label,
.bj-page-hero__index .bj-stat__value,
.bj-page-hero__index .bj-stat__hint { display: block; }
.bj-page-hero h1 {
    margin: 10px 0 8px;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.3;
}
.bj-page-hero p { margin: 0; max-width: 640px; font-size: 14px; color: var(--bj-ink-secondary); }

.bj-kicker {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bj-primary);
}

.bj-breadcrumb {
    font-size: 12.5px;
    color: var(--bj-ink-tertiary);
    margin-bottom: 12px;
}
.bj-breadcrumb > ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.bj-breadcrumb > ol > li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.bj-breadcrumb > ol > li + li::before {
    content: "›";
    color: var(--bj-ink-tertiary);
    font-size: 12px;
    line-height: 1;
}
.bj-breadcrumb a { color: var(--bj-ink-secondary); }
.bj-breadcrumb a:hover { color: var(--bj-primary); text-decoration: none; }

/* ---------- Feed ---------- */
.bj-feed { padding: 28px 24px 48px; }
.bj-feed__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.bj-feed__search-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.bj-feed__search-meta h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.35;
    color: var(--bj-ink);
}
.bj-feed__search-meta p {
    margin: 0;
    font-size: 13px;
    color: var(--bj-ink-secondary);
}
.bj-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
}
.bj-tabs::-webkit-scrollbar { display: none; }
.bj-tabs--wrap { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; }
.bj-tabs__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}
.bj-tabs > .bj-tabs__list { flex-wrap: nowrap; }
.bj-tabs--wrap > .bj-tabs__list { flex-wrap: wrap; }
.bj-tabs__list > li { display: flex; margin: 0; padding: 0; }
.bj-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    color: var(--bj-ink-secondary);
    padding: 6px 12px;
    border-radius: var(--bj-radius-pill);
    border: 1px solid transparent;
}
.bj-tab:hover { background: var(--bj-surface-container-low); color: var(--bj-ink); text-decoration: none; }
.bj-tab.is-active {
    background: var(--bj-primary);
    color: var(--bj-on-primary);
}
a.bj-tab,
a.bj-tab:link,
a.bj-tab:visited {
    color: var(--bj-ink-secondary);
    text-decoration: none;
}
a.bj-tab:hover {
    color: var(--bj-ink);
    text-decoration: none;
}
a.bj-tab.is-active,
a.bj-tab.is-active:link,
a.bj-tab.is-active:visited,
a.bj-tab.is-active:hover {
    color: var(--bj-on-primary);
    -webkit-text-fill-color: var(--bj-on-primary);
    text-decoration: none;
}
.bj-tab__count {
    font-size: 11px;
    font-weight: 600;
    padding: 0 7px;
    line-height: 17px;
    border-radius: var(--bj-radius-pill);
    background: var(--bj-surface-container);
    color: var(--bj-ink-tertiary);
}
.bj-tab.is-active .bj-tab__count { background: rgba(255, 255, 255, 0.2); color: var(--bj-on-primary); }

/* ---------- Dossier cards ---------- */
.bj-dossier-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.bj-dossier-list > li { list-style: none; margin: 0; padding: 0; }

.bj-dossier {
    display: flex;
    gap: 20px;
    background: var(--bj-surface);
    border: var(--bj-border);
    border-radius: var(--bj-radius-xl);
    padding: 18px 18px 18px 20px;
    box-shadow: var(--bj-shadow-card);
    transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    position: relative;
    cursor: pointer;
}
.bj-dossier:hover {
    box-shadow: var(--bj-shadow-hover);
    border-color: var(--bj-line-strong);
    transform: translateY(-1px);
}
.bj-dossier__body { flex: 1 1 auto; min-width: 0; }
/* Paper thumbnail: labels in DOM (aria-hidden); fold + rule lines via CSS */
.bj-paper {
    display: flex;
    flex-direction: column;
    flex: 0 0 128px;
    width: 128px;
    aspect-ratio: 1 / 1.38;
    padding: 12px 12px 10px;
    border: 1px solid var(--bj-paper-line);
    border-radius: var(--bj-radius-md);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            180deg,
            transparent 0 10px,
            var(--bj-paper-rule) 10px 14px,
            transparent 14px 20px
        ) 12px 28px / 72% 54px no-repeat,
        linear-gradient(180deg, var(--bj-paper) 0%, var(--bj-paper-mid) 100%);
}
.bj-paper::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 22px;
    height: 22px;
    background: linear-gradient(225deg, var(--bj-paper-fold) 0%, var(--bj-paper-fold) 50%, transparent 50.1%);
}
.bj-paper__fig {
    margin: auto 0 0;
    padding-top: 10px;
    border-top: 1px solid var(--bj-paper-line);
}
.bj-paper__fig strong {
    display: block;
    font-family: var(--bj-font-code);
    font-size: 14px;
    letter-spacing: 0.12em;
    color: var(--bj-primary);
}
.bj-paper__fig span {
    display: block;
    font-size: 10px;
    color: var(--bj-ink-tertiary);
    line-height: 1.4;
}
.bj-paper__foot {
    margin: 8px 0 0;
    font-family: var(--bj-font-code);
    font-size: 9.5px;
    color: var(--bj-ink-tertiary);
}
.bj-dossier__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
}
.bj-dossier__meta .bj-badge:hover { opacity: 0.9; text-decoration: none; }
.bj-dossier__date { font-size: 12px; color: var(--bj-ink-tertiary); font-family: var(--bj-font-code); }
.bj-dossier__title { margin: 0 0 6px; font-size: 16px; font-weight: 700; line-height: 1.45; }
.bj-dossier__title a { color: var(--bj-ink); }
.bj-dossier__title a:hover { color: var(--bj-primary); text-decoration: none; }
.bj-dossier__title-link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}
.bj-dossier__summary {
    margin: 0;
    color: var(--bj-ink-secondary);
    font-size: 13.5px;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bj-dossier__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}
.bj-dossier__author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--bj-ink-tertiary);
}

/* ---------- Featured (category hot) ---------- */
.bj-featured {
    margin: 4px 0 24px;
    border: var(--bj-border);
    border-left: 3px solid var(--bj-primary);
    border-radius: var(--bj-radius-lg);
    background: var(--bj-surface);
    padding: 16px 20px;
}
.bj-featured__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--bj-ink);
    margin-bottom: 10px;
}
.bj-featured__label [data-lucide] { color: var(--bj-primary); }
.bj-featured__list { display: grid; gap: 2px; list-style: none; margin: 0; padding: 0; }
.bj-featured__list li { margin: 0; padding: 0; }
.bj-featured__list a {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 8px 4px;
    border-radius: var(--bj-radius-md);
    color: var(--bj-ink);
}
.bj-featured__list a:hover { background: var(--bj-surface-container-low); text-decoration: none; }
.bj-featured__no { font-family: var(--bj-font-code); font-size: 12px; font-weight: 700; color: var(--bj-primary); }
.bj-featured__list strong { flex: 1 1 auto; font-size: 13.5px; font-weight: 600; line-height: 1.5; }
.bj-featured__list [data-lucide] { font-size: 14px; color: var(--bj-ink-tertiary); }

/* ---------- Empty states ---------- */
.bj-empty {
    text-align: center;
    padding: 56px 24px;
    border: 1px dashed var(--bj-line-strong);
    border-radius: var(--bj-radius-xl);
    background: var(--bj-surface);
}
.bj-empty [data-lucide] { font-size: 34px; color: var(--bj-ink-tertiary); margin-bottom: 10px; }
.bj-empty .bj-kicker { display: inline-block; margin-bottom: 8px; }
.bj-empty h2 { margin: 0 0 6px; font-size: 16px; color: var(--bj-ink); }
.bj-empty p { margin: 0; font-size: 13.5px; color: var(--bj-ink-secondary); }

/* ---------- Pagination ---------- */
.bj-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    margin-top: 32px;
}
.bj-pagination__control {
    padding: 7px 14px;
    border: var(--bj-border);
    border-radius: var(--bj-radius-md);
    background: var(--bj-surface);
    color: var(--bj-ink);
    font-weight: 600;
}
.bj-pagination__control:hover { border-color: var(--bj-primary); color: var(--bj-primary); text-decoration: none; }
.bj-pagination__control.is-disabled { opacity: 0.45; pointer-events: none; }
.bj-pagination__pages {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.bj-pagination__pages > li { display: flex; margin: 0; padding: 0; }
.bj-pagination__page {
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-radius: var(--bj-radius-md);
    color: var(--bj-ink-secondary);
}
.bj-pagination__page:hover { background: var(--bj-surface-container-low); color: var(--bj-ink); text-decoration: none; }
.bj-pagination__page.is-current { background: var(--bj-primary); color: var(--bj-on-primary); font-weight: 700; }
a.bj-pagination__page,
a.bj-pagination__control {
    text-decoration: none;
}
a.bj-pagination__page.is-current,
a.bj-pagination__page.is-current:hover {
    color: var(--bj-on-primary);
    -webkit-text-fill-color: var(--bj-on-primary);
}
.bj-pagination__ellipsis { color: var(--bj-ink-tertiary); padding: 0 4px; align-items: center; }
.bj-pagination__summary {
    width: 100%;
    margin: 0;
    text-align: center;
    font-size: 12px;
    color: var(--bj-ink-tertiary);
}
.bj-pagination__num { color: var(--bj-ink-secondary); font-weight: 600; }

/* ---------- Article: breadcrumb bar ---------- */
.bj-breadcrumb-bar { border-bottom: var(--bj-border); background: var(--bj-surface); }
.bj-breadcrumb-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    padding-bottom: 10px;
    flex-wrap: nowrap;
}
.bj-breadcrumb-bar .bj-breadcrumb { margin-bottom: 0; min-width: 0; flex: 1 1 auto; }
.bj-breadcrumb-bar .bj-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    min-width: 0;
    max-width: 100%;
}
.bj-breadcrumb-bar .bj-breadcrumb a span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bj-status-chips { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.bj-header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bj-surface-container);
    border: 1px solid var(--bj-border);
    border-radius: var(--bj-radius-lg);
    flex: 0 1 260px;
    min-width: 0;
    max-width: 100%;
}
.bj-header-search [data-lucide] {
    width: 16px;
    height: 16px;
    color: var(--bj-ink-tertiary);
    flex-shrink: 0;
}
.bj-header-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13.5px;
    color: var(--bj-ink);
    outline: none;
    min-width: 0;
}
.bj-header-search input::placeholder { color: var(--bj-ink-tertiary); }

@media (max-width: 640px) {
    .bj-header-search { flex: 0 1 220px; }
}

/* ---------- Article layout ---------- */
.bj-article-shell { padding-top: 12px; padding-bottom: 64px; }
.bj-article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 32px;
    align-items: start;
}
.bj-about-layout {
    max-width: var(--bj-shell);
    margin: 0 auto;
    padding: 32px 24px 64px;
}
.bj-article-primary { min-width: 0; }
.bj-article-aside {
    position: sticky;
    top: var(--bj-header-h);
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-self: start;
    z-index: 40;
}

/* Header card */
.bj-article-card {
    background: var(--bj-surface);
    border: var(--bj-border);
    border-radius: var(--bj-radius-xl);
    padding: 28px 30px;
    box-shadow: var(--bj-shadow-card);
}
.bj-article-card__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.bj-article-card__date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--bj-ink-tertiary);
}
.bj-article-card__date [data-lucide] { font-size: 14px; color: var(--bj-primary); }
.bj-article-card__title {
    margin: 0 0 20px;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.bj-article-card__byline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: var(--bj-border);
    container-type: inline-size;
    container-name: bj-byline;
}
.bj-article-card__authors {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
    min-width: 0;
    /* basis 0：给咨询按钮留同行空间，避免被 flex-grow 挤到下一行 */
    flex: 1 1 0;
}
.bj-article-card__consult {
    flex: 0 0 auto;
    align-self: flex-start;
    margin-top: 0.125rem; /* 与头像/姓名顶对齐 */
    min-height: 2.75rem; /* ≥44px 触控 */
    padding: 0.75rem 1.125rem;
    font-size: 0.875rem;
    white-space: nowrap;
}
/* 窄 byline（侧栏挤压/手机）：按钮整行，避免落在简介下方左对齐留白 */
@container bj-byline (max-width: 36rem) {
    .bj-article-card__consult {
        flex: 1 1 100%;
        width: 100%;
        justify-content: center;
    }
}
.bj-author-row { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.bj-author-row__meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
/* Readable rem sizes (honor browser/OS text scale). Body copy floor ≈ 1rem. */
.bj-author-row__name { font-size: 1rem; font-weight: 700; line-height: 1.5; color: var(--bj-ink); text-decoration: none; }
a.bj-author-row__name:hover { color: var(--bj-primary); text-decoration: underline; }
.bj-author-row__bio {
    font-size: 0.9375rem; /* 15px @ 16px root */
    line-height: 1.7;
    color: var(--bj-ink-secondary);
    max-width: 36rem;
}
details.bj-author-row__bio > summary {
    cursor: pointer;
    list-style: none;
    font-size: inherit;
    font-weight: 400;
    line-height: inherit;
    color: inherit;
}
details.bj-author-row__bio > summary::-webkit-details-marker { display: none; }
details.bj-author-row__bio:not([open]) .bj-author-row__bio-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
details.bj-author-row__bio > summary::after {
    content: '展开';
    display: inline-block;
    margin-top: 2px;
    color: var(--bj-primary);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
}
details.bj-author-row__bio[open] > summary::after { content: '收起'; }

.bj-action-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
}
.bj-action-bar__group { display: inline-flex; align-items: center; gap: 16px; }
.bj-action-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--bj-ink-tertiary);
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: color 0.15s ease;
}
.bj-action-chip:hover { color: var(--bj-primary); }

.bj-facts-card {
    background: var(--bj-surface);
    border: var(--bj-border);
    border-radius: var(--bj-radius-xl);
    padding: 18px 20px;
}
.bj-facts-card__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.bj-facts-card__head [data-lucide] { color: var(--bj-primary); }
.bj-facts-card__head h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.bj-facts-card__head .bj-chip { margin-left: auto; }
.bj-facts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
}
.bj-facts-grid dd { margin: 0; }
.bj-facts-item__label { font-size: 11.5px; color: var(--bj-ink-tertiary); }
.bj-facts-item__value { font-size: 13px; font-weight: 600; color: var(--bj-ink); }
.bj-facts-card__foot {
    display: flex;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: var(--bj-border);
}
.bj-facts-card__views {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--bj-ink-tertiary);
}

/* Sections */
.bj-section { margin-top: 32px; }
.bj-section__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.bj-section__header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.bj-section__header h2::before {
    content: "";
    width: 4px;
    height: 20px;
    border-radius: 2px;
    background: var(--bj-primary);
    flex-shrink: 0;
}
.bj-section__count { margin-left: auto; font-size: 12px; color: var(--bj-ink-tertiary); }

/* Prose */
.bj-prose { color: var(--bj-ink); font-size: 14.5px; line-height: 1.9; }
.bj-prose > *:first-child { margin-top: 0; }
.bj-prose h2 {
    margin: 32px 0 14px;
    font-size: 19px;
    font-weight: 800;
    padding-bottom: 8px;
    border-bottom: var(--bj-border);
}
.bj-prose h3 { margin: 26px 0 12px; font-size: 16px; font-weight: 700; }
.bj-prose h4 { margin: 20px 0 10px; font-size: 14.5px; font-weight: 700; }
.bj-prose p { margin: 0 0 16px; }
.bj-prose a { color: var(--bj-primary); text-decoration: underline; text-underline-offset: 3px; }
.bj-prose strong { font-weight: 700; }
.bj-prose ul, .bj-prose ol { margin: 0 0 16px; padding-left: 24px; }
.bj-prose li { margin-bottom: 6px; }
.bj-prose li::marker { color: var(--bj-primary); }
.bj-prose blockquote {
    margin: 20px 0;
    padding: 12px 18px;
    border-left: 3px solid var(--bj-badge-clinical);
    background: rgba(5, 150, 105, 0.06);
    border-radius: 0 var(--bj-radius-md) var(--bj-radius-md) 0;
    color: var(--bj-ink-secondary);
}
.bj-prose blockquote p:last-child { margin-bottom: 0; }
.bj-prose img {
    max-width: 100%;
    height: auto;
    border-radius: var(--bj-radius-lg);
}
.bj-prose img:not([width]):not([height]) {
    aspect-ratio: 16 / 9;
}
.bj-footer__address {
    display: block;
    margin-top: 10px;
    font-style: normal;
    font-size: 13px;
    color: var(--bj-ink-secondary);
}
.bj-footer__address a { color: inherit; }
.bj-breadcrumb-bar .bj-breadcrumb [aria-current="page"] {
    color: var(--bj-ink-primary);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: min(48vw, 420px);
    display: inline-block;
}
.bj-prose hr { border: 0; border-top: var(--bj-border); margin: 28px 0; }
.bj-prose code {
    font-family: var(--bj-font-code);
    font-size: 0.9em;
    background: var(--bj-surface-container-low);
    border: 1px solid var(--bj-line);
    border-radius: var(--bj-radius-sm);
    padding: 1px 6px;
}
.bj-prose pre {
    background: var(--bj-code-bg);
    color: var(--bj-code-ink);
    padding: 16px 18px;
    border-radius: var(--bj-radius-lg);
    overflow-x: auto;
    margin: 0 0 16px;
}
.bj-prose pre code { background: transparent; border: 0; padding: 0; color: inherit; font-size: 13px; line-height: 1.7; }
.bj-prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 16px;
    font-size: 13px;
}
.bj-prose th, .bj-prose td {
    border: var(--bj-border);
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}
.bj-prose th { background: var(--bj-surface-container-low); font-weight: 700; }
.bj-prose--compact { font-size: 13.5px; }

/* Tags */
.bj-tags {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.bj-tags > li { list-style: none; margin: 0; padding: 0; display: flex; }
.bj-tag {
    font-size: 12px;
    font-weight: 600;
    color: var(--bj-secondary);
    background: rgba(69, 95, 135, 0.1);
    border: 1px solid rgba(69, 95, 135, 0.22);
    border-radius: var(--bj-radius-pill);
    padding: 4px 12px;
    line-height: 18px;
}

/* CTA card (article_detail_ads) */
.bj-cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 32px;
    padding: 20px 22px 20px 20px;
    background: var(--bj-surface);
    border: var(--bj-border);
    border-left: 4px solid var(--bj-primary);
    border-radius: var(--bj-radius-lg);
    box-shadow: var(--bj-shadow-card);
}
.bj-cta-card__copy { min-width: 0; flex: 1 1 auto; }
.bj-cta-card__badge {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--bj-primary);
}
.bj-cta-card__title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.35;
    color: var(--bj-ink);
}
.bj-cta-card__body {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--bj-ink-secondary);
}
.bj-cta-card__action {
    flex: 0 0 auto;
    padding: 12px 22px;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .bj-cta-card { flex-direction: column; align-items: stretch; }
    .bj-cta-card__action { width: 100%; }
    .bj-article-card__consult {
        flex: 1 1 100%;
        width: 100%;
        justify-content: center;
    }
}

/* Lead form page */
.bj-form-page {
    max-width: 720px;
    padding-top: 28px;
    padding-bottom: 64px;
}
.bj-form-page__intro { margin-bottom: 24px; }
.bj-form-page__intro h1 {
    margin: 8px 0 10px;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.35;
}
.bj-form-page__intro p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--bj-ink-secondary);
    max-width: 62ch;
}
.bj-form-page__intro .bj-kicker {
    line-height: 1.45;
}
.bj-form__notice {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: var(--bj-radius-md);
    background: color-mix(in srgb, var(--bj-live) 12%, var(--bj-surface));
    color: var(--bj-live-ink);
    font-size: 14px;
    font-weight: 600;
}
.bj-form__hint {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--bj-ink-tertiary);
}
.bj-form {
    background: var(--bj-surface);
    border: var(--bj-border);
    border-left: 4px solid var(--bj-primary);
    border-radius: var(--bj-radius-lg);
    box-shadow: var(--bj-shadow-card);
    padding: 22px 24px;
}
.bj-form__set {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}
.bj-form__fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}
.bj-field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.bj-field--wide { grid-column: 1 / -1; }
.bj-field__label {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--bj-ink);
}
.bj-field__label abbr,
.bj-field__check abbr {
    text-decoration: none;
    color: var(--bj-primary);
}
.bj-field__control {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: var(--bj-ink);
    background: var(--bj-surface);
    border: var(--bj-border);
    border-radius: var(--bj-radius-md);
    padding: 10px 12px;
}
.bj-field__control:focus {
    outline: none;
    border-color: var(--bj-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bj-primary) 14%, transparent);
}
.bj-field__error {
    margin: 0;
    font-size: 12.5px;
    color: var(--bj-danger);
}
.bj-field__check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13.5px;
    color: var(--bj-ink);
}
.bj-field__check input { margin-top: 3px; accent-color: var(--bj-primary); }
.bj-form__actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px;
}
@media (max-width: 640px) {
    .bj-form__fields { grid-template-columns: 1fr; }
    .bj-form__actions .bj-button { width: 100%; }
}

/* Related list */
.bj-related-list { display: flex; flex-direction: column; gap: 2px; }
/* Related grid card (new style) */
.bj-related-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.bj-related-grid > li { list-style: none; margin: 0; padding: 0; display: flex; }
.bj-related-grid > li > .bj-related-card { flex: 1; }
@media (max-width: 640px) {
    .bj-related-grid { grid-template-columns: 1fr; }
}
.bj-related-card {
    display: flex;
    flex-direction: column;
    background: var(--bj-surface);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--bj-radius-lg);
    overflow: hidden;
    color: var(--bj-ink);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.bj-related-card:hover {
    box-shadow: var(--bj-shadow-card-hover);
    transform: translateY(-2px);
    text-decoration: none;
}
.bj-related-card__image {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bj-surface-container-low);
}
.bj-related-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.bj-related-card:hover .bj-related-card__image img { transform: scale(1.05); }
.bj-related-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    flex: 1;
}
.bj-related-card__category {
    font-size: 11px;
    font-weight: 600;
    color: var(--bj-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.bj-related-card__title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    margin: 0;
    color: var(--bj-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bj-related-card__desc {
    font-size: 12.5px;
    color: var(--bj-ink-secondary);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bj-related-card__meta {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 11.5px;
    color: var(--bj-ink-tertiary);
    margin: auto 0 0;
    flex-wrap: wrap;
}
.bj-related-card__meta > * + *::before {
    content: "·";
    margin: 0 6px;
    opacity: 0.5;
}
.bj-related-card__author { font-weight: 500; }

/* Aside cards */
.bj-aside-card {
    background: var(--bj-surface);
    border: var(--bj-border);
    border-radius: var(--bj-radius-xl);
    padding: 14px;
    box-shadow: var(--bj-shadow-card);
}
.bj-aside-card__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: var(--bj-border);
}
.bj-aside-card__head [data-lucide] { color: var(--bj-primary); flex-shrink: 0; }
.bj-aside-card__head h2,
.bj-aside-card__head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
    min-width: 0;
}
.bj-aside-card__head .bj-live-dot { margin-left: auto; }
.bj-aside-card__action {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--bj-primary);
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 2px 4px;
}
.bj-aside-card__muted { margin: 12px 0 0; font-size: 11.5px; color: var(--bj-ink-tertiary); }

/* dt/dd pairs as label | value rows (not stacked column items) */
.bj-aside-facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 0;
    margin: 0;
}
.bj-aside-facts > dt,
.bj-aside-facts > dd {
    padding: 8px 0;
    border-bottom: 1px dashed var(--bj-line);
    font-size: 12.5px;
    line-height: 1.45;
}
.bj-aside-facts > dt:nth-last-of-type(1),
.bj-aside-facts > dd:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.bj-aside-facts > dt:first-of-type,
.bj-aside-facts > dd:first-of-type {
    padding-top: 0;
}
.bj-aside-facts > dt {
    color: var(--bj-ink-tertiary);
    font-weight: 400;
}
.bj-aside-facts > dd {
    margin: 0;
    color: var(--bj-ink);
    font-weight: 600;
    text-align: right;
    min-width: 0;
    overflow-wrap: anywhere;
}
.bj-aside-facts > dd.bj-code,
.bj-aside-facts .bj-code {
    font-family: var(--bj-font-code);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.bj-ai-brief { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bj-ai-brief li { display: flex; gap: 10px; font-size: 12.5px; color: var(--bj-ink-secondary); line-height: 1.7; }
.bj-ai-brief strong { color: var(--bj-ink); }
.bj-ai-brief__dot {
    flex-shrink: 0;
    margin-top: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bj-badge-clinical);
}
.bj-ai-brief__dot--warn { background: var(--bj-badge-patent); }

.bj-aside-related { display: flex; flex-direction: column; gap: 12px; }
.bj-aside-related__item {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--bj-radius-md);
    background: var(--bj-surface-container-low);
    color: var(--bj-ink);
    transition: background 0.2s ease;
}
.bj-aside-related__item:hover { background: var(--bj-surface-container); text-decoration: none; }
.bj-aside-related__img {
    width: 72px;
    height: 54px;
    border-radius: var(--bj-radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}
.bj-aside-related__content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}
.bj-aside-related__title {
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bj-aside-related__meta {
    font-size: 11px;
    color: var(--bj-ink-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bj-aside-searches {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.bj-aside-searches > li { list-style: none; margin: 0; padding: 0; }
.bj-aside-searches a {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--bj-secondary);
    padding: 7px 8px;
    border-radius: var(--bj-radius-md);
    overflow-wrap: anywhere;
}
.bj-aside-searches a:hover {
    background: var(--bj-surface-container-low);
    text-decoration: none;
}

.bj-bibtex {
    margin: 0;
    font-family: var(--bj-font-code);
    font-size: 11px;
    line-height: 1.7;
    color: var(--bj-code-ink);
    background: var(--bj-code-bg);
    border-radius: var(--bj-radius-md);
    padding: 12px 14px;
    overflow-x: auto;
}

/* ---------- About page ---------- */
.bj-about-hero {
    padding: 48px 24px 40px;
    background:
        radial-gradient(900px 280px at 90% -30%, rgba(107, 1, 27, 0.07), transparent 70%),
        var(--bj-surface);
    border-bottom: var(--bj-border);
}
.bj-about-hero__inner { max-width: 860px; margin: 0 auto; text-align: center; }
.bj-about-hero h1 { margin: 16px 0 12px; font-size: 28px; font-weight: 800; }
.bj-about-hero__excerpt {
    margin: 0 auto 24px;
    max-width: 640px;
    font-size: 15px;
    color: var(--bj-ink-secondary);
}
.bj-about-hero__actions { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }

.bj-about-prose > h2:first-child { margin-top: 0; }
.bj-about-prose > p:first-of-type {
    font-size: 15.5px;
    color: var(--bj-ink-secondary);
}
.bj-about-prose > ol {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    counter-reset: bj-about-step;
}
.bj-about-prose > ol > li {
    counter-increment: bj-about-step;
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr);
    gap: 12px 14px;
    margin: 0 0 14px;
    padding: 14px 16px;
    background: var(--bj-surface);
    border: var(--bj-border);
    border-radius: var(--bj-radius-lg);
}
.bj-about-prose > ol > li::before {
    content: counter(bj-about-step, decimal-leading-zero);
    grid-row: 1 / span 2;
    font-family: var(--bj-font-code);
    font-size: 13px;
    font-weight: 700;
    color: var(--bj-primary);
    line-height: 1.4;
}
.bj-about-prose > ol > li > strong {
    grid-column: 2;
    font-size: 14px;
}
.bj-about-prose > ol > li > p {
    grid-column: 2;
    margin: 0;
    color: var(--bj-ink-secondary);
    font-size: 13.5px;
}
.bj-about-prose > dl {
    margin: 0 0 20px;
    display: grid;
    gap: 12px;
}
.bj-about-prose > dl > div {
    padding: 14px 16px;
    background: var(--bj-surface);
    border: var(--bj-border);
    border-radius: var(--bj-radius-lg);
}
.bj-about-prose > dl dt {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
}
.bj-about-prose > dl dd {
    margin: 0;
    color: var(--bj-ink-secondary);
    font-size: 13.5px;
}

.bj-sidepanel {
    position: sticky;
    top: calc(var(--bj-header-h) + 16px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-self: start;
    max-height: calc(100vh - var(--bj-header-h) - 32px);
    overflow-y: auto;
}
.bj-sidepanel__card {
    background: var(--bj-surface);
    border: var(--bj-border);
    border-radius: var(--bj-radius-xl);
    padding: 14px;
    box-shadow: var(--bj-shadow-card);
}
.bj-sidepanel__card h2 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 800;
    padding-bottom: 12px;
    border-bottom: var(--bj-border);
}
.bj-about-index { display: flex; flex-direction: column; gap: 2px; }
.bj-about-index__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.bj-about-index a {
    padding: 7px 8px;
    border-radius: var(--bj-radius-md);
    font-size: 13px;
    color: var(--bj-ink-secondary);
    border-left: 2px solid transparent;
}
.bj-about-index a.bj-about-index__link--sub { padding-left: 18px; }
.bj-about-index a:hover {
    background: var(--bj-surface-container-low);
    color: var(--bj-ink);
    text-decoration: none;
    border-left-color: var(--bj-primary);
}
.bj-sidepanel__stats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bj-sidepanel__stats li { display: flex; flex-direction: column; gap: 2px; }
.bj-sidepanel__stats span { font-size: 11.5px; color: var(--bj-ink-tertiary); }
.bj-sidepanel__stats strong { font-size: 13px; font-weight: 700; color: var(--bj-ink); }

/* ---------- Archive index ---------- */
.bj-archive-body { padding: 28px 24px 64px; }
.bj-archive-ledger {
    max-width: var(--bj-shell);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.bj-archive-block {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    background: var(--bj-surface);
    border: var(--bj-border);
    border-radius: var(--bj-radius-xl);
    padding: 20px 24px;
    box-shadow: var(--bj-shadow-card);
}
.bj-archive-year {
    margin: 0;
    display: flex;
    flex-direction: column;
    font-size: inherit;
    font-weight: inherit;
}
.bj-archive-year__label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--bj-ink-tertiary); }
.bj-archive-year__value { font-size: 40px; font-weight: 800; line-height: 1.1; color: var(--bj-primary); }
.bj-archive-year__meta { font-size: 12px; color: var(--bj-ink-secondary); }
.bj-archive-months {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.bj-archive-months > li { list-style: none; margin: 0; padding: 0; display: flex; }
.bj-archive-months > li > .bj-archive-month { flex: 1; }
.bj-archive-month {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: var(--bj-border);
    border-radius: var(--bj-radius-lg);
    background: var(--bj-surface-container-low);
    color: var(--bj-ink);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.bj-archive-month:hover {
    border-color: var(--bj-primary);
    background: var(--bj-surface);
    text-decoration: none;
}
.bj-archive-month__label { font-size: 12px; color: var(--bj-ink-tertiary); font-family: var(--bj-font-code); }
.bj-archive-month__count { flex: 1 1 auto; font-size: 13px; font-weight: 700; }
.bj-archive-month [data-lucide] { font-size: 14px; color: var(--bj-ink-tertiary); }
.bj-archive-month:hover [data-lucide] { color: var(--bj-primary); }

/* ---------- Footer ---------- */
.bj-footer {
    margin-left: var(--bj-sidebar-w);
    border-top: var(--bj-border);
    background: var(--bj-surface);
    padding: 40px 0 24px;
}
.bj-footer__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px;
    padding-bottom: 28px;
}
.bj-footer__grid > div,
.bj-footer__grid > nav,
.bj-footer__grid > section { min-width: 0; }
.bj-footer__label {
    display: block;
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bj-ink);
}
.bj-footer__grid ul { list-style: none; margin: 0; padding: 0; }
.bj-footer__grid a {
    display: block;
    font-size: 13px;
    color: var(--bj-ink-secondary);
    padding: 3px 0;
}
.bj-footer__grid a:hover { color: var(--bj-primary); text-decoration: none; }
.bj-footer__muted { margin: 0; font-size: 12.5px; color: var(--bj-ink-tertiary); line-height: 1.7; }
.bj-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: var(--bj-border);
    font-size: 12.5px;
    color: var(--bj-ink-tertiary);
}
.bj-footer__bottom small { font-size: inherit; }

/* ---------- Mobile bottom tab bar ---------- */
.bj-bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: var(--bj-border);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.bj-bottom-nav > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex: 1;
    width: 100%;
}
.bj-bottom-nav > ul > li {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}
.bj-bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 4px 10px;
    border-radius: var(--bj-radius-md);
    font-size: 10.5px;
    color: var(--bj-ink-tertiary);
}
button.bj-bottom-nav__item {
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    appearance: none;
    -webkit-appearance: none;
}
.bj-bottom-nav__item [data-lucide] { font-size: 19px; }
.bj-bottom-nav__label {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bj-bottom-nav__item.is-active { color: var(--bj-primary); }
.bj-bottom-nav__item:hover { text-decoration: none; color: var(--bj-primary); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px) {
    .bj-article-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; }
    .bj-footer__grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}

@media (max-width: 900px) {
    /* One sidebar DOM: off-canvas drawer on small screens */
    .bj-sidebar {
        display: flex;
        width: min(320px, 84vw);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 80;
    }
    .bj-sidebar.is-open { transform: translateX(0); }
    .bj-icon-btn.bj-sidebar__close { display: inline-flex; }
    .bj-sidebar__collapse-btn { display: none; }
    .bj-main,
    body.bj-sidebar-collapsed .bj-main { margin-left: 0; }
    .bj-footer,
    body.bj-sidebar-collapsed .bj-footer { margin-left: 0; }
    .bj-hero { padding: 36px 20px 32px; }
    .bj-page-hero { padding: 28px 20px 24px; }
    .bj-feed { padding: 20px 16px calc(70px + env(safe-area-inset-bottom)); }
    .bj-article-shell { padding: 20px 16px calc(70px + env(safe-area-inset-bottom)); }
    .bj-article-layout { padding: 24px 16px calc(70px + env(safe-area-inset-bottom)); }
    .bj-archive-body { padding: 20px 16px calc(70px + env(safe-area-inset-bottom)); }
    .bj-article-aside { display: flex; flex-direction: column; gap: 16px; }
    .bj-article-aside > .bj-sidepanel__card { display: none; }
    .bj-article-layout { grid-template-columns: minmax(0, 1fr); }
    .bj-about-layout .bj-sidepanel { display: none; }
    .bj-bottom-nav { display: flex; }
    .bj-page-hero__grid { grid-template-columns: 1fr; gap: 16px; }
    .bj-page-hero__index { text-align: left; }
    .bj-stat__value { font-size: 28px; }
    .bj-archive-block { grid-template-columns: 1fr; gap: 16px; }
    .bj-hero__title, .bj-page-hero h1, .bj-about-hero h1 { font-size: 22px; }
    .bj-article-card { padding: 20px; }
    .bj-article-card__title { font-size: 21px; }
}

@media (max-width: 560px) {
    .bj-shell { padding-left: 16px; padding-right: 16px; }
    .bj-tab { padding: 6px 10px; font-size: 12.5px; gap: 4px; }
    .bj-hero__search { height: 46px; padding-left: 14px; }
    .bj-hero__search-btn { width: 36px; height: 36px; }
    .bj-tab__count { display: none; }
    .bj-dossier { flex-direction: column; padding: 16px; }
    .bj-paper { display: none; }
    .bj-footer__grid { grid-template-columns: 1fr; gap: 20px; }
    .bj-footer { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
    .bj-facts-grid { grid-template-columns: 1fr; }
    .bj-about-hero__actions { flex-direction: column; }
    .bj-about-hero__actions .bj-button { width: 100%; }
    .bj-action-bar__group { width: 100%; }
    .bj-pagination { gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================
   Interaction & polish
   ============================================================ */

/* 收藏按钮：aria-pressed 切换态（本机 localStorage） */
.bj-action-chip.is-bookmarked { color: var(--bj-primary); }
.bj-action-chip.is-bookmarked svg { fill: currentColor; }

/* Mobile overlap fixes & toast */
.bj-toast {
    position: fixed;
    left: 50%;
    bottom: calc(86px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 200;
    background: var(--bj-toast-bg);
    color: var(--bj-toast-ink);
    font-size: 12.5px;
    line-height: 1.5;
    padding: 9px 16px;
    border-radius: 9999px;
    box-shadow: 0 12px 28px -6px rgba(17, 24, 39, .25);
    max-width: 88vw;
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
}
.bj-toast.is-visible { opacity: 1; }

/* Off-screen helper for clipboard fallback (no inline JS styles). */
.bj-clipboard-helper {
    position: fixed;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* ============================================================
   Anti width-jitter defense layer (2026-10-03)
   修复移动端每次打开页面宽度不一致的问题
   ============================================================ */

/* 1. 滚动条占位稳定，消除断点抖动（滚动条出现/消失导致内容宽度变化） */
html { scrollbar-gutter: stable; }

/* 2. 任何单点溢出不再产生横向滚动条（clip 不创建滚动容器，优于 hidden） */
html, .bj-body { overflow-x: clip; }

/* 3. 嵌入内容统一限宽（防止广告/iframe/图片撑破） */
img, video, svg, canvas, iframe { max-width: 100%; }
img, video { height: auto; }

/* 4. 正文长文本断行：长 URL、英文串、数字串不换行是溢出的最大来源 */
.bj-prose p, .bj-prose li, .bj-prose td, .bj-prose blockquote,
.bj-related-card__desc, .bj-related-card__title,
.bj-article-card__desc, .bj-article-card__title,
.bj-feed__summary, .bj-archive-month {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* 5. 正文表格：ArticleHtmlPresenter 输出 .article-table-wrap / .article-table */
.bj-prose table { max-width: 100%; }
.bj-prose .article-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 1.75rem 0;
    border: var(--bj-border);
    border-radius: var(--bj-radius-lg);
    background: var(--bj-surface);
}
.bj-prose .article-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 0.98rem;
    line-height: 1.75;
}
.bj-prose .article-table thead { background: var(--bj-surface-container-low); }
.bj-prose .article-table th,
.bj-prose .article-table td {
    padding: 0.9rem 1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: var(--bj-border);
    color: var(--bj-ink-secondary);
    white-space: normal;
}
.bj-prose .article-table th { font-weight: 700; color: var(--bj-ink); }
.bj-prose .article-table .has-text-align-center { text-align: center; }
.bj-prose .article-table .has-text-align-right { text-align: right; }
.bj-prose .article-table tbody tr:nth-child(even) { background: var(--bj-surface-subtle); }
.bj-prose .article-table tbody tr:last-child td { border-bottom: none; }
.bj-prose .article-table code { white-space: nowrap; }
.bj-prose .article-table-caption {
    caption-side: top;
    text-align: left;
    padding: 0.75rem 1rem 0.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bj-ink-secondary);
}

/* 6. 分类/标签流式排列容器兜底 */
.bj-tabs, .bj-tags, .bj-status-chips { max-width: 100%; }

/* 7. 图标预留固定尺寸（lucide svg 在部分浏览器加载期间尺寸漂移） */
svg.lucide { width: 1em; height: 1em; }

/* ---------- Public error pages (401–503) ---------- */
.bj-body--error {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(920px 420px at 8% -18%, rgba(107, 1, 27, 0.09), transparent 58%),
        radial-gradient(780px 360px at 100% 0%, rgba(69, 95, 135, 0.10), transparent 52%),
        var(--bj-page);
}
.bj-error-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: var(--bj-header-h);
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: var(--bj-border);
    backdrop-filter: blur(10px);
}
.bj-error-bar__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--bj-ink);
    font-weight: 800;
    font-size: 15px;
    letter-spacing: -0.01em;
    text-decoration: none;
}
a.bj-error-bar__brand,
a.bj-error-bar__brand:link,
a.bj-error-bar__brand:visited {
    color: var(--bj-ink);
    -webkit-text-fill-color: var(--bj-ink);
    text-decoration: none;
}
.bj-error-bar__brand:hover,
a.bj-error-bar__brand:hover {
    color: var(--bj-primary);
    -webkit-text-fill-color: var(--bj-primary);
    text-decoration: none;
}
.bj-error-bar__brand img {
    width: 40px;
    height: 40px;
    border-radius: var(--bj-radius-md);
    object-fit: contain;
    background: var(--bj-surface);
    border: var(--bj-border);
}
.bj-error {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px 40px;
}
.bj-error__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 560px;
    text-align: center;
}
.bj-error__status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--bj-ink-secondary);
    background: var(--bj-surface);
    border: var(--bj-border);
    border-radius: var(--bj-radius-pill);
    padding: 5px 14px;
}
.bj-error__status-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bj-primary);
    box-shadow: 0 0 0 3px rgba(107, 1, 27, 0.14);
}
.bj-error__code {
    margin: 0 0 8px;
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--bj-primary);
}
.bj-error__title {
    margin: 0 0 12px;
    font-size: clamp(24px, 3.6vw, 30px);
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--bj-ink);
}
.bj-error__lead {
    margin: 0 0 28px;
    max-width: 460px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--bj-ink-secondary);
}
.bj-error__search {
    width: 100%;
    max-width: 480px;
    margin: 0 0 20px;
}
.bj-error__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.bj-error-foot {
    padding: 12px 20px 24px;
    text-align: center;
    color: var(--bj-ink-tertiary);
    font-size: 12.5px;
}
.bj-error-foot p { margin: 0; }

@media (max-width: 640px) {
    .bj-error-bar { padding: 10px 16px; }
    .bj-error {
        padding: 28px 16px 32px;
        align-items: flex-start;
    }
    .bj-error__code { font-size: 48px; }
    .bj-error__lead { margin-bottom: 22px; }
    .bj-error__actions { width: 100%; }
    .bj-error__actions .bj-button { width: 100%; }
}
