/* stamp-album · 邮票册 —— 每篇文章是一枚齿孔邮票：分类决定边框色，文章 ID 是面值 */
:root {
    --ps-album: #e6ecef;
    --ps-stamp: #ffffff;
    --ps-ink: #1d2a2e;
    --ps-soft: #4a585e;
    --ps-rule: #c8d2d7;
    --ps-postmark: #3d4a5c;
    --ps-hole: var(--ps-album);
    --ps-display: Alata, "Segoe UI", system-ui, sans-serif;
    --ps-body: Asap, system-ui, -apple-system, "Segoe UI", sans-serif;
    --pagination-accent: #234e8c;
}

.ps-frame-0 { --ps-frame: #6b2d5c; }
.ps-frame-1 { --ps-frame: #1f6b4f; }
.ps-frame-2 { --ps-frame: #234e8c; }
.ps-frame-3 { --ps-frame: #b8321f; }
.ps-frame-4 { --ps-frame: #8a5a0b; }

body.theme-stamp {
    margin: 0; color: var(--ps-ink); font-family: var(--ps-body); font-size: 17px; line-height: 1.5;
    background-color: var(--ps-album);
    background-image: linear-gradient(rgba(29, 42, 46, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(29, 42, 46, .045) 1px, transparent 1px);
    background-size: 24px 24px;
}
:where(.theme-stamp) a { color: inherit; text-decoration: none; }
.theme-stamp :focus-visible { outline: 3px solid #234e8c; outline-offset: 3px; }
.ps-skip { position: absolute; left: -9999px; }
.ps-skip:focus { left: 12px; top: 12px; z-index: 50; padding: 10px 14px; background: #fff; font-weight: 600; }
.ps-page { display: block; min-height: 60vh; padding-bottom: 40px; }
.ps-page:focus { outline: none; }
.ps-leaf { max-width: 1320px; margin: 0 auto; padding: 24px 24px 0; }

/* ---------- 母题：齿孔（边缘一圈与底色同色的半圆缺口） ---------- */
.ps-perf { display: block; padding: 8px; background: radial-gradient(circle at 6px 6px, var(--ps-hole) 3.6px, var(--ps-stamp) 4.2px) -6px -6px / 12px 12px; filter: drop-shadow(0 2px 2px rgba(29, 42, 46, .14)); }
.ps-perf-lg { padding: 12px; }
.ps-face { position: relative; display: block; border: 5px solid var(--ps-frame, #234e8c); background: var(--ps-stamp); }
.ps-face img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--ps-rule); }
.ps-value { position: absolute; right: 0; bottom: 0; padding: 3px 9px; background: var(--ps-frame); color: #fff; font-family: var(--ps-display); font-size: 1rem; line-height: 1.2; white-space: nowrap; }
.ps-card-cat { justify-self: start; min-width: 0; max-width: 100%; box-sizing: border-box; color: var(--ps-frame); font-family: var(--ps-display); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-postmark { display: block; width: 120px; height: 46px; background: repeating-radial-gradient(ellipse at 0 50%, transparent 0 9px, var(--ps-postmark) 9px 11px) 0 0 / 30px 46px repeat-x; opacity: .55; }
.ps-postmark-sm { width: 90px; height: 30px; background-size: 22px 30px; }

/* ---------- 顶栏：白色票纸，底边齿孔 ---------- */
.ps-head { position: relative; background: var(--ps-stamp); padding-bottom: 6px; background-image: radial-gradient(circle at 6px 6px, var(--ps-album) 3.6px, transparent 4.2px); background-size: 12px 12px; background-position: -6px 100%; background-repeat: repeat-x; }
.ps-head-inner { display: flex; align-items: center; gap: 24px; max-width: 1320px; margin: 0 auto; padding: 12px 24px 8px; }
.ps-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; margin-right: auto; }
.ps-brand-stamp { flex: none; display: block; width: 34px; height: 40px; box-sizing: border-box; padding: 4px; background: radial-gradient(circle at 3px 3px, #fff 1.8px, #b8321f 2.2px) -3px -3px / 6px 6px; }
.ps-brand-stamp span { display: block; height: 100%; box-sizing: border-box; border: 2px solid #fff; background: linear-gradient(160deg, #b8321f 55%, #234e8c 55%); }
.ps-brand-name { min-width: 0; font-family: var(--ps-display); font-size: 1.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-nav { display: flex; gap: 4px; }
.ps-nav a { padding: 6px 12px; font-weight: 600; color: var(--ps-soft); border-bottom: 3px solid transparent; }
.ps-nav a:hover { color: var(--ps-ink); }
.ps-nav a.is-on { color: var(--ps-ink); border-bottom-color: #b8321f; }
.ps-menu-toggle { display: none; }

.ps-crumb { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; font-size: .92rem; color: var(--ps-soft); }
.ps-crumb a { color: #234e8c; font-weight: 600; }
.ps-title { margin: 4px 0 20px; font-family: var(--ps-display); font-weight: 400; font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
.ps-empty { margin: 32px 0; padding: 24px; background: #fff; text-align: center; list-style: none; }
.ps-pager { margin-top: 32px; }
.ps-strip { margin: 40px 0 16px; font-family: var(--ps-display); font-weight: 400; font-size: 1.2rem; }
.ps-strip span { display: inline-block; padding: 4px 16px; background: rgba(255, 255, 255, .75); border: 1px solid var(--ps-rule); border-radius: 2px; }

/* ---------- 邮票卡片 ---------- */
.ps-sheet { display: grid; gap: 28px 24px; }
.ps-sheet-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ps-sheet-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ps-card { min-width: 0; }
.ps-card-link { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 8px; }
.ps-card-link .ps-card-cat { margin-top: 4px; }
.ps-card-title { font-weight: 600; font-size: 1.1rem; line-height: 1.32; }
.ps-card-link:hover .ps-card-title { text-decoration: underline; text-decoration-color: var(--ps-frame); }
.ps-card-date { font-size: .84rem; color: var(--ps-soft); }

/* ---------- 首页头条：纪念邮票 + 贴片说明 ---------- */
.ps-commem-link { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 30px; align-items: start; }
.ps-commem .ps-face { border-width: 8px; }
.ps-commem .ps-face img { aspect-ratio: 16 / 9; }
.ps-commem .ps-value { padding: 6px 14px; font-size: 1.5rem; }
.ps-commem-mount { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 20px 22px 24px; background: rgba(255, 255, 255, .85); border: 1px solid var(--ps-rule); }
.ps-hinge { font-size: .84rem; color: var(--ps-soft); }
.ps-commem-title { font-family: var(--ps-display); font-weight: 400; font-size: clamp(1.7rem, 2.6vw, 2.4rem); line-height: 1.16; }
.ps-commem-link:hover .ps-commem-title { text-decoration: underline; text-decoration-color: var(--ps-frame); }
.ps-commem-excerpt { color: var(--ps-soft); line-height: 1.6; }

/* ---------- 分类页：插票册，每枚邮票插在透明护条里 ---------- */
.ps-cat-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; max-width: 1040px; margin: 0; padding: 0; list-style: none; }
.ps-pocket { min-width: 0; padding: 10px 14px; background: #26343a; }
.ps-pocket-link { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: center; padding: 10px 14px; background: linear-gradient(rgba(255, 255, 255, .9), rgba(255, 255, 255, .82)); border-top: 4px solid rgba(255, 255, 255, .6); }
.ps-perf-sm { padding: 6px; }
.ps-perf-sm .ps-face { border-width: 4px; }
.ps-perf-sm .ps-face img { aspect-ratio: 16 / 10; }
.ps-pocket-text { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.ps-pocket-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: .86rem; color: var(--ps-soft); }
.ps-pocket-meta > * { min-width: 0; }
.ps-value-inline { padding: 1px 8px; background: var(--ps-frame); color: #fff; font-family: var(--ps-display); white-space: nowrap; }
.ps-pocket-title { font-weight: 600; font-size: 1.24rem; line-height: 1.28; }
.ps-pocket-link:hover .ps-pocket-title { text-decoration: underline; text-decoration-color: var(--ps-frame); }
.ps-pocket-excerpt { color: var(--ps-soft); line-height: 1.55; }
.ps-cat-list > .ps-ad { list-style: none; }
.ps-cat-list > .ps-ad:not(:has(.ad)) { display: none; }

/* ---------- 分类索引：一页邮票 ---------- */
.ps-albumpage { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 28px 24px; margin: 0; padding: 0; list-style: none; }
.ps-albumpage > li { min-width: 0; }
.ps-series { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ps-face-type { display: grid; grid-template-columns: minmax(0, 1fr); align-content: space-between; gap: 10px; min-height: 150px; box-sizing: border-box; padding: 14px; background: color-mix(in srgb, var(--ps-frame) 10%, #fff); }
.ps-series-name { font-family: var(--ps-display); font-size: 1.25rem; line-height: 1.2; color: var(--ps-frame); overflow-wrap: anywhere; }
.ps-series:hover .ps-series-name { text-decoration: underline; }
.ps-series-no { justify-self: end; font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ps-soft); white-space: nowrap; }
.ps-series-desc { font-size: .88rem; line-height: 1.45; color: var(--ps-soft); }

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

/* ---------- 页脚：信封地址栏 ---------- */
.ps-foot { margin-top: 40px; padding: 30px 24px 96px; }
.ps-envelope { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px 40px; max-width: 1100px; margin: 0 auto; padding: 26px 30px; background: #fff; border: 1px solid var(--ps-rule); border-top: 6px double var(--ps-postmark); }
.ps-envelope-from { display: grid; align-content: start; gap: 6px; min-width: 0; }
.ps-envelope-kicker, .ps-address-to { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ps-soft); }
.ps-envelope-from strong { font-family: var(--ps-display); font-weight: 400; font-size: 1.4rem; overflow-wrap: anywhere; }
.ps-address { display: grid; gap: 4px; font-style: normal; }
.ps-address a { padding: 4px 0; border-bottom: 1px solid var(--ps-rule); font-weight: 600; }
.ps-address a:hover { color: #b8321f; }
.ps-foot-note { max-width: 1100px; margin: 16px auto 0; font-size: .88rem; color: var(--ps-soft); }

/* ---------- 共享页面 ---------- */
.theme-stamp .site-menu, .theme-stamp .site-search, .theme-stamp .static-page, .theme-stamp .theme-error { --menu-accent: #234e8c; background: #fff; border: 1px solid var(--ps-rule); }

/* ---------- 断点 ---------- */
@media (min-width: 1600px) {
    .ps-leaf, .ps-head-inner { max-width: 1540px; }
    .ps-sheet-4 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
    .ps-commem-link { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .ps-commem .ps-face img { aspect-ratio: 24 / 9; }
    .ps-sheet-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ps-pocket-link { grid-template-columns: 160px minmax(0, 1fr); }
    .ps-envelope { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px) {
    .ps-head-inner { min-height: 52px; padding: 2px 12px 4px; gap: 10px; }
    .ps-brand-stamp { width: 28px; height: 34px; }
    .ps-brand-name { font-size: 1.2rem; }
    .ps-menu-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--ps-rule); box-sizing: border-box; }
    .ps-leaf { padding: 12px 12px 0; }
    .ps-perf-lg { padding: 8px; }
    .ps-commem .ps-face { border-width: 5px; }
    .ps-commem .ps-face img { aspect-ratio: 16 / 9; }
    .ps-commem .ps-value { padding: 3px 9px; font-size: 1rem; }
    .ps-commem-mount { gap: 8px; padding: 12px 14px 14px; }
    .ps-hinge, .ps-commem-excerpt { display: none; }
    .ps-commem-title { font-size: 1.35rem; }
    .ps-strip { margin-top: 26px; }
    .ps-sheet { gap: 12px; }
    .ps-sheet-3, .ps-sheet-4 { grid-template-columns: minmax(0, 1fr); }
    .ps-card-link { grid-template-columns: 108px minmax(0, 1fr); grid-template-rows: auto auto 1fr; gap: 4px 12px; padding: 8px; background: rgba(255, 255, 255, .8); }
    .ps-card-link .ps-perf { grid-row: 1 / span 3; align-self: start; padding: 5px; }
    .ps-card-link .ps-face { border-width: 3px; }
    .ps-card-link .ps-value { font-size: .75rem; padding: 1px 5px; }
    .ps-card-link .ps-card-cat { margin-top: 0; font-size: .72rem; }
    .ps-card-title { font-size: 1rem; }
    .ps-card-date { font-size: .78rem; }
    .ps-pocket { padding: 6px 8px; }
    .ps-pocket-link { grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 6px 8px; }
    .ps-perf-sm { padding: 4px; }
    .ps-perf-sm .ps-face { border-width: 3px; }
    .ps-perf-sm .ps-face img { aspect-ratio: auto; height: 72px; }
    .ps-pocket-title { font-size: 1rem; }
    .ps-pocket-excerpt { display: none; }
    .ps-albumpage { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
    .ps-face-type { min-height: 120px; padding: 10px; }
    .ps-series-name { font-size: 1.05rem; }
    .ps-envelope { padding: 18px 16px; }
    .ps-foot { padding: 24px 12px 96px; }
}

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