/* 浮墨邮局 · 窄高票
   最后加载：stamp-design.css → fusion-layout.css → stamp-palette.css → 本文件。
   所有选择器限定 .philatelic；不写 :root，不碰 .postal-dialog 与首屏。
   选择器刻意写长，用来盖过前几份的 [data-type] 与 [data-columns] 规则，不用 !important。

   结构：
   li > button.post-card
     > span.post-latest（仅最新）
     > span.post-paper[data-type] > span.post-frame > .post-brand + .post-type + .post-date(.post-day + .post-time)
     > span.post-caption > .post-title + .post-scope + .post-proof */

.philatelic {
  --stamp-w: 9rem;              /* 桌面票宽 144px，票下题签同宽 */
  --stamp-gap: 20px;            /* 票间距；旧版为 18px */
  --stamp-bleed: 10px;          /* 墨条左右露边，必须等于票距的一半，相邻墨条才接得上 */
  --stamp-sill: 9px;            /* 墨条上下露边 */
  --stamp-strip: #d9cfb8;       /* 与首屏同一墨色 */
  --print-reset: #19172a;       /* 帽蓝墨，只印字与线 */
  --print-scheduled: #6a4428;   /* 墨褐 */
  --print-unknown: #57515f;     /* 灰墨 */
  --post-display: "Unbounded", "Helvetica Neue", Arial, "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

/* 全站只说一次：票面日期为公告发布日 */
.philatelic .post-date-note { margin: 0 0 20px; color: var(--post-ink-soft); font-size: .8125rem; }

/* ---------- 排列：固定票宽，最多6列，不拉伸 ---------- */
.philatelic .post-month .post-grid,
.philatelic .post-month .post-grid[data-columns] {
  box-sizing: border-box;
  grid-template-columns: repeat(auto-fill, minmax(0, var(--stamp-w)));
  justify-content: start;
  gap: 34px var(--stamp-gap);
  max-width: calc(6 * var(--stamp-w) + 5 * var(--stamp-gap) + 2 * var(--stamp-bleed));
  padding: var(--stamp-sill) var(--stamp-bleed) 0;
}

/* ---------- 外层按钮：透明，不再是纸套 ---------- */
.philatelic .post-grid .post-card {
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: start;
  padding: 0;
  border: 0; border-radius: 0;
  background: none; box-shadow: none;
}
/* 墨条：每枚票身后一段，相邻自动接成一条；有几枚就多长，没有空托盘 */
.philatelic .post-grid .post-card::before {
  content: "";
  z-index: -1;
  grid-area: 1 / 1;
  margin: calc(-1 * var(--stamp-sill)) calc(-1 * var(--stamp-bleed) - .5px);
  background: var(--stamp-strip);
}
.philatelic .post-grid .post-card > .post-paper { grid-area: 1 / 1; }
.philatelic .post-grid .post-card > .post-caption { grid-area: 2 / 1; }

/* 焦点：墨底上看浅圈，浅底上看墨圈 */
.philatelic .post-grid .post-card:focus-visible {
  z-index: 1;
  outline: 3px solid #fffaf0; outline-offset: 2px;
  box-shadow: 0 0 0 8px var(--stamp-strip);
}

.philatelic .post-grid .post-card .post-latest {
  top: -18px; inset-inline: 8px auto;
  padding: 0 8px;
  font-size: .75rem; line-height: 1.5;
}

/* ---------- 票纸：8:11 ---------- */
.philatelic .post-grid .post-card .post-paper {
  --post-perf-r: 3px;
  --post-perf-s: 10px;
  --print: var(--print-unknown);
  container-type: inline-size;
  display: flex;
  width: 100%;
  aspect-ratio: 8 / 11;         /* 内容放不下时允许增高 */
  padding: 12px 12px 9px;
  background: #fffaf0;
  color: var(--print);
}
.philatelic .post-grid .post-card .post-paper[data-type="reset"] { --print: var(--print-reset); }
.philatelic .post-grid .post-card .post-paper[data-type="scheduled"] { --print: var(--print-scheduled); }

/* 框线只围品牌、日期、时刻；类型落在框下，即旧票模型名的位置 */
.philatelic .post-grid .post-card .post-paper .post-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  padding: 0;
  border: 0;
}
.philatelic .post-grid .post-card .post-paper .post-frame::before {
  content: "";
  grid-area: 1 / 1 / 3 / 2;
  border: 2px dotted var(--print);
}
.philatelic .post-grid .post-card .post-paper[data-type="reset"] .post-frame::before { border-style: solid; }
.philatelic .post-grid .post-card .post-paper[data-type="scheduled"] .post-frame::before { border-style: dashed; }

.philatelic .post-grid .post-card .post-paper .post-frame > .post-brand {
  grid-area: 1 / 1;
  padding: 8px 2px 0;
  font: 700 7.1cqi/1 var(--post-display);
  letter-spacing: .08em;
  text-align: center; white-space: nowrap;
}
.philatelic .post-grid .post-card .post-paper .post-frame > .post-date {
  grid-area: 2 / 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
  padding: 4px 2px 9px;
  text-align: center;
}
.philatelic .post-grid .post-card .post-paper .post-frame .post-day {
  display: block;
  align-self: center;
  min-height: 0;
  border: 0;
  background: none; box-shadow: none;
  color: var(--print);
  font: 900 46.6cqi/1 var(--post-display);    /* 144px票上约56px，与旧票50/128同比 */
  letter-spacing: -.03em;
}
.philatelic .post-grid .post-card .post-paper .post-frame .post-time {
  color: var(--post-ink);
  font: 700 12cqi/1 var(--post-display);
}
.philatelic .post-grid .post-card .post-paper .post-frame > .post-type {
  grid-area: 3 / 1;
  align-items: baseline; justify-content: center;
  gap: 4px;
  padding-top: 7px;
  color: var(--print);
  font-size: .75rem; font-weight: 700; line-height: 1.25;
}
.philatelic .post-grid .post-card .post-paper .post-type::before { width: 7px; height: 7px; border-width: 1.5px; }

/* ---------- 票下题签：无框，全文，不截断 ---------- */
.philatelic .post-grid .post-card .post-caption {
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0;
  padding-top: calc(var(--stamp-sill) + 10px);
  text-align: start;
}
.philatelic .post-grid .post-card .post-caption .post-title {
  display: block;
  -webkit-line-clamp: none; line-clamp: none;
  overflow: visible;
  font-size: .875rem; font-weight: 700; line-height: 1.4;
}
.philatelic .post-grid .post-card .post-caption .post-scope {
  padding: 0; border: 0;
  font-size: .8125rem; line-height: 1.4;
}
.philatelic .post-grid .post-card .post-caption .post-proof {
  margin-top: 2px;
  padding-top: 0; border-top: 0;
  color: var(--post-ink-soft);
  font-size: .75rem; line-height: 1.5;
}
.philatelic .post-grid .post-card .post-caption .post-mark { transform: scale(.8); transform-origin: 0 50%; }

/* ---------- 手机：两列；极窄或大字号：单列 ---------- */
@container post-month (max-width: 33rem) {
  .philatelic .post-month .post-grid,
  .philatelic .post-month .post-grid[data-columns] {
    grid-template-columns: repeat(2, minmax(0, 10rem));
    row-gap: 30px;
  }
}
@container post-month (max-width: 17rem) {
  .philatelic .post-month .post-grid,
  .philatelic .post-month .post-grid[data-columns] { grid-template-columns: minmax(0, 9rem); }
}

/* ---------- 悬停：沿用旧版轻轻挑起 ---------- */
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .philatelic .post-grid .post-card:hover .post-paper { transform: translateY(-3px) rotate(-1deg); }
}

@media (forced-colors: active) {
  .philatelic .post-grid .post-card::before { display: none; }
  .philatelic .post-grid .post-card .post-paper { border: 1px solid CanvasText; }
  .philatelic .post-grid .post-card:focus-visible { outline-color: Highlight; box-shadow: none; }
}

/* 整页配色修订：奶油纸、深墨印刷、浮墨橙最新票。
   橙色仅标示最新收录，不表达核验等级或到账状态。 */
.philatelic .post-grid .post-card::before {
  margin: -5px;
  background: #e9dfc8;
  box-shadow: inset 0 0 0 1px #d5c8ab;
}
.philatelic .post-grid .post-card .post-paper { background: #fff8e8; }
.philatelic .post-grid .post-card:has(.post-latest) .post-paper[data-type="reset"] { --print: #a83b1c; }
.philatelic .post-grid .post-card .post-latest { background: #fb7838; color: #19172a; }
.philatelic .post-grid .post-card:focus-visible { outline-color: #19172a; box-shadow: 0 0 0 7px #fb7838; }
