/* bento-board · 便当格 —— 多色圆角格子拼板贯穿全站 */
:root {
    --bb-canvas: #eceaf7;
    --bb-tile: #ffffff;
    --bb-ink: #23203b;
    --bb-soft: #605b7d;
    --bb-mint: #b8f2e6;
    --bb-peach: #ffd6c2;
    --bb-butter: #fff1b8;
    --bb-sky: #c9dcff;
    --bb-violet: #6c4cf5;
    --bb-display: Unbounded, "Segoe UI", system-ui, sans-serif;
    --bb-body: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
    --bb-r: 22px;
    --bb-gap: 14px;
    --pagination-accent: #6c4cf5;
}

body.theme-bento { margin: 0; background: var(--bb-canvas); color: var(--bb-ink); font-family: var(--bb-body); }
:where(.theme-bento) a { color: inherit; text-decoration: none; }
.theme-bento :focus-visible { outline: 3px solid var(--bb-violet); outline-offset: 3px; }

.bb-tile { border-radius: var(--bb-r); background: var(--bb-tile); }
.bb-tone-white { background: var(--bb-tile); }
.bb-tone-mint { background: var(--bb-mint); }
.bb-tone-peach { background: var(--bb-peach); }
.bb-tone-butter { background: var(--bb-butter); }
.bb-tone-sky { background: var(--bb-sky); }
.bb-tone-violet { background: var(--bb-violet); color: #fff; }

/* ---------- 顶栏 ---------- */
.bb-header { padding: 14px 16px 0; }
.bb-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 10px 10px 10px 16px;
    border-radius: var(--bb-r);
    background: var(--bb-tile);
}
.bb-brand { display: inline-flex; align-items: center; gap: 12px; margin-right: auto; font-family: var(--bb-display); font-weight: 700; font-size: 1.2rem; }
.bb-brand-mark { display: grid; grid-template-columns: 12px 12px; gap: 3px; }
.bb-brand-mark i { width: 12px; height: 12px; border-radius: 4px; background: var(--bb-mint); }
.bb-brand-mark i:nth-child(2) { background: var(--bb-peach); }
.bb-brand-mark i:nth-child(3) { background: var(--bb-butter); }
.bb-brand-mark i:nth-child(4) { background: var(--bb-violet); }
.bb-nav { display: flex; gap: 6px; }
.bb-nav a { padding: 10px 16px; border-radius: 14px; font-weight: 600; font-size: .92rem; }
.bb-nav a:hover { background: var(--bb-canvas); }
.bb-nav a.is-on { background: var(--bb-ink); color: #fff; }
.bb-menu-toggle { display: none; text-decoration: none; color: inherit; }

/* ---------- 版心 ---------- */
.bb-main { min-height: 60vh; padding-bottom: 60px; }
.bb-wrap { max-width: 1240px; margin: 0 auto; padding: 12px 16px 0; }
.bb-crumb { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 4px 14px; font-size: .85rem; color: var(--bb-soft); }
.bb-crumb a { font-weight: 600; color: var(--bb-ink); }
.bb-section-title { margin: 36px 4px 14px; font-family: var(--bb-display); font-weight: 700; font-size: 1.35rem; }

/* ---------- 拼板 ---------- */
.bb-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; gap: var(--bb-gap); }
.bb-board-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bb-board-open { grid-template-rows: repeat(2, minmax(220px, auto)); }
.bb-hero { grid-column: span 2; grid-row: span 2; }
.bb-tall { grid-row: span 2; }
.bb-wide { grid-column: span 2; }

.bb-story { display: flex; flex-direction: column; overflow: hidden; min-height: 210px; transition: transform .2s ease; }
.bb-story:hover { transform: translateY(-3px) rotate(-.4deg); }
.bb-story img { display: block; width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; }
.bb-hero img, .bb-tall img { flex: 1; aspect-ratio: auto; min-height: 220px; }
.bb-story-body { display: grid; gap: 10px; padding: 18px; }
.bb-chip {
    justify-self: start;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(35, 32, 59, .08);
    font-size: .74rem;
    font-weight: 800;
}
.bb-tone-violet .bb-chip { background: rgba(255, 255, 255, .2); }
.bb-story-title { font-family: var(--bb-display); font-weight: 500; font-size: 1.02rem; line-height: 1.3; }
.bb-hero .bb-story-title { font-size: clamp(1.4rem, 2.4vw, 2rem); line-height: 1.15; font-weight: 700; }
.bb-story-date { font-size: .8rem; color: var(--bb-soft); }
.bb-story:not(:has(img)) { justify-content: flex-end; }
.bb-story:not(:has(img)) .bb-story-title { font-size: 1.2rem; }

/* 分类页拼板标头 */
.bb-head-name { display: grid; gap: 14px; align-content: end; min-height: 170px; padding: 22px; }
.bb-head-name h1 { margin: 0; font-family: var(--bb-display); font-weight: 700; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.02; }

/* 话题索引 */
.bb-topic { display: grid; gap: 10px; align-content: space-between; min-height: 170px; padding: 20px; }
.bb-topic-name { font-family: var(--bb-display); font-weight: 700; font-size: 1.25rem; line-height: 1.15; }
.bb-topic-desc { font-size: .9rem; line-height: 1.5; color: var(--bb-soft); }
.bb-topic-go { justify-self: end; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--bb-ink); color: #fff; font-weight: 800; }

/* ---------- 广告壳 ---------- */
.bb-ad:has(.ad) { margin: 24px 0; overflow: hidden; }
.bb-ad:has(.ad) .ad { min-height: 250px; margin: 0 !important; }
.bb-board .bb-ad:has(.ad) { margin: 10px 0; }

.bb-empty { padding: 40px 4px; color: var(--bb-soft); }
.bb-pager { margin-top: 30px; }

/* ---------- 页脚 ---------- */
.bb-footer { padding: 30px 16px 48px; }
.bb-footer-grid { display: grid; grid-template-columns: 1.3fr 2fr .7fr; gap: var(--bb-gap); max-width: 1240px; margin: 0 auto; }
.bb-footer-brand { display: grid; gap: 8px; padding: 22px; }
.bb-footer-brand b { font-family: var(--bb-display); font-size: 1.4rem; }
.bb-footer-links { display: flex; flex-wrap: wrap; align-content: center; gap: 4px 20px; padding: 18px 22px; }
.bb-footer-links a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 600; }
.bb-footer-year { display: grid; place-items: center; padding: 22px; font-family: var(--bb-display); font-weight: 700; }

/* ---------- 断点 ---------- */
@media (max-width: 1023px) {
    .bb-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bb-board-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bb-board-open { grid-template-rows: none; }
    .bb-head-name { grid-column: 1 / -1; }
    .bb-footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
    .bb-header { padding: 10px 10px 0; }
    .bb-bar { padding: 8px 8px 8px 12px; }
    .bb-brand { font-size: 1rem; }
    .bb-nav { display: none; }
    .bb-menu-toggle { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--bb-canvas); }
    .bb-wrap { padding: 10px 10px 0; }

    .bb-board, .bb-board-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .bb-hero, .bb-wide { grid-column: 1 / -1; grid-row: auto; }
    .bb-tall { grid-row: auto; }
    .bb-board-3 .bb-story { grid-column: 1 / -1; }
    .bb-story { min-height: 150px; }
    .bb-story-body { padding: 14px; }
    .bb-story-title, .bb-story:not(:has(img)) .bb-story-title { font-size: .92rem; overflow-wrap: anywhere; hyphens: auto; }
    .bb-hero .bb-story-title { font-size: 1.35rem; }
}

/* 分类页移动端：紧凑横排，缩略图 96px 宽、不展示摘要，首屏留给广告和更多条目 */
@media (max-width: 767px) {
    .bb-cat-list .bb-story { flex-direction: row; align-items: stretch; min-height: 0; }
    .bb-cat-list .bb-story img { flex: none; width: 96px; aspect-ratio: auto; height: auto; }
    .bb-cat-list .bb-story-body { gap: 6px; padding: 12px; }
}

/* 浏览器闸门（2026-10-21）：长站点名在移动端折成多行、页眉超出 56–64px，改为单行省略；过矮的页眉补到 56px */
@media (max-width: 767px) {
    .bb-brand { min-width: 0; max-width: 100%; }
    .bb-brand-text { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .bb-brand-mark { flex: none; }
    .bb-header { padding-top: 4px; }
    .bb-bar { padding-top: 6px; padding-bottom: 6px; }
}

/* 浏览器闸门（2026-10-21）：分类页不用 dense 回填——两列时第 4 篇会被补进 Banner 2 之前的空位，广告落到第 4 篇之后。
   改为首条通栏，让前 3 篇恰好排满两行 */
.bb-cat-list { grid-auto-flow: row; }
@media (min-width: 768px) and (max-width: 1023px) {
    .bb-cat-list > :first-child { grid-column: 1 / -1; }
}
