/* label-maker · 标签机 —— 分类、日期、栏目标题都是压凸字的彩色胶带，缺口两端，贯穿全站 */
:root {
    --lm-bench: #cfd8e3;
    --lm-board: #ffffff;
    --lm-ink: #17191d;
    --lm-soft: #4c5562;
    --lm-rule: #b8c3d0;
    --lm-link: #1a56a8;
    --lm-display: "Martian Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
    --lm-body: Onest, system-ui, -apple-system, "Segoe UI", sans-serif;
    --pagination-accent: #c8102e;
}

body.theme-dymo { margin: 0; color: var(--lm-ink); font-family: var(--lm-body); font-size: 16px; background: var(--lm-bench); }
:where(.theme-dymo) a { color: inherit; text-decoration: none; }
.theme-dymo :focus-visible { outline: 3px solid var(--lm-link); outline-offset: 3px; }
.lm-skip { position: absolute; left: -9999px; }
.lm-skip:focus { left: 12px; top: 12px; z-index: 50; padding: 10px 14px; background: var(--lm-board); font-weight: 700; }
.lm-bench:focus { outline: none; }

/* ---------- 胶带：压凸白字 + 缺口两端 ---------- */
.lm-tape { display: inline-block; min-width: 0; max-width: 100%; box-sizing: border-box; padding: 4px 14px; background: var(--lm-tape-bg, #1d1f24); color: #fff;
    font-family: var(--lm-display); font-weight: 700; font-size: .74rem; line-height: 1.5; letter-spacing: .08em; text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .45), 0 -1px 0 rgba(255, 255, 255, .22);
    clip-path: polygon(0 0, 100% 0, calc(100% - 5px) 50%, 100% 100%, 0 100%, 5px 50%);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.lm-tape-ink { --lm-tape-bg: #1d1f24; }
.lm-tape-red, .lm-tape-c0 { --lm-tape-bg: #c8102e; }
.lm-tape-c1 { --lm-tape-bg: #1a56a8; }
.lm-tape-c2 { --lm-tape-bg: #21734a; }
.lm-tape-c3 { --lm-tape-bg: #b54708; }
.lm-tape-c4 { --lm-tape-bg: #1d1f24; }
a.lm-tape:hover { filter: brightness(1.15); }
.lm-tapes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; min-width: 0; }

/* ---------- 顶栏 ---------- */
.lm-head { background: var(--lm-board); border-bottom: 3px solid var(--lm-ink); }
.lm-head-inner { display: flex; align-items: center; gap: 24px; max-width: 1320px; margin: 0 auto; padding: 12px 24px; }
.lm-brand { display: inline-flex; align-items: center; gap: 12px; margin-right: auto; min-width: 0; }
.lm-brand-wheel { flex: none; width: 30px; height: 30px; border-radius: 50%; background: repeating-conic-gradient(#1d1f24 0 15deg, #c8102e 15deg 30deg); border: 3px solid #1d1f24; box-sizing: border-box; }
.lm-brand-tape { min-width: 0; padding: 6px 18px; font-size: 1.05rem; }
.lm-brand-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-nav { display: flex; gap: 4px; }
.lm-nav a { padding: 8px 12px; font-weight: 500; }
.lm-nav a:hover { background: var(--lm-bench); }
.lm-nav a.is-on { font-weight: 800; box-shadow: inset 0 -4px 0 #c8102e; }
.lm-menu-toggle { display: none; color: inherit; }

/* ---------- 版心 ---------- */
.lm-bench { min-height: 60vh; padding-bottom: 40px; }
.lm-bench-inner { max-width: 1320px; margin: 0 auto; padding: 24px 24px 0; }
.lm-crumb { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; font-size: .9rem; color: var(--lm-soft); }
.lm-crumb a { color: var(--lm-link); font-weight: 700; }
.lm-empty { margin: 32px 0; padding: 24px; background: var(--lm-board); border: 2px solid var(--lm-ink); text-align: center; list-style: none; }
.lm-pager { margin-top: 32px; }
.lm-page-title { margin: 8px 0 20px; }
.lm-page-title .lm-tape { padding: 8px 22px; font-size: clamp(1.2rem, 2.6vw, 1.7rem); }

.lm-shelf { margin-top: 36px; }
.lm-shelf-head { margin: 0 0 16px; padding-bottom: 10px; border-bottom: 2px solid var(--lm-ink); }
.lm-shelf-head .lm-tape { font-size: .9rem; padding: 5px 16px; }

/* ---------- 卡片：白板 + 跨图边的分类胶带 ---------- */
.lm-cards { display: grid; gap: 24px; }
.lm-cards-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lm-cards-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lm-card { min-width: 0; }
.lm-card-link { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; height: 100%; box-sizing: border-box; background: var(--lm-board); border: 2px solid var(--lm-ink); }
.lm-card-link:hover { box-shadow: 6px 6px 0 var(--lm-ink); }
.lm-card-photo { position: relative; display: block; }
.lm-card-photo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: var(--lm-rule); border-bottom: 2px solid var(--lm-ink); }
.lm-card-tape { position: absolute; left: 12px; bottom: -12px; max-width: calc(100% - 24px); }
.lm-card-title { padding: 22px 16px 8px; font-weight: 700; font-size: 1.12rem; line-height: 1.3; }
.lm-card-link:hover .lm-card-title { text-decoration: underline; }
.lm-card-date { padding: 0 16px 16px; font-family: var(--lm-display); font-size: .74rem; color: var(--lm-soft); white-space: nowrap; }

/* ---------- 首页头条 ---------- */
.lm-lead-link { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); background: var(--lm-board); border: 3px solid var(--lm-ink); }
.lm-lead-link:hover { box-shadow: 8px 8px 0 var(--lm-ink); }
.lm-lead-text { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 16px; padding: 28px 30px; }
.lm-lead-title { font-weight: 800; font-size: clamp(1.7rem, 2.6vw, 2.4rem); line-height: 1.12; letter-spacing: -.01em; }
.lm-lead-link:hover .lm-lead-title { text-decoration: underline; }
.lm-lead-excerpt { color: var(--lm-soft); line-height: 1.6; }
.lm-lead-link img { display: block; width: 100%; height: 100%; min-height: 320px; aspect-ratio: 16 / 9; object-fit: cover; background: var(--lm-rule); border-right: 3px solid var(--lm-ink); }

/* ---------- 分类页：抽屉面板 ---------- */
.lm-cat-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-width: 1000px; margin: 0; padding: 0; list-style: none; }
.lm-drawer { min-width: 0; }
.lm-drawer-link { display: grid; grid-template-columns: 200px minmax(0, 1fr) 36px; gap: 18px; align-items: center; padding: 12px; background: linear-gradient(#f4f6f8, #e6eaef); border: 2px solid var(--lm-ink); }
.lm-drawer-link:hover { background: var(--lm-board); }
.lm-drawer-link img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: var(--lm-rule); border: 2px solid var(--lm-ink); box-sizing: border-box; }
.lm-drawer-text { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 8px; }
.lm-drawer-title { font-weight: 700; font-size: 1.25rem; line-height: 1.25; }
.lm-drawer-link:hover .lm-drawer-title { text-decoration: underline; }
.lm-drawer-excerpt { color: var(--lm-soft); line-height: 1.55; }
.lm-drawer-pull { width: 28px; height: 56px; border: 3px solid var(--lm-ink); border-radius: 14px; box-sizing: border-box; background: var(--lm-board); }
.lm-cat-list > .lm-ad { list-style: none; }
.lm-cat-list > .lm-ad:not(:has(.ad)) { display: none; }

/* ---------- 分类索引：长胶带柜 ---------- */
.lm-cabinet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; padding: 0; list-style: none; }
.lm-cabinet-row { min-width: 0; }
.lm-cabinet-row a { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 10px; height: 100%; box-sizing: border-box; padding: 16px 18px; background: var(--lm-board); border: 2px solid var(--lm-ink); }
.lm-cabinet-row a:hover { box-shadow: 6px 6px 0 var(--lm-ink); }
.lm-cabinet-tape { padding: 6px 20px; font-size: .95rem; }
.lm-cabinet-desc { color: var(--lm-soft); font-size: .95rem; line-height: 1.5; }

/* ---------- 广告壳：无广告时塌陷 ---------- */
.lm-ad:has(.ad) { margin: 24px 0; }
.lm-ad:has(.ad) .ad { min-height: 250px; margin: 0 !important; }

/* ---------- 页脚：黑底链接胶带 ---------- */
.lm-foot { margin-top: 32px; padding: 28px 24px 96px; background: var(--lm-ink); color: #e8ebef; }
.lm-foot-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 1320px; margin: 0 auto; }
.lm-foot-title { margin: 0; }
.lm-foot-title .lm-tape { font-size: .9rem; padding: 6px 18px; }
.lm-foot-tapes { display: flex; flex-wrap: wrap; gap: 12px; }
.lm-foot-tapes .lm-tape { padding: 8px 18px; font-size: .8rem; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.lm-foot-tapes .lm-tape-c4 { --lm-tape-bg: #5a6270; }
.lm-foot-note { margin: 0; font-size: .9rem; color: #c3cad3; }

/* 文字容器显式写列宽、胶带允许收缩：超长标题或分类名不撑宽隐式列 */
.lm-tapes > *, .lm-drawer-text > * { min-width: 0; }

/* ---------- 共享页面：白板面板 ---------- */
.theme-dymo .site-menu, .theme-dymo .site-search, .theme-dymo .static-page, .theme-dymo .theme-error { --menu-accent: #c8102e; background: var(--lm-board); border: 2px solid var(--lm-ink); }

/* ---------- 断点 ---------- */
@media (min-width: 1600px) {
    .lm-bench-inner, .lm-head-inner, .lm-foot-inner { max-width: 1540px; }
    .lm-cards-four { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .lm-cabinet { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
    .lm-lead-link { grid-template-columns: minmax(0, 1fr); }
    .lm-lead-link img { min-height: 0; aspect-ratio: 24 / 9; border-right: 0; border-bottom: 3px solid var(--lm-ink); }
    .lm-cards-four { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lm-drawer-link { grid-template-columns: 170px minmax(0, 1fr) 30px; }
}

@media (max-width: 767px) {
    .lm-head-inner { min-height: 56px; padding: 2px 12px; gap: 10px; }
    .lm-brand { gap: 8px; }
    .lm-brand-wheel { width: 24px; height: 24px; }
    .lm-brand-tape { padding: 5px 14px; font-size: .86rem; }
    .lm-menu-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 2px solid var(--lm-ink); box-sizing: border-box; }
    .lm-bench-inner { padding: 12px 12px 0; }
    .lm-lead-link img { aspect-ratio: 16 / 9; }
    .lm-lead-text { gap: 10px; padding: 14px 14px 16px; }
    .lm-lead-title { font-size: 1.4rem; }
    .lm-lead-excerpt { display: none; }
    .lm-shelf { margin-top: 26px; }
    .lm-cards { gap: 12px; }
    .lm-cards-three, .lm-cards-four { grid-template-columns: minmax(0, 1fr); }
    .lm-card-link { grid-template-columns: 104px minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .lm-card-photo { grid-row: 1 / span 2; }
    .lm-card-photo img { height: 100%; min-height: 92px; aspect-ratio: auto; border-bottom: 0; border-right: 2px solid var(--lm-ink); }
    .lm-card-tape { display: none; }
    .lm-card-title { padding: 10px 12px 4px; font-size: 1rem; }
    .lm-card-date { padding: 0 12px 10px; }
    .lm-cat-list { gap: 10px; }
    .lm-drawer-link { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 8px; }
    .lm-drawer-link img { height: 84px; aspect-ratio: auto; }
    .lm-drawer-title { font-size: 1rem; }
    .lm-drawer-excerpt, .lm-drawer-pull { display: none; }
    .lm-cabinet { grid-template-columns: minmax(0, 1fr); }
    .lm-foot { padding: 24px 16px 96px; }
}

/* 移动端：分类导航只在 /menu 出现，隐藏规则放在全局规则之后 */
@media (max-width: 767px) {
    .lm-nav { display: none; }
}
