/* ============================================================
   门户公示：列表页 /publications + 详情页 /publications/{key}
   2026-10-25 新增。沿用 portal.css 的设计令牌与 .page-hero / .pub-card 基础样式。
   注意：.pub-card 已在 portal.css 中定义（首页公示卡），此处只补充详情页需要的子元素样式。
   ============================================================ */

.pub-list-page,
.pub-detail-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 18px 0 40px;
}

/* ---------- 空态 ---------- */
.pub-empty {
    background: #fff;
    border: 1px dashed var(--border-soft, #dfe6f0);
    border-radius: 14px;
    padding: 44px 20px;
    text-align: center;
    color: var(--text-secondary, #6b7280);
    font-size: 14px;
    line-height: 1.9;
}
.pub-back { color: var(--brand-accent, #2f6fe0); }

/* ---------- 列表页：公示项目录 ---------- */
.pub-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.pub-index-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-soft, #dfe6f0);
    border-radius: 14px;
    padding: 18px 20px;
    text-decoration: none;
    transition: box-shadow .15s, transform .15s, border-color .15s;
}
.pub-index-card:hover {
    box-shadow: var(--shadow-card-hover, 0 16px 34px rgba(16, 40, 80, .16));
    transform: translateY(-2px);
    border-color: rgba(47, 111, 224, .35);
}

.pub-index-top { display: flex; align-items: center; gap: 8px; }
.pub-index-name { font-size: 16px; font-weight: 600; color: var(--brand-dark, #0e2f5e); }
.pub-index-pin {
    font-size: 10.5px; font-weight: 600; color: #a2600a;
    background: #fff4e0; border-radius: 999px; padding: 1px 7px;
}
.pub-index-desc {
    margin: 0; font-size: 13px; line-height: 1.7; color: var(--text-secondary, #6b7280);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pub-index-meta {
    margin-top: auto; display: flex; align-items: center; justify-content: space-between;
    font-size: 12.3px; color: var(--text-secondary, #6b7280);
}
.pub-index-more { color: var(--brand-accent, #2f6fe0); }

/* ---------- 详情页：面包屑 ---------- */
.pub-crumb {
    display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
    font-size: 12.8px; color: var(--text-secondary, #6b7280);
    margin-bottom: 16px;
}
.pub-crumb a { color: var(--text-secondary, #6b7280); text-decoration: none; }
.pub-crumb a:hover { color: var(--brand-accent, #2f6fe0); }
.pub-crumb-sep { color: #c0c6cf; }
.pub-crumb-current { color: var(--text-main, #1f2937); }

/* ---------- 详情页：页首 ---------- */
.pub-head {
    position: relative;
    overflow: hidden;
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    border-radius: 18px;
    padding: 26px 30px;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, .86);
    background:
        radial-gradient(120% 150% at 100% 0%, rgba(47, 111, 224, .35), transparent 55%),
        linear-gradient(135deg, #123a6e 0%, #0b1f3d 100%);
    box-shadow: 0 8px 24px rgba(15, 39, 72, .18);
}
.pub-head::after {
    content: "";
    position: absolute; right: -46px; top: -56px;
    width: 200px; height: 200px; border-radius: 50%;
    border: 26px solid rgba(255, 255, 255, .05);
    pointer-events: none;
}
.pub-head-main { position: relative; z-index: 1; }
.pub-kicker {
    display: inline-block; font-size: 12px; letter-spacing: 2px;
    color: #cfe0fb; background: rgba(47, 111, 224, .22);
    border: 1px solid rgba(47, 111, 224, .4);
    border-radius: 999px; padding: 4px 12px; margin-bottom: 10px;
}
.pub-head h1 {
    margin: 0 0 8px; font-family: var(--serif, inherit);
    font-size: 24px; color: #fff; letter-spacing: 1px; line-height: 1.35;
}
.pub-head-sub { margin: 0; font-size: 13.5px; line-height: 1.8; max-width: 720px; }
.pub-head-meta {
    display: flex; flex-wrap: wrap; gap: 8px 16px;
    margin-top: 12px; font-size: 12.5px; color: rgba(255, 255, 255, .74);
}
.pub-head-meta b { color: #fff; font-weight: 600; }
.pub-state {
    display: inline-flex; align-items: center;
    padding: 1px 10px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600;
}
.pub-state.is-expired { background: rgba(255, 255, 255, .16); color: #ffe0b0; }
.pub-state.is-preview { background: rgba(255, 255, 255, .16); color: #cfe0fb; }

.pub-head-ops { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; }
.pub-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 36px; padding: 0 16px; border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .14);
    color: #fff; font-size: 13.5px; cursor: pointer;
    transition: background .15s, border-color .15s;
}
.pub-btn:hover { background: rgba(255, 255, 255, .24); border-color: #fff; }

.pub-banner {
    background: #fff7e6;
    border: 1px solid #f0d9ab;
    color: #8a5a00;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 13px;
    margin-bottom: 14px;
}

/* ---------- 详情页：表格模板 ---------- */
.pub-table-wrap { width: 100%; overflow-x: auto; }
.pub-table {
    width: 100%; min-width: 720px;
    border-collapse: separate; border-spacing: 0;
    background: #fff; border: 1px solid var(--border-soft, #dfe6f0);
    border-radius: 14px; overflow: hidden; font-size: 13px;
}
.pub-table th {
    background: #f5f8fd; color: #44536a; font-weight: 600;
    font-size: 12.3px; text-align: left; padding: 11px 12px;
    border-bottom: 1px solid var(--border-soft, #dfe6f0); white-space: nowrap;
}
.pub-table td { padding: 12px; border-bottom: 1px solid #f2f5fa; vertical-align: top; }
.pub-table tbody tr:last-child td { border-bottom: none; }
.pub-table tbody tr:hover td { background: #fbfdff; }
.pub-cell-title { font-size: 13.5px; color: var(--text-main, #1f2937); font-weight: 500; }
.pub-cell-meta { color: var(--text-secondary, #6b7280); font-size: 12.5px; }
.pub-cell-date { color: var(--text-secondary, #6b7280); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.pub-w-60  { width: 60px; }
.pub-w-120 { width: 120px; }
.pub-w-160 { width: 160px; }
.pub-w-220 { width: 220px; }

/* ---------- 详情页：紧凑列表模板 ---------- */
.pub-rows {
    background: #fff; border: 1px solid var(--border-soft, #dfe6f0);
    border-radius: 14px; overflow: hidden;
}
.pub-row {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 14px 20px; border-bottom: 1px solid #eef2f8;
}
.pub-row:last-child { border-bottom: none; }
.pub-row:hover { background: #fbfdff; }
.pub-row-no {
    flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; color: var(--brand-primary, #16498c);
    background: rgba(22, 73, 140, .08); font-variant-numeric: tabular-nums;
}
.pub-row-body { flex: 1; min-width: 0; }
.pub-row-title { font-size: 14.5px; color: var(--text-main, #1f2937); font-weight: 500; line-height: 1.6; }
.pub-row-date {
    flex-shrink: 0; font-size: 12.5px; color: var(--text-secondary, #6b7280);
    font-variant-numeric: tabular-nums; padding-top: 2px;
}

/* ---------- 详情页：卡片模板 ---------- */
.pub-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}
.pub-detail-page .pub-card { gap: 9px; }
.pub-card-head { display: flex; align-items: center; gap: 10px; }
.pub-avatar {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 600; color: #fff;
    background: linear-gradient(135deg, var(--brand-primary, #16498c), var(--brand-accent, #2f6fe0));
}
.pub-card-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pub-card-name { font-size: 15px; font-weight: 600; color: var(--text-main, #1f2937); line-height: 1.4; }
.pub-card-date { font-size: 12px; color: var(--text-secondary, #6b7280); }
.pub-card-meta { font-size: 12.8px; color: var(--text-secondary, #6b7280); line-height: 1.7; }
.pub-card-foot { border-top: 1px dashed var(--border-soft, #dfe6f0); padding-top: 9px; }

/* ---------- 正文折叠 ---------- */
.pub-details { margin-top: 6px; }
.pub-details > summary {
    font-size: 12.5px; color: var(--brand-accent, #2f6fe0);
    cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 4px;
}
.pub-details > summary::-webkit-details-marker { display: none; }
.pub-details > summary::before { content: "▸"; transition: transform .15s; }
.pub-details[open] > summary::before { transform: rotate(90deg); }
.pub-content {
    margin-top: 8px; font-size: 13.5px; line-height: 1.9;
    color: #33415c; overflow-wrap: break-word;
}
.pub-content p { margin: .6em 0; }
.pub-content img { max-width: 100%; height: auto; border-radius: 8px; }

/* ---------- 材料 ---------- */
.pub-mats { display: flex; flex-wrap: wrap; gap: 8px; }
.pub-mat {
    display: inline-flex; align-items: center; gap: 4px;
    min-height: 30px; padding: 0 12px; border-radius: 8px;
    border: 1px solid #c9d8ee; background: #f4f8ff; color: var(--brand-primary, #16498c);
    font-size: 12.3px; text-decoration: none; cursor: pointer;
}
.pub-mat:hover { background: #e8f1fb; border-color: var(--brand-accent, #2f6fe0); }

/* ---------- 分页 ---------- */
.pub-pager {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; flex-wrap: wrap; margin-top: 18px;
}
.pub-page-btn {
    min-width: 34px; height: 34px; padding: 0 10px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-soft, #dfe6f0); background: #fff;
    color: #33415c; font-size: 13px; text-decoration: none;
}
.pub-page-btn:hover { border-color: var(--brand-accent, #2f6fe0); color: var(--brand-accent, #2f6fe0); }
.pub-page-btn.active { background: var(--brand-primary, #16498c); border-color: var(--brand-primary, #16498c); color: #fff; }
.pub-dots { color: #9aa7b8; }

.pub-tip {
    margin-top: 18px; font-size: 12.3px;
    color: var(--text-secondary, #6b7280); text-align: center; line-height: 1.8;
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
    .pub-list-page, .pub-detail-page { padding: 14px 0 32px; }
    .pub-head { padding: 20px 18px; border-radius: 14px; }
    .pub-head h1 { font-size: 20px; }
    .pub-head-ops { width: 100%; }
    .pub-head-ops .pub-btn { flex: 1 1 auto; }
    .pub-cards { grid-template-columns: 1fr; }
    .pub-index-grid { grid-template-columns: 1fr; }
    .pub-row { padding: 12px 14px; gap: 10px; }
    .pub-row-date { display: none; }
    .pub-mat { min-height: 40px; }
    .pub-btn { min-height: 42px; }
}

/* ---------- 打印 ---------- */
@media print {
    .site-header, .site-footer, .pub-head-ops, .pub-crumb,
    .pub-pager, .pub-tip, .pub-details > summary { display: none !important; }
    .pub-list-page, .pub-detail-page { max-width: none; padding: 0; }
    .pub-head {
        background: none !important; box-shadow: none; color: #000;
        padding: 0 0 10px; border-bottom: 2px solid #333; border-radius: 0;
    }
    .pub-head::after, .pub-kicker { display: none; }
    .pub-head h1 { color: #000; font-size: 19px; }
    .pub-head-sub, .pub-head-meta { color: #333; }
    .pub-head-meta b { color: #000; }
    .pub-cards { grid-template-columns: 1fr; gap: 8px; }
    .pub-card { break-inside: avoid; box-shadow: none; border-color: #ccc; }
    .pub-avatar { display: none; }
    .pub-content { display: block !important; }   /* 打印时展开正文 */
    .pub-details[open] > .pub-content, .pub-details > .pub-content { display: block; }
}

/* ---------- 公示年度切换（2026-10-25：一年公示一次，可切往期） ---------- */
.pub-years { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pub-year {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 30px; padding: 0 12px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .12);
    color: #fff; font-size: 12.5px; text-decoration: none;
    transition: background .15s, border-color .15s;
}
.pub-year:hover { background: rgba(255, 255, 255, .24); border-color: #fff; }
.pub-year.is-active { background: #fff; border-color: #fff; color: #123a6e; font-weight: 600; }

/* ---------- 公示年度标识（列表页） ---------- */
.pub-index-year {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 11.5px;
    line-height: 1.7;
}
