/* tape-measure · 卷尺刻度 —— 每张卡片顶边一条黄色钢卷尺，黑色刻度 + 分类色尺钩；分类页卷尺竖贴在每行左侧 */
:root {
    --tm-bench: #eceef1;
    --tm-card: #ffffff;
    --tm-ink: #16181d;
    --tm-soft: #4b5160;
    --tm-line: #d2d6dd;
    --tm-tape: #f6c90e;
    --tm-display: "Sofia Sans Condensed", "Arial Narrow", system-ui, sans-serif;
    --tm-body: "Sofia Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --tm-ticks: linear-gradient(90deg, var(--tm-ink) 0 2px, transparent 2px) 0 0 / 40px 60% repeat-x,
                linear-gradient(90deg, var(--tm-ink) 0 1px, transparent 1px) 0 0 / 8px 32% repeat-x;
    --tm-ticks-v: linear-gradient(180deg, var(--tm-ink) 0 2px, transparent 2px) 0 0 / 60% 40px repeat-y,
                  linear-gradient(180deg, var(--tm-ink) 0 1px, transparent 1px) 0 0 / 32% 8px repeat-y;
    --pagination-accent: #16181d;
}

.tm-h0 { --tm-h: #c62020; }
.tm-h1 { --tm-h: #1f4fbf; }
.tm-h2 { --tm-h: #1e7445; }
.tm-h3 { --tm-h: #4b5563; }
.tm-h4 { --tm-h: #6d3fc0; }

body.theme-tape { margin: 0; color: var(--tm-ink); font-family: var(--tm-body); font-size: 17px; line-height: 1.55; background: var(--tm-bench); }
:where(.theme-tape) a { color: inherit; text-decoration: none; }
.theme-tape :focus-visible { outline: 3px solid var(--tm-ink); outline-offset: 3px; }
.tm-skip { position: absolute; left: -9999px; }
.tm-skip:focus { left: 12px; top: 12px; z-index: 50; padding: 10px 14px; background: var(--tm-tape); font-weight: 600; }
.tm-bench { display: block; min-height: 60vh; padding-bottom: 40px; }
.tm-bench:focus { outline: none; }

/* ---------- 母题：卷尺与尺钩 ---------- */
.tm-strip { display: flex; justify-content: flex-start; height: 18px; background: var(--tm-ticks), var(--tm-tape); }
.tm-hook { flex: none; display: block; width: 12px; height: 100%; background: var(--tm-h, #c62020); }
.tm-card-cat { display: inline-block; max-width: 100%; min-width: 0; box-sizing: border-box; font-family: var(--tm-display); font-weight: 700; font-size: .9rem; letter-spacing: .06em; text-transform: uppercase; color: var(--tm-h, #c62020); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
.tm-card-time { font-size: .86rem; color: var(--tm-soft); white-space: nowrap; }
.tm-rule { display: flex; align-items: center; gap: 14px; margin: 40px 0 16px; font-family: var(--tm-display); font-weight: 700; font-size: 1.5rem; text-transform: uppercase; letter-spacing: .03em; }
.tm-rule::after { content: ""; flex: 1; height: 14px; background: var(--tm-ticks), var(--tm-tape); }

/* ---------- 顶栏 ---------- */
.tm-header { background: var(--tm-ink); color: #fff; }
.tm-header-bar { display: flex; align-items: center; gap: 24px; max-width: 1320px; margin: 0 auto; padding: 12px 24px; }
.tm-badge { display: inline-flex; align-items: center; gap: 12px; min-width: 0; margin-right: auto; }
.tm-badge-case { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--tm-tape); }
.tm-badge-case span { width: 12px; height: 12px; border-radius: 50%; background: var(--tm-ink); }
.tm-badge-name { min-width: 0; font-family: var(--tm-display); font-weight: 700; font-size: 1.7rem; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-links { display: flex; gap: 4px; }
.tm-links a { padding: 6px 12px; font-weight: 600; color: #d9dce2; }
.tm-links a:hover { color: #fff; }
.tm-links a.is-set { background: var(--tm-tape); color: var(--tm-ink); }
.tm-menu-toggle { display: none; color: #fff; }
.tm-header-tape { height: 12px; background: var(--tm-ticks), var(--tm-tape); }

/* ---------- 版心 ---------- */
.tm-span { max-width: 1320px; margin: 0 auto; padding: 24px 24px 0; }
.tm-span-cat { max-width: 1120px; }
.tm-path { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 8px; font-size: .92rem; color: var(--tm-soft); }
.tm-path a { color: var(--tm-ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--tm-tape); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.tm-path-tick { flex: none; width: 2px; height: 14px; background: var(--tm-ink); }
.tm-page-h { margin: 4px 0 24px; font-family: var(--tm-display); font-weight: 700; font-size: clamp(2rem, 3.6vw, 2.8rem); line-height: 1.05; text-transform: uppercase; }
.tm-nothing { margin: 32px 0; padding: 24px; background: #fff; text-align: center; }
.tm-paging { margin-top: 32px; }

/* ---------- 卡片 ---------- */
.tm-cards { display: grid; gap: 24px; }
.tm-cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 24px; }
.tm-cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tm-card { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto 1fr auto; gap: 8px; min-width: 0; padding-bottom: 16px; background: var(--tm-card); box-shadow: 0 2px 0 var(--tm-line); }
.tm-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: var(--tm-line); }
.tm-card > .tm-card-cat, .tm-card-title, .tm-card > .tm-card-time { margin: 0 16px; }
.tm-card > .tm-card-cat { margin-top: 6px; justify-self: start; max-width: calc(100% - 32px); }
.tm-card-title { font-family: var(--tm-display); font-weight: 600; font-size: 1.35rem; line-height: 1.15; }
.tm-card:hover .tm-card-title { text-decoration: underline; text-decoration-color: var(--tm-tape); text-decoration-thickness: 3px; }

/* ---------- 首页头条：拉出的整条卷尺 ---------- */
.tm-lead { display: grid; grid-template-columns: minmax(0, 1fr); background: var(--tm-card); box-shadow: 0 3px 0 var(--tm-line); }
.tm-lead-tape { display: flex; height: 26px; background: var(--tm-ticks), var(--tm-tape); }
.tm-lead-tape .tm-hook { width: 18px; }
.tm-lead-inner { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.tm-lead-inner img { display: block; width: 100%; height: 100%; min-height: 320px; object-fit: cover; background: var(--tm-line); }
.tm-lead-words { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 14px; padding: 24px 28px; }
.tm-lead-kicker { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin: 0; font-size: .9rem; color: var(--tm-soft); }
.tm-lead-kicker > * { min-width: 0; }
.tm-lead-title { margin: 0; font-family: var(--tm-display); font-weight: 700; font-size: clamp(2rem, 3vw, 2.9rem); line-height: 1.02; }
.tm-lead-inner:hover .tm-lead-title { text-decoration: underline; text-decoration-color: var(--tm-tape); text-decoration-thickness: 4px; }
.tm-lead-text { margin: 0; color: var(--tm-soft); line-height: 1.6; }

/* ---------- 分类页：竖贴卷尺的两列行 ---------- */
.tm-cat-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.tm-row { min-width: 0; }
.tm-row-wide { grid-column: 1 / -1; }
.tm-row-link { display: grid; grid-template-columns: 18px 150px minmax(0, 1fr); gap: 14px; height: 100%; box-sizing: border-box; padding: 0 14px 0 0; background: var(--tm-card); box-shadow: 0 2px 0 var(--tm-line); }
.tm-row-wide .tm-row-link { grid-template-columns: 24px minmax(0, 1.2fr) minmax(0, 1fr); }
.tm-row-tape { background: var(--tm-ticks-v), var(--tm-tape); border-top: 10px solid var(--tm-h); }
.tm-row-link img { display: block; align-self: center; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; margin: 12px 0; background: var(--tm-line); }
.tm-row-body { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 6px; padding: 12px 0; }
.tm-row-title { font-family: var(--tm-display); font-weight: 600; font-size: 1.3rem; line-height: 1.15; }
.tm-row-wide .tm-row-title { font-size: 1.9rem; }
.tm-row-link:hover .tm-row-title { text-decoration: underline; text-decoration-color: var(--tm-tape); text-decoration-thickness: 3px; }
.tm-row-sum { display: none; color: var(--tm-soft); line-height: 1.55; }
.tm-row-wide .tm-row-sum { display: block; }
.tm-cat-list > .tm-ad:not(:has(.ad)) { display: none; }

/* ---------- 分类索引：裁好的卷尺段 ---------- */
.tm-lengths { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.tm-length { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 8px; min-width: 0; padding-bottom: 18px; background: var(--tm-card); box-shadow: 0 2px 0 var(--tm-line); }
.tm-length-tape { display: flex; height: 22px; background: var(--tm-ticks), var(--tm-tape); }
.tm-length-name { margin: 8px 16px 0; font-family: var(--tm-display); font-weight: 700; font-size: 1.45rem; line-height: 1.1; text-transform: uppercase; }
.tm-length:hover .tm-length-name { text-decoration: underline; text-decoration-color: var(--tm-h); text-decoration-thickness: 3px; }
.tm-length-desc { margin: 0 16px; font-size: .92rem; line-height: 1.45; color: var(--tm-soft); }

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

/* ---------- 页脚：一条长卷尺 ---------- */
.tm-footer { margin-top: 48px; background: var(--tm-ink); color: #d9dce2; }
.tm-footer-tape { padding: 28px max(24px, calc((100% - 1320px) / 2)) 12px; background: linear-gradient(90deg, var(--tm-ink) 0 2px, transparent 2px) 0 0 / 40px 18px repeat-x, linear-gradient(90deg, var(--tm-ink) 0 1px, transparent 1px) 0 0 / 8px 10px repeat-x, var(--tm-tape); }
.tm-footer-marks { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 0; padding: 0; list-style: none; }
.tm-footer-marks li { display: flex; align-items: center; gap: 8px; }
.tm-major { flex: none; width: 3px; height: 22px; background: var(--tm-ink); }
.tm-footer-marks a { color: var(--tm-ink); font-family: var(--tm-display); font-weight: 700; font-size: 1.1rem; text-transform: uppercase; white-space: nowrap; }
.tm-footer-marks a:hover { text-decoration: underline; }
.tm-footer-base { display: grid; gap: 4px; max-width: 1320px; margin: 0 auto; padding: 22px 24px 96px; font-size: .9rem; }
.tm-footer-name { font-family: var(--tm-display); font-weight: 700; font-size: 1.4rem; text-transform: uppercase; color: #fff; overflow-wrap: anywhere; }

/* ---------- 共享页面 ---------- */
.theme-tape .site-menu, .theme-tape .site-search, .theme-tape .static-page, .theme-tape .theme-error { --menu-accent: #16181d; background: #fff; }

/* ---------- 断点 ---------- */
@media (min-width: 1600px) {
    .tm-span, .tm-header-bar, .tm-footer-base { max-width: 1540px; }
    .tm-span-cat { max-width: 1200px; }
    .tm-footer-tape { padding-left: max(24px, calc((100% - 1540px) / 2)); padding-right: max(24px, calc((100% - 1540px) / 2)); }
}

@media (max-width: 1023px) {
    .tm-lead-inner { grid-template-columns: minmax(0, 1fr); }
    .tm-lead-inner img { min-height: 0; height: auto; aspect-ratio: 24 / 9; }
    .tm-cards-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tm-row-link { grid-template-columns: 16px 110px minmax(0, 1fr); }
}

@media (max-width: 767px) {
    .tm-header-bar { min-height: 48px; padding: 2px 12px; gap: 10px; }
    .tm-header-tape { height: 10px; }
    .tm-badge { gap: 10px; }
    .tm-badge-case { width: 24px; height: 24px; }
    .tm-badge-name { font-size: 1.3rem; }
    .tm-menu-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; background: rgba(255, 255, 255, .12); }
    .tm-span { padding: 12px 12px 0; }
    .tm-lead-tape { height: 14px; }
    .tm-lead-inner img { aspect-ratio: 16 / 9; }
    .tm-lead-words { gap: 8px; padding: 12px 14px 14px; }
    .tm-lead-title { font-size: 1.6rem; }
    .tm-lead-text { display: none; }
    .tm-cards { gap: 12px; }
    .tm-cards-3, .tm-cards-4 { grid-template-columns: minmax(0, 1fr); margin-top: 12px; }
    .tm-card { grid-template-columns: 100px minmax(0, 1fr); grid-template-rows: auto auto 1fr auto; gap: 4px 12px; padding: 0 10px 10px 0; }
    .tm-card .tm-strip { grid-column: 1 / -1; height: 10px; }
    .tm-card img { grid-row: 2 / span 3; height: 100%; min-height: 84px; aspect-ratio: auto; }
    .tm-card > .tm-card-cat, .tm-card-title, .tm-card > .tm-card-time { grid-column: 2; margin: 0; }
    .tm-card > .tm-card-cat { margin-top: 6px; max-width: 100%; font-size: .78rem; }
    .tm-card-title { font-size: 1.1rem; }
    .tm-rule { margin-top: 26px; font-size: 1.25rem; }
    .tm-cat-list { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .tm-row-link, .tm-row-wide .tm-row-link { grid-template-columns: 12px 88px minmax(0, 1fr); gap: 10px; padding-right: 10px; }
    .tm-row-tape { border-top-width: 6px; }
    .tm-row-link img { height: 80px; aspect-ratio: auto; margin: 10px 0; }
    .tm-row-body { gap: 4px; padding: 10px 0; }
    .tm-row-title, .tm-row-wide .tm-row-title { font-size: 1.1rem; }
    .tm-row-wide .tm-row-sum { display: none; }
    .tm-lengths { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .tm-length-name { margin: 6px 10px 0; font-size: 1.1rem; }
    .tm-length-desc { margin: 0 10px; font-size: .84rem; }
    .tm-footer-tape { padding: 22px 16px 8px; }
    .tm-footer-base { padding: 20px 16px 96px; }
}

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