/* road-signs · 路牌 —— 分类是带白色内框与方向箭头的指路牌，日期是黄色出口标签，贯穿全站 */
:root {
    --rs-verge: #eceee9;
    --rs-panel: #ffffff;
    --rs-ink: #15202b;
    --rs-soft: #4b5661;
    --rs-rule: #d3d8d2;
    --rs-gantry: #7d8791;
    --rs-exit: #f5c518;
    --rs-link: #1d4f91;
    --rs-display: "Encode Sans Expanded", "Segoe UI", system-ui, sans-serif;
    --rs-body: "Fira Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --pagination-accent: #1d4f91;
}

/* 牌面颜色：按分类 slug 取模（蓝 = 高速、绿 = 干线、棕 = 景点） */
.rs-sign-0 { --rs-sign: #1d4f91; }
.rs-sign-1 { --rs-sign: #0e6b47; }
.rs-sign-2 { --rs-sign: #6b3e1f; }

body.theme-roadsign { margin: 0; color: var(--rs-ink); font-family: var(--rs-body); font-size: 16px; background: var(--rs-verge); }
:where(.theme-roadsign) a { color: inherit; text-decoration: none; }
.theme-roadsign :focus-visible { outline: 3px solid #1d4f91; outline-offset: 3px; }
.rs-skip { position: absolute; left: -9999px; }
.rs-skip:focus { left: 12px; top: 12px; z-index: 50; padding: 10px 14px; background: var(--rs-panel); font-weight: 700; }
.rs-road:focus { outline: none; }

/* ---------- 指路牌：底色 + 白色内框 ---------- */
.rs-plate { background: var(--rs-sign, #1d4f91); color: #fff; border-radius: 10px; box-shadow: inset 0 0 0 4px var(--rs-sign, #1d4f91), inset 0 0 0 6px #fff; }
.rs-exit { display: inline-block; width: fit-content; max-width: 100%; box-sizing: border-box; padding: 3px 10px; background: var(--rs-exit); color: #15202b; border-radius: 6px 6px 0 0;
    font-family: var(--rs-display); font-weight: 600; font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-exit-inline { border-radius: 6px; }
.rs-arrow { flex: none; }

/* ---------- 顶栏：路面 + 车道线 ---------- */
.rs-head { background: #2b333b; color: #fff; }
.rs-head-inner { display: flex; align-items: center; gap: 24px; max-width: 1320px; margin: 0 auto; padding: 12px 24px; }
.rs-brand { display: inline-flex; align-items: center; gap: 12px; margin-right: auto; min-width: 0; }
.rs-brand-shield { flex: none; width: 30px; height: 34px; background: #1d4f91; border: 3px solid #fff; box-sizing: border-box; clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%); }
.rs-brand-name { min-width: 0; font-family: var(--rs-display); font-weight: 800; font-size: 1.4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-nav { display: flex; gap: 6px; }
.rs-nav a { padding: 8px 12px; font-weight: 500; border-radius: 6px; }
.rs-nav a:hover { background: rgba(255, 255, 255, .12); }
.rs-nav a.is-on { background: var(--rs-exit); color: #15202b; font-weight: 700; }
.rs-menu-toggle { display: none; color: inherit; }
.rs-head-lines { height: 6px; background: repeating-linear-gradient(90deg, #f5c518 0 40px, #2b333b 40px 64px); }

/* ---------- 版心 ---------- */
.rs-road { min-height: 60vh; padding-bottom: 40px; }
.rs-lane { max-width: 1320px; margin: 0 auto; padding: 24px 24px 0; }
.rs-crumb { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; font-size: .9rem; color: var(--rs-soft); }
.rs-crumb a { color: var(--rs-link); font-weight: 700; }
.rs-empty { margin: 32px 0; padding: 24px; background: var(--rs-panel); border-radius: 10px; text-align: center; list-style: none; }
.rs-pager { margin-top: 32px; }
.rs-page-title { margin: 8px 0 20px; font-family: var(--rs-display); font-weight: 800; font-size: clamp(1.8rem, 3.4vw, 2.5rem); }

.rs-stretch { margin-top: 36px; }
.rs-stretch-head { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; font-family: var(--rs-display); font-weight: 800; font-size: 1.2rem; }
.rs-stretch-head::after { content: ""; flex: 1; height: 4px; background: repeating-linear-gradient(90deg, var(--rs-ink) 0 24px, transparent 24px 40px); }

/* ---------- 卡片：牌子在上、出口标签挂在牌子上 ---------- */
.rs-cards { display: grid; gap: 24px; }
.rs-cards-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rs-cards-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rs-card { min-width: 0; }
.rs-card-link { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; height: 100%; box-sizing: border-box; padding: 0 0 4px; background: var(--rs-panel); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(21, 32, 43, .15); }
.rs-card-link:hover { box-shadow: 0 0 0 3px var(--rs-sign); }
.rs-card-plate { display: grid; grid-template-columns: minmax(0, 1fr); padding: 12px 12px 0; }
.rs-card-route { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 10px 14px; border-top-left-radius: 0; }
.rs-plate-name { min-width: 0; font-family: var(--rs-display); font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-card-link img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; margin-top: 12px; background: var(--rs-rule); }
.rs-card-title { padding: 12px 16px 14px; font-weight: 700; font-size: 1.12rem; line-height: 1.3; }
.rs-card-link:hover .rs-card-title { text-decoration: underline; }

/* ---------- 首页头条：龙门架大牌 ---------- */
.rs-gantry { position: relative; padding-top: 18px; }
.rs-gantry-beam { position: absolute; left: 0; right: 0; top: 0; height: 12px; background: repeating-linear-gradient(135deg, var(--rs-gantry) 0 10px, #9aa3ab 10px 20px); border-radius: 3px; }
.rs-gantry-sign { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; padding: 22px; }
.rs-gantry-text { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 14px; padding: 8px 4px 8px 10px; }
.rs-gantry-route { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rs-gantry-cat { min-width: 0; font-family: var(--rs-display); font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-gantry-title { font-family: var(--rs-display); font-weight: 800; font-size: clamp(1.6rem, 2.4vw, 2.3rem); line-height: 1.15; }
.rs-gantry-sign:hover .rs-gantry-title { text-decoration: underline; }
.rs-gantry-excerpt { line-height: 1.6; color: #eef3f9; }
.rs-gantry-sign img { display: block; width: 100%; height: 100%; min-height: 300px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--rs-rule); }

/* ---------- 分类页：路边一排立柱指示 ---------- */
.rs-cat-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 1000px; margin: 0; padding: 0; list-style: none; }
.rs-post { min-width: 0; }
.rs-post-link { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; align-items: start; padding: 12px 12px 12px 22px; background: var(--rs-panel); border-radius: 10px;
    background-image: linear-gradient(90deg, var(--rs-sign) 0 10px, transparent 10px); }
.rs-post-link:hover { box-shadow: 0 0 0 3px var(--rs-sign); }
.rs-post-link img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; background: var(--rs-rule); }
.rs-post-text { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.rs-post-text .rs-exit { border-radius: 6px; }
.rs-post-title { font-family: var(--rs-display); font-weight: 600; font-size: 1.2rem; line-height: 1.3; }
.rs-post-link:hover .rs-post-title { text-decoration: underline; }
.rs-post-excerpt { color: var(--rs-soft); line-height: 1.55; }
.rs-cat-list > .rs-ad { list-style: none; }
.rs-cat-list > .rs-ad:not(:has(.ad)) { display: none; }

/* ---------- 分类索引：路线盾牌 ---------- */
.rs-shields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 20px; margin: 0; padding: 0; list-style: none; }
.rs-shield-item { min-width: 0; }
.rs-shield-item a { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; align-items: start; height: 100%; box-sizing: border-box; padding: 16px; background: var(--rs-panel); border-radius: 10px; }
.rs-shield-item a:hover { box-shadow: 0 0 0 3px var(--rs-sign); }
.rs-shield { display: grid; place-items: center; width: 64px; height: 70px; padding-bottom: 10px; box-sizing: border-box; background: var(--rs-sign); color: #fff;
    clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%); font-family: var(--rs-display); font-weight: 800; font-size: 1.2rem; }
.rs-shield-text { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.rs-shield-name { font-family: var(--rs-display); font-weight: 800; font-size: 1.1rem; }
.rs-shield-desc { color: var(--rs-soft); font-size: .93rem; line-height: 1.5; }

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

/* ---------- 页脚：绿色目的地牌 ---------- */
.rs-foot { margin-top: 32px; padding: 32px 24px 96px; background: #2b333b; color: #dfe4e8; }
.rs-foot-inner { display: grid; gap: 18px; max-width: 1320px; margin: 0 auto; }
.rs-foot-sign { display: grid; gap: 14px; padding: 22px 26px; background: #0e6b47; color: #fff; border-radius: 12px; box-shadow: inset 0 0 0 4px #0e6b47, inset 0 0 0 6px #fff; }
.rs-foot-title { margin: 0; font-family: var(--rs-display); font-weight: 800; font-size: 1.3rem; }
.rs-foot-dest { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 24px; }
.rs-foot-dest a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 2px solid rgba(255, 255, 255, .35); font-weight: 700; }
.rs-foot-dest a:hover { border-bottom-color: #fff; }
.rs-foot-dest svg { flex: none; }
.rs-foot-note { margin: 0; font-size: .9rem; }

/* 文字容器显式写列宽、牌名允许收缩：超长标题或分类名不撑宽隐式列 */
.rs-card-route > *, .rs-gantry-route > *, .rs-post-text > * { min-width: 0; }

/* ---------- 共享页面：白色面板 ---------- */
.theme-roadsign .site-menu, .theme-roadsign .site-search, .theme-roadsign .static-page, .theme-roadsign .theme-error { --menu-accent: #1d4f91; background: var(--rs-panel); border-radius: 10px; }

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

@media (max-width: 1023px) {
    .rs-gantry-sign { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .rs-gantry-sign img { min-height: 0; aspect-ratio: 24 / 9; }
    .rs-cards-four { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .rs-shields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rs-post-link { grid-template-columns: 170px minmax(0, 1fr); }
}

@media (max-width: 767px) {
    .rs-head-inner { min-height: 52px; padding: 2px 12px; gap: 10px; }
    .rs-head-lines { height: 4px; }
    .rs-brand-shield { width: 24px; height: 28px; }
    .rs-brand-name { font-size: 1.1rem; }
    .rs-menu-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: rgba(255, 255, 255, .12); }
    .rs-lane { padding: 12px 12px 0; }
    .rs-gantry { padding-top: 12px; }
    .rs-gantry-beam { height: 8px; }
    .rs-gantry-sign { padding: 14px; gap: 10px; }
    .rs-gantry-text { gap: 8px; padding: 4px; }
    .rs-gantry-title { font-size: 1.35rem; }
    .rs-gantry-excerpt { display: none; }
    .rs-gantry-sign img { aspect-ratio: 16 / 9; }
    .rs-stretch { margin-top: 26px; }
    .rs-cards { gap: 12px; }
    .rs-cards-three, .rs-cards-four { grid-template-columns: minmax(0, 1fr); }
    .rs-card-link { grid-template-columns: 104px minmax(0, 1fr); grid-template-rows: auto 1fr; padding: 0; }
    .rs-card-plate { grid-column: 1 / -1; padding: 8px 8px 0; }
    .rs-card-route { padding: 6px 10px; }
    .rs-card-link img { grid-column: 1; height: 92px; aspect-ratio: auto; margin: 8px 0 8px 8px; width: calc(100% - 8px); border-radius: 6px; }
    .rs-card-title { grid-column: 2; padding: 8px 12px 10px; font-size: 1rem; }
    .rs-cat-list { gap: 10px; }
    .rs-post-link { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 8px 8px 8px 16px; background-image: linear-gradient(90deg, var(--rs-sign) 0 6px, transparent 6px); }
    .rs-post-link img { height: 84px; aspect-ratio: auto; }
    .rs-post-title { font-size: 1rem; }
    .rs-post-excerpt { display: none; }
    .rs-shields { grid-template-columns: minmax(0, 1fr); }
    .rs-foot { padding: 24px 16px 96px; }
    .rs-foot-sign { padding: 18px; }
}

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