/* signal-flags · 信号旗 —— 每个分类飘一面几何信号旗：卡片角上挂旗，分类页一根升旗绳贯穿列表 */
:root {
    --fh-sea: #e8eff5;
    --fh-sail: #ffffff;
    --fh-ink: #0f1d2c;
    --fh-soft: #46566a;
    --fh-navy: #0b2545;
    --fh-red: #c8102e;
    --fh-yellow: #f6c343;
    --fh-blue: #1f4e9c;
    --fh-halyard: #8a96a3;
    --fh-display: "Exo 2", "Trebuchet MS", sans-serif;
    --fh-body: Assistant, system-ui, -apple-system, "Segoe UI", sans-serif;
    --pagination-accent: #1f4e9c;
}

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

/* ---------- 母题：五面信号旗与三角小旗 ---------- */
.fh-flag { flex: none; display: block; width: 36px; height: 26px; box-sizing: border-box; border: 1px solid var(--fh-navy); }
.fh-f0 { background: linear-gradient(135deg, var(--fh-red) 50%, var(--fh-yellow) 50%); }
.fh-f1 { background: linear-gradient(#fff, #fff) center / 42% 42% no-repeat, var(--fh-blue); }
.fh-f2 { background: linear-gradient(90deg, var(--fh-yellow) 50%, var(--fh-blue) 50%); }
.fh-f3 { background: conic-gradient(var(--fh-navy) 0 25%, #fff 0 50%, var(--fh-navy) 0 75%, #fff 0); }
.fh-f4 { background: linear-gradient(var(--fh-red), var(--fh-red)) center / 100% 28% no-repeat, linear-gradient(var(--fh-red), var(--fh-red)) center / 28% 100% no-repeat, #fff; }
.fh-flag-lg { width: 64px; height: 46px; border-width: 2px; }
.fh-pennant { flex: none; display: inline-block; width: 22px; height: 14px; clip-path: polygon(0 0, 100% 50%, 0 100%); background: var(--fh-red); }
.fh-card-topic { display: inline-block; max-width: 100%; min-width: 0; font-weight: 700; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--fh-blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
.fh-time { font-size: .86rem; color: var(--fh-soft); white-space: nowrap; }
.fh-section { display: flex; align-items: center; gap: 12px; margin: 44px 0 18px; font-family: var(--fh-display); font-weight: 700; font-size: 1.55rem; line-height: 1.2; }
.fh-section span:last-child { min-width: 0; }

/* ---------- 顶栏 ---------- */
.fh-header { background: var(--fh-navy); color: #fff; border-bottom: 4px solid var(--fh-yellow); }
.fh-header-in { display: flex; align-items: center; gap: 24px; max-width: 1320px; min-height: 60px; margin: 0 auto; padding: 4px 24px; }
.fh-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; margin-right: auto; }
.fh-brand-hoist { flex: none; display: grid; gap: 2px; padding-left: 6px; border-left: 2px solid #c3ccd6; }
.fh-brand-hoist .fh-flag { width: 22px; height: 15px; border-color: #fff; }
.fh-brand-name { min-width: 0; font-family: var(--fh-display); font-weight: 700; font-size: 1.55rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fh-signals { display: flex; gap: 8px; }
.fh-signals a { padding: 6px 12px; font-weight: 700; color: #d5dde7; }
.fh-signals a:hover { color: #fff; }
.fh-signals a.is-flying { color: var(--fh-navy); background: var(--fh-yellow); }
.fh-menu-toggle { display: none; }

/* ---------- 版心 ---------- */
.fh-wrap { max-width: 1320px; margin: 0 auto; padding: 24px 24px 0; }
.fh-wrap-cat { max-width: 1000px; }
.fh-route { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; font-size: .92rem; color: var(--fh-soft); }
.fh-route a { color: var(--fh-blue); font-weight: 700; }
.fh-heading { margin: 4px 0 24px; font-family: var(--fh-display); font-weight: 700; font-size: clamp(2rem, 3.6vw, 2.8rem); line-height: 1.12; }
.fh-calm { margin: 32px 0; padding: 24px; background: #fff; text-align: center; list-style: none; }
.fh-pager { margin-top: 32px; }

/* ---------- 卡片：角上挂旗 ---------- */
.fh-fleet { display: grid; gap: 28px 24px; }
.fh-fleet-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 28px; }
.fh-fleet-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fh-card { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.fh-card-link { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr auto; gap: 8px; padding: 0 0 16px; background: var(--fh-sail); border-top: 4px solid var(--fh-navy); box-shadow: 0 1px 3px rgba(11, 37, 69, .15); }
.fh-card-photo { display: grid; }
.fh-card-photo img { grid-area: 1 / 1; display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: #c9d6e2; }
.fh-card-flag { grid-area: 1 / 1; align-self: start; justify-self: start; display: grid; justify-items: start; padding: 0 0 0 14px; }
.fh-card-flag::before { content: ""; width: 2px; height: 10px; margin-left: 0; background: var(--fh-navy); }
.fh-card-flag .fh-flag { box-shadow: 0 2px 4px rgba(11, 37, 69, .3); }
.fh-card-link > .fh-card-topic { margin: 4px 16px 0; }
.fh-card-title { margin: 0 16px; font-family: var(--fh-display); font-weight: 700; font-size: 1.12rem; line-height: 1.3; }
.fh-card-link:hover .fh-card-title { text-decoration: underline; text-decoration-color: var(--fh-red); text-decoration-thickness: 2px; }
.fh-card-link > .fh-time { margin: 0 16px; }

/* ---------- 首页头条：旁边一根竖旗杆 ---------- */
.fh-lead { display: grid; grid-template-columns: 64px minmax(0, 1.4fr) minmax(0, 1fr); background: var(--fh-sail); box-shadow: 0 2px 5px rgba(11, 37, 69, .16); }
.fh-mast { display: grid; justify-items: center; align-content: start; gap: 8px; padding: 18px 0; background: linear-gradient(var(--fh-halyard), var(--fh-halyard)) center / 2px 100% no-repeat, var(--fh-navy); }
.fh-mast .fh-flag { border-color: #fff; }
.fh-lead img { display: block; width: 100%; height: 100%; min-height: 340px; object-fit: cover; background: #c9d6e2; }
.fh-lead-text { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 12px; padding: 30px 30px 26px; }
.fh-lead-title { font-family: var(--fh-display); font-weight: 700; font-size: clamp(1.8rem, 2.6vw, 2.5rem); line-height: 1.15; }
.fh-lead:hover .fh-lead-title { text-decoration: underline; text-decoration-color: var(--fh-red); }
.fh-lead-sum { color: var(--fh-soft); line-height: 1.6; }

/* ---------- 分类页：一根升旗绳贯穿列表 ---------- */
.fh-cat-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; }
.fh-signal { display: grid; grid-template-columns: 52px minmax(0, 1fr); min-width: 0; background: linear-gradient(var(--fh-halyard), var(--fh-halyard)) 25px 0 / 2px calc(100% + 14px) no-repeat; }
.fh-signal:last-child { background-size: 2px 100%; }
.fh-clip { display: grid; justify-items: center; padding-top: 16px; }
.fh-signal-link { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: center; gap: 20px; padding: 14px 14px 14px 20px; background: var(--fh-sail); box-shadow: 0 1px 3px rgba(11, 37, 69, .15); }
.fh-signal-text { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.fh-signal-title { font-family: var(--fh-display); font-weight: 700; font-size: 1.3rem; line-height: 1.25; }
.fh-signal-link:hover .fh-signal-title { text-decoration: underline; text-decoration-color: var(--fh-red); text-decoration-thickness: 2px; }
.fh-signal-sum { color: var(--fh-soft); line-height: 1.55; }
.fh-signal-link img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: #c9d6e2; }
.fh-cat-list > .fh-ad { list-style: none; }
.fh-cat-list > .fh-ad:not(:has(.ad)) { display: none; }

/* ---------- 分类索引：旗柜 ---------- */
.fh-locker { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.fh-locker li { min-width: 0; }
.fh-locker-item { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 16px; height: 100%; box-sizing: border-box; padding: 18px; background: var(--fh-sail); border-left: 4px solid var(--fh-navy); box-shadow: 0 1px 3px rgba(11, 37, 69, .15); }
.fh-locker-text { display: grid; gap: 6px; min-width: 0; }
.fh-locker-name { font-family: var(--fh-display); font-weight: 700; font-size: 1.25rem; line-height: 1.2; }
.fh-locker-item:hover .fh-locker-name { text-decoration: underline; text-decoration-color: var(--fh-red); }
.fh-locker-desc { font-size: .9rem; line-height: 1.45; color: var(--fh-soft); }

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

/* ---------- 页脚：满旗的甲板 ---------- */
.fh-footer { margin-top: 56px; background: var(--fh-navy); color: #d5dde7; }
.fh-dressline { display: flex; justify-content: center; gap: 10px; padding: 0 12px 0; background: linear-gradient(var(--fh-halyard), var(--fh-halyard)) 0 0 / 100% 2px no-repeat; overflow: hidden; }
.fh-footer .fh-dressline { padding-top: 0; background-color: var(--fh-sea); }
.fh-footer .fh-dressline .fh-flag { margin-top: 2px; margin-bottom: 14px; }
.fh-footer-in { display: grid; gap: 14px; max-width: 1320px; margin: 0 auto; padding: 22px 24px 96px; }
.fh-footer-name { margin: 0; font-family: var(--fh-display); font-weight: 700; font-size: 1.5rem; color: #fff; overflow-wrap: anywhere; }
.fh-pennants { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 0; padding: 0; list-style: none; }
.fh-pennants li { display: flex; align-items: center; gap: 8px; }
.fh-pennants li:nth-child(2) .fh-pennant { background: var(--fh-yellow); }
.fh-pennants li:nth-child(3) .fh-pennant { background: #fff; }
.fh-pennants li:nth-child(4) .fh-pennant { background: #6f9be0; }
.fh-pennants li:nth-child(5) .fh-pennant { background: var(--fh-yellow); }
.fh-pennants a { font-weight: 700; color: #fff; white-space: nowrap; }
.fh-pennants a:hover { color: var(--fh-yellow); }
.fh-footer-note { margin: 0; font-size: .9rem; overflow-wrap: anywhere; }

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

/* ---------- 断点 ---------- */
@media (min-width: 1600px) {
    .fh-wrap, .fh-header-in, .fh-footer-in { max-width: 1540px; }
    .fh-wrap-cat { max-width: 1100px; }
}

@media (max-width: 1023px) {
    .fh-signals a { padding: 6px 8px; }
    .fh-lead { grid-template-columns: 52px minmax(0, 1fr); }
    .fh-mast { grid-row: 1 / span 2; }
    .fh-lead img { min-height: 0; height: auto; aspect-ratio: 24 / 9; }
    .fh-lead-text { padding-top: 20px; }
    .fh-fleet-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .fh-signal-link { grid-template-columns: minmax(0, 1fr) 170px; }
}

@media (max-width: 767px) {
    .fh-header-in { min-height: 54px; padding: 0 12px; gap: 10px; }
    .fh-brand { gap: 10px; }
    .fh-brand-hoist .fh-flag { width: 18px; height: 12px; }
    .fh-brand-name { font-size: 1.2rem; }
    .fh-menu-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; color: #fff; }
    .fh-wrap { padding: 12px 12px 0; }
    .fh-lead { grid-template-columns: minmax(0, 1fr); }
    .fh-mast { display: none; }
    .fh-lead img { aspect-ratio: 16 / 9; }
    .fh-lead-text { gap: 8px; padding: 12px 14px 14px; }
    .fh-lead-title { font-size: 1.45rem; }
    .fh-lead-sum { display: none; }
    .fh-fleet { gap: 12px; }
    .fh-fleet-3, .fh-fleet-4 { grid-template-columns: minmax(0, 1fr); margin-top: 12px; }
    .fh-card-link { grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto 1fr auto; gap: 4px 12px; padding: 10px 12px 10px 10px; border-top-width: 3px; }
    .fh-card-photo { grid-row: 1 / span 3; }
    .fh-card-photo img { height: 100%; min-height: 84px; aspect-ratio: auto; }
    .fh-card-flag { padding-left: 6px; }
    .fh-card-flag::before { height: 4px; }
    .fh-card-flag .fh-flag { width: 22px; height: 16px; }
    .fh-card-link > .fh-card-topic { grid-column: 2; margin: 0; font-size: .72rem; }
    .fh-card-title { grid-column: 2; margin: 0; font-size: 1rem; }
    .fh-card-link > .fh-time { grid-column: 2; margin: 0; font-size: .8rem; }
    .fh-section { margin-top: 28px; font-size: 1.25rem; }
    .fh-signal { grid-template-columns: 32px minmax(0, 1fr); background-position: 15px 0; }
    .fh-clip .fh-flag { width: 24px; height: 17px; }
    .fh-signal-link { grid-template-columns: minmax(0, 1fr) 88px; gap: 10px; padding: 8px 8px 8px 10px; }
    .fh-signal-text { gap: 4px; }
    .fh-signal-title { font-size: 1rem; }
    .fh-signal-sum { display: none; }
    .fh-signal-link img { height: 80px; aspect-ratio: auto; }
    .fh-locker { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .fh-locker-item { padding: 12px; }
    .fh-flag-lg { width: 44px; height: 32px; }
    .fh-locker-name { font-size: 1.1rem; }
}

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