/* cargo-containers · 集装箱堆场 —— 分类是箱体颜色，每篇文章是一只带波纹钢板与箱号（文章 ID）的集装箱 */
:root {
    --cg-quay: #e3e8ec;
    --cg-panel: #ffffff;
    --cg-steel: #5c6b78;
    --cg-ink: #17212b;
    --cg-soft: #4a5563;
    --cg-rule: #c9d1d9;
    --cg-hazard: #f5c400;
    --cg-display: Teko, "Arial Narrow", system-ui, sans-serif;
    --cg-body: Heebo, system-ui, -apple-system, "Segoe UI", sans-serif;
    --pagination-accent: #12507a;
}

.cg-box-0 { --cg-box: #b3261e; }
.cg-box-1 { --cg-box: #12507a; }
.cg-box-2 { --cg-box: #2f6f3e; }
.cg-box-3 { --cg-box: #b4530f; }
.cg-box-4 { --cg-box: #4b5563; }

body.theme-cargo { margin: 0; color: var(--cg-ink); font-family: var(--cg-body); font-size: 16px; line-height: 1.5; background: var(--cg-quay); }
:where(.theme-cargo) a { color: inherit; text-decoration: none; }
.theme-cargo :focus-visible { outline: 3px solid #12507a; outline-offset: 3px; }
.cg-skip { position: absolute; left: -9999px; }
.cg-skip:focus { left: 12px; top: 12px; z-index: 50; padding: 10px 14px; background: #fff; font-weight: 700; }
.cg-yard { display: block; min-height: 60vh; padding-bottom: 40px; }
.cg-yard:focus { outline: none; }
.cg-berth { max-width: 1320px; margin: 0 auto; padding: 24px 24px 0; }

/* ---------- 母题：波纹钢板 + 箱号 ---------- */
.cg-ribs { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; padding: 0 14px; background-color: var(--cg-box, #4b5563); background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .16) 0 3px, transparent 3px 10px, rgba(0, 0, 0, .16) 10px 13px, transparent 13px 18px); color: #fff; }
.cg-ribs-tall { min-height: 46px; }
.cg-code, .cg-size { font-family: var(--cg-display); font-weight: 600; font-size: 1.2rem; line-height: 1; letter-spacing: .06em; white-space: nowrap; padding: 3px 6px 0; background: rgba(0, 0, 0, .28); }
.cg-cargo { min-width: 0; max-width: 100%; padding: 1px 8px; border: 2px solid var(--cg-box); color: var(--cg-ink); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-box-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: .84rem; color: var(--cg-soft); }
.cg-box-meta > * { min-width: 0; }

/* ---------- 顶栏：钢灰龙门架 + 警示条 ---------- */
.cg-head { background: var(--cg-ink); color: #fff; border-bottom: 6px solid transparent; border-image: repeating-linear-gradient(-45deg, var(--cg-hazard) 0 12px, var(--cg-ink) 12px 24px) 6; }
.cg-head-inner { display: flex; align-items: center; gap: 24px; max-width: 1320px; margin: 0 auto; padding: 12px 24px; }
.cg-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; margin-right: auto; }
.cg-brand-box { flex: none; width: 44px; height: 26px; background-color: #b3261e; background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .25) 0 2px, transparent 2px 6px); border: 2px solid #fff; box-sizing: border-box; }
.cg-brand-name { min-width: 0; font-family: var(--cg-display); font-weight: 600; font-size: 1.9rem; line-height: 1; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 4px; }
.cg-nav { display: flex; gap: 4px; }
.cg-nav a { padding: 6px 12px; font-weight: 500; color: #d7dee5; border-bottom: 3px solid transparent; }
.cg-nav a:hover { color: #fff; }
.cg-nav a.is-on { color: #fff; border-bottom-color: var(--cg-hazard); }
.cg-menu-toggle { display: none; color: #fff; }

.cg-crumb { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; font-size: .9rem; color: var(--cg-soft); }
.cg-crumb a { color: #12507a; font-weight: 700; }
.cg-title { margin: 4px 0 20px; font-family: var(--cg-display); font-weight: 600; font-size: clamp(2.2rem, 4vw, 3rem); line-height: 1; }
.cg-empty { margin: 32px 0; padding: 24px; background: #fff; border-left: 8px solid var(--cg-steel); text-align: center; list-style: none; }
.cg-pager { margin-top: 32px; }
.cg-bay { display: flex; align-items: baseline; gap: 14px; margin: 40px 0 16px; padding-bottom: 6px; border-bottom: 3px solid var(--cg-ink); font-family: var(--cg-display); font-weight: 600; font-size: 1.9rem; line-height: 1; }
.cg-bay-no { padding: 4px 8px 0; background: var(--cg-hazard); color: var(--cg-ink); font-size: 1.1rem; white-space: nowrap; }

/* ---------- 20 尺箱卡片 ---------- */
.cg-row { display: grid; gap: 22px; }
.cg-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cg-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cg-box { min-width: 0; }
.cg-box-link { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; height: 100%; box-sizing: border-box; background: var(--cg-panel); border: 3px solid var(--cg-box); }
.cg-box-link img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: var(--cg-rule); }
.cg-box-text { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 8px; padding: 12px 14px 16px; }
.cg-box-title { font-weight: 700; font-size: 1.08rem; line-height: 1.32; }
.cg-box-link:hover .cg-box-title { text-decoration: underline; text-decoration-color: var(--cg-box); text-decoration-thickness: 2px; }

/* ---------- 首页头条：40 尺高柜 ---------- */
.cg-forty-link { display: grid; grid-template-columns: minmax(0, 1fr); background: var(--cg-panel); border: 4px solid var(--cg-box); }
.cg-forty-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.cg-forty-body img { display: block; width: 100%; height: 100%; min-height: 280px; object-fit: cover; background: var(--cg-rule); }
.cg-forty-text { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 12px; padding: 20px 26px 24px; border-left: 4px solid var(--cg-box); }
.cg-forty-title { font-family: var(--cg-display); font-weight: 600; font-size: clamp(2rem, 3.2vw, 2.9rem); line-height: 1; }
.cg-forty-link:hover .cg-forty-title { text-decoration: underline; text-decoration-color: var(--cg-box); }
.cg-forty-excerpt { color: var(--cg-soft); line-height: 1.6; }

/* ---------- 分类页：箱门端朝外的一摞集装箱 ---------- */
.cg-cat-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; max-width: 1040px; margin: 0; padding: 0; list-style: none; }
.cg-door { min-width: 0; }
.cg-door-link { display: grid; grid-template-columns: 84px 200px minmax(0, 1fr); gap: 18px; align-items: stretch; padding-right: 16px; background: var(--cg-panel); border: 3px solid var(--cg-box); }
.cg-door-end { display: grid; grid-template-columns: minmax(0, 1fr); align-content: space-between; justify-items: center; padding: 10px 4px; background: var(--cg-box); color: #fff; }
.cg-door-bars { width: 34px; height: 64px; background: linear-gradient(90deg, transparent 6px, rgba(255, 255, 255, .85) 6px 10px, transparent 10px 24px, rgba(255, 255, 255, .85) 24px 28px, transparent 28px); }
.cg-door-code { font-family: var(--cg-display); font-weight: 600; font-size: 1.05rem; line-height: 1; letter-spacing: .06em; white-space: nowrap; }
.cg-door-link img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; margin: 10px 0; background: var(--cg-rule); }
.cg-door-text { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 6px; padding: 12px 0; }
.cg-door-date { font-size: .84rem; font-weight: 500; color: var(--cg-soft); }
.cg-door-title { font-weight: 700; font-size: 1.22rem; line-height: 1.28; }
.cg-door-link:hover .cg-door-title { text-decoration: underline; text-decoration-color: var(--cg-box); }
.cg-door-excerpt { color: var(--cg-soft); line-height: 1.55; }
.cg-cat-list > .cg-ad { list-style: none; }
.cg-cat-list > .cg-ad:not(:has(.ad)) { display: none; }

/* ---------- 分类索引：堆场 ---------- */
.cg-stackyard { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 18px; margin: 0; padding: 0; list-style: none; }
.cg-stackyard > li { min-width: 0; }
.cg-slot { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; height: 100%; box-sizing: border-box; background: var(--cg-panel); border: 3px solid var(--cg-box); }
.cg-slot .cg-ribs { min-height: 56px; align-items: flex-end; padding-bottom: 8px; }
.cg-slot-placard { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 6px; padding: 12px 14px 16px; }
.cg-slot-name { font-family: var(--cg-display); font-weight: 600; font-size: 1.7rem; line-height: 1; overflow-wrap: anywhere; }
.cg-slot:hover .cg-slot-name { text-decoration: underline; text-decoration-color: var(--cg-box); }
.cg-slot-desc { font-size: .88rem; line-height: 1.45; color: var(--cg-soft); }

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

/* ---------- 页脚：港口告示牌 ---------- */
.cg-foot { margin-top: 40px; padding: 28px 24px 96px; background: var(--cg-steel); color: #fff; }
.cg-placard { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 20px 32px; align-items: center; max-width: 1320px; margin: 0 auto; padding: 18px 22px; background: #fff; color: var(--cg-ink); border: 4px solid var(--cg-ink); outline: 6px solid var(--cg-hazard); }
.cg-placard-port { display: grid; gap: 2px; min-width: 0; }
.cg-placard-kicker { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--cg-soft); }
.cg-placard-name { font-family: var(--cg-display); font-weight: 600; font-size: 1.9rem; line-height: 1; overflow-wrap: anywhere; }
.cg-placard-gates { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.cg-placard-gates a { display: inline-flex; align-items: baseline; gap: 8px; font-weight: 500; }
.cg-placard-gates a:hover { text-decoration: underline; }
.cg-placard-gates b { font-family: var(--cg-display); font-weight: 600; font-size: 1.1rem; padding: 2px 6px 0; background: var(--cg-ink); color: #fff; white-space: nowrap; }
.cg-foot-line { max-width: 1320px; margin: 22px auto 0; font-size: .88rem; color: #f1f4f7; }

/* ---------- 共享页面 ---------- */
.theme-cargo .site-menu, .theme-cargo .site-search, .theme-cargo .static-page, .theme-cargo .theme-error { --menu-accent: #12507a; background: #fff; border: 3px solid var(--cg-steel); }

/* ---------- 断点 ---------- */
@media (min-width: 1600px) {
    .cg-berth, .cg-head-inner, .cg-placard, .cg-foot-line { max-width: 1540px; }
    .cg-row-4 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
    .cg-forty-body { grid-template-columns: minmax(0, 1fr); }
    .cg-forty-body img { min-height: 0; height: auto; aspect-ratio: 24 / 9; }
    .cg-forty-text { border-left: 0; border-top: 4px solid var(--cg-box); }
    .cg-row-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cg-door-link { grid-template-columns: 72px 160px minmax(0, 1fr); }
    .cg-placard { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px) {
    .cg-head-inner { min-height: 52px; padding: 2px 12px; gap: 10px; }
    .cg-brand-box { width: 34px; height: 20px; }
    .cg-brand-name { font-size: 1.55rem; }
    .cg-menu-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 2px solid rgba(255, 255, 255, .5); box-sizing: border-box; }
    .cg-berth { padding: 12px 12px 0; }
    .cg-ribs-tall { min-height: 30px; }
    .cg-forty-link { border-width: 3px; }
    .cg-forty-body img { aspect-ratio: 16 / 9; }
    .cg-forty-text { gap: 8px; padding: 10px 12px 14px; }
    .cg-forty-title { font-size: 1.8rem; }
    .cg-forty-excerpt { display: none; }
    .cg-bay { margin-top: 26px; font-size: 1.5rem; }
    .cg-row { gap: 12px; }
    .cg-row-3, .cg-row-4 { grid-template-columns: minmax(0, 1fr); }
    .cg-box-link { grid-template-columns: 104px minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .cg-box-link .cg-ribs { grid-column: 1 / -1; min-height: 24px; }
    .cg-box-link .cg-code { font-size: 1rem; }
    .cg-box-link img { height: 100%; min-height: 84px; aspect-ratio: auto; }
    .cg-box-text { padding: 8px 12px 10px; }
    .cg-box-title { font-size: 1rem; }
    .cg-door-link { grid-template-columns: 22px 88px minmax(0, 1fr); gap: 10px; padding-right: 10px; }
    .cg-door-end { padding: 6px 0; }
    .cg-door-bars { width: 12px; height: 40px; background: linear-gradient(90deg, transparent 2px, rgba(255, 255, 255, .85) 2px 4px, transparent 4px 8px, rgba(255, 255, 255, .85) 8px 10px, transparent 10px); }
    .cg-door-code { display: none; }
    .cg-door-link img { height: 84px; aspect-ratio: auto; margin: 8px 0; }
    .cg-door-text { padding: 8px 0; }
    .cg-door-title { font-size: 1rem; }
    .cg-door-excerpt { display: none; }
    .cg-stackyard { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .cg-slot .cg-ribs { min-height: 36px; }
    .cg-slot-name { font-size: 1.35rem; }
    .cg-foot { padding: 24px 12px 96px; }
}

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