/* ==========================================================================
   pr.css — 党内法规原文库（目录页 + 阅读器）
   依赖 th.css 的 --th-* 设计令牌；仅追加 .pr-* 专用类，不改动主题既有类。
   ========================================================================== */

/* ---------- 目录页 ---------- */
.pr-hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(720px 260px at 88% -10%, rgba(231, 211, 164, .22) 0%, rgba(231, 211, 164, 0) 64%),
    linear-gradient(118deg, var(--th-red-dark) 0%, var(--th-red-deep) 48%, var(--th-red) 100%);
  color: #FFF7E6;
}
.pr-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, .045) 0 2px, transparent 2px 9px);
}
.pr-hero-in { position: relative; z-index: 1; max-width: 1220px; margin: 0 auto; padding: 46px 24px 40px; }
.pr-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; letter-spacing: 2px; color: var(--th-gold-lt);
  border: 1px solid rgba(201, 169, 97, .42); border-radius: 999px; padding: 5px 14px;
  background: rgba(255, 255, 255, .06);
}
.pr-hero h1 {
  margin: 16px 0 10px; font-size: 34px; line-height: 1.28; letter-spacing: 2px;
  font-weight: 800; color: #FFFDF7;
}
.pr-hero-lead { margin: 0; max-width: 780px; font-size: 14.5px; line-height: 1.95; color: rgba(255, 247, 230, .86); }
.pr-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.pr-stat {
  min-width: 128px; padding: 12px 18px; border-radius: 12px;
  background: rgba(255, 255, 255, .09); border: 1px solid rgba(231, 211, 164, .28);
}
.pr-stat b { display: block; font-size: 22px; font-weight: 800; color: var(--th-gold-lt); line-height: 1.3; }
.pr-stat span { font-size: 12px; color: rgba(255, 247, 230, .74); letter-spacing: .5px; }

.pr-wrap { max-width: 1220px; margin: 0 auto; padding: 26px 24px 60px; }

.pr-note {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 0 0 22px; padding: 14px 18px; border-radius: 12px;
  background: var(--th-gold-pale); border: 1px solid rgba(201, 169, 97, .4);
  border-left: 3px solid var(--th-gold-deep);
  font-size: 13px; line-height: 1.85; color: var(--th-ink2);
}
.pr-note b { color: var(--th-red-deep); }
.pr-note-ico { flex: none; font-size: 17px; line-height: 1.5; }

.pr-tools { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 20px; }
.pr-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 10px; background: #F6EDE2; }
.pr-seg button {
  border: 0; cursor: pointer; font: inherit; font-size: 13px;
  padding: 6px 13px; border-radius: 7px; background: transparent; color: var(--th-ink2);
  transition: background .16s, color .16s;
}
.pr-seg button:hover { background: rgba(255, 255, 255, .72); color: var(--th-red-deep); }
.pr-seg button.on { background: #fff; color: var(--th-red-deep); font-weight: 700; box-shadow: 0 1px 4px rgba(139, 15, 22, .14); }
.pr-seg-lb { font-size: 12.5px; color: var(--th-ink3); margin-right: 2px; }
.pr-search { position: relative; margin-left: auto; }
.pr-search input {
  width: 240px; padding: 9px 34px 9px 13px; font: inherit; font-size: 13px;
  border: 1px solid #E3D3C2; border-radius: 9px; background: #fff; color: var(--th-ink);
  transition: border-color .16s, box-shadow .16s;
}
.pr-search input:focus { outline: none; border-color: var(--th-gold-deep); box-shadow: 0 0 0 3px rgba(201, 169, 97, .18); }
.pr-search::after { content: '🔍'; position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font-size: 12px; opacity: .55; }

.pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.pr-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px 20px; border-radius: 14px; background: #fff;
  border: 1px solid #EFE2D6; border-top: 3px solid var(--th-red);
  text-decoration: none; color: inherit;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.pr-card:hover {
  transform: translateY(-2px); border-color: rgba(201, 169, 97, .62);
  box-shadow: 0 12px 26px rgba(139, 15, 22, .12);
}
.pr-card-hd { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
.pr-card-t { font-size: 15.5px; font-weight: 700; line-height: 1.55; color: var(--th-ink); letter-spacing: .3px; }
.pr-card:hover .pr-card-t { color: var(--th-red-deep); }
.pr-tag {
  flex: none; font-size: 11.5px; padding: 2px 8px; border-radius: 5px;
  background: var(--th-gold-pale); color: var(--th-gold-deep);
  border: 1px solid rgba(201, 169, 97, .45); white-space: nowrap;
}
.pr-tag.is-djz { background: #FBEAEA; color: var(--th-red-deep); border-color: rgba(193, 18, 31, .3); }
.pr-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--th-ink3); }
.pr-card-meta b { color: var(--th-red-deep); font-weight: 700; }
.pr-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 2px; padding-top: 10px; border-top: 1px dashed #F0E2D6;
  font-size: 12px; color: var(--th-ink3);
}
.pr-go { color: var(--th-red-deep); font-weight: 700; }
.pr-empty { padding: 42px 0; text-align: center; color: var(--th-ink3); font-size: 14px; }

.pr-foot-note {
  margin-top: 34px; padding: 18px 20px; border-radius: 12px;
  background: #FDF9F2; border: 1px solid #EFE2D6;
  font-size: 12.5px; line-height: 1.9; color: var(--th-ink3);
}
.pr-foot-note b { color: var(--th-ink2); }

/* ---------- 阅读器 ---------- */
.pr-rd-bar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 254, 251, .96); backdrop-filter: blur(8px);
  border-bottom: 1px solid #EFE2D6;
}
.pr-rd-bar-in {
  max-width: 1280px; margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; gap: 14px;
}
.pr-rd-back {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  font-size: 13px; color: var(--th-red-deep); font-weight: 700;
  padding: 6px 12px; border-radius: 8px; background: var(--th-gold-pale);
  border: 1px solid rgba(201, 169, 97, .45);
}
.pr-rd-back:hover { background: #F6E9CE; }
.pr-rd-name {
  font-size: 14.5px; font-weight: 700; color: var(--th-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pr-rd-act { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pr-fs { display: inline-flex; align-items: center; gap: 2px; border: 1px solid #E3D3C2; border-radius: 8px; overflow: hidden; }
.pr-fs button {
  border: 0; background: #fff; cursor: pointer; font: inherit; font-size: 12.5px;
  padding: 6px 10px; color: var(--th-ink2);
}
.pr-fs button:hover { background: var(--th-gold-pale); color: var(--th-red-deep); }
.pr-fs span { font-size: 11.5px; color: var(--th-ink3); padding: 0 4px; }

.pr-rd { max-width: 1280px; margin: 0 auto; padding: 22px 24px 70px; display: grid; grid-template-columns: 288px minmax(0, 1fr); gap: 30px; align-items: start; }

.pr-side { position: sticky; top: 62px; max-height: calc(100vh - 80px); overflow: auto; padding-right: 4px; }
.pr-side::-webkit-scrollbar { width: 5px; }
.pr-side::-webkit-scrollbar-thumb { background: #E3D3C2; border-radius: 3px; }
.pr-meta {
  padding: 16px 18px; border-radius: 13px; background: #fff;
  border: 1px solid #EFE2D6; border-top: 3px solid var(--th-red); margin-bottom: 14px;
}
.pr-meta-t { font-size: 15px; font-weight: 800; line-height: 1.55; color: var(--th-ink); margin-bottom: 8px; }
.pr-meta-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; line-height: 2; color: var(--th-ink3); }
.pr-meta-row b { color: var(--th-ink2); font-weight: 600; }
.pr-outline-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px 8px; font-size: 12px; letter-spacing: 1.5px; color: var(--th-ink3);
}
.pr-outline { list-style: none; margin: 0; padding: 0; }
.pr-outline a {
  display: block; padding: 7px 12px; border-radius: 8px;
  font-size: 13px; line-height: 1.5; color: var(--th-ink2); text-decoration: none;
  border-left: 2px solid transparent; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pr-outline a:hover { background: var(--th-gold-pale); color: var(--th-red-deep); }
.pr-outline a.on { background: #FBEAEA; color: var(--th-red-deep); border-left-color: var(--th-red); font-weight: 700; }

.pr-body {
  background: #fff; border: 1px solid #EFE2D6; border-radius: 16px;
  padding: 34px 46px 46px; box-shadow: 0 8px 30px rgba(139, 15, 22, .05);
  font-size: 16px; line-height: 2.0; color: var(--th-ink);
}
.pr-doc-hd { padding-bottom: 20px; margin-bottom: 8px; border-bottom: 2px solid var(--th-gold-pale); }
.pr-doc-hd h1 { margin: 0 0 10px; font-size: 26px; line-height: 1.4; letter-spacing: 1px; color: var(--th-red-deep); }
.pr-doc-sub { font-size: 13px; color: var(--th-ink3); line-height: 1.9; }
.pr-doc-sub em { font-style: normal; color: var(--th-ink2); }
.pr-h {
  margin: 30px 0 12px; padding: 10px 0 8px; text-align: center;
  font-size: 17px; font-weight: 800; letter-spacing: 2px; color: var(--th-red-deep);
  border-top: 1px solid #F3E6D9; border-bottom: 1px solid #F3E6D9;
  background: linear-gradient(180deg, #FFFDF8, #FFF9EF);
}
.pr-h:first-of-type { margin-top: 18px; }
.pr-p { margin: 0 0 14px; text-indent: 2em; text-align: justify; }
.pr-art { position: relative; margin: 0 0 15px; padding-left: 0; text-align: justify; }
.pr-art-n { font-weight: 800; color: var(--th-red-deep); margin-right: 4px; }
.pr-art-t { white-space: pre-wrap; }
.pr-art:target { background: #FFF8E8; box-shadow: 0 -4px 0 #FFF8E8, 0 4px 0 #FFF8E8; border-radius: 4px; }
.pr-art .pr-copy {
  position: absolute; right: -34px; top: 4px; opacity: 0; cursor: pointer;
  border: 1px solid #E3D3C2; background: #fff; border-radius: 6px;
  width: 26px; height: 26px; font-size: 12px; line-height: 1; color: var(--th-ink3);
  transition: opacity .16s;
}
.pr-art:hover .pr-copy { opacity: 1; }
.pr-art .pr-copy:hover { border-color: var(--th-gold-deep); color: var(--th-red-deep); }

.pr-src {
  margin-top: 34px; padding-top: 16px; border-top: 1px dashed #EFE2D6;
  font-size: 12.5px; line-height: 1.95; color: var(--th-ink3);
}
.pr-src a { color: var(--th-red-deep); text-decoration: none; border-bottom: 1px dashed rgba(139, 15, 22, .4); }
.pr-src a:hover { border-bottom-style: solid; }
.pr-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.pr-pager a {
  flex: 1; padding: 11px 16px; border-radius: 10px; text-decoration: none;
  background: #fff; border: 1px solid #EFE2D6; font-size: 13px; color: var(--th-ink2);
  transition: border-color .16s, color .16s;
}
.pr-pager a:hover { border-color: var(--th-gold-deep); color: var(--th-red-deep); }
.pr-pager a span { display: block; font-size: 11.5px; color: var(--th-ink3); margin-bottom: 3px; }
.pr-pager a.next { text-align: right; }
.pr-loading { padding: 60px 0; text-align: center; color: var(--th-ink3); font-size: 14px; }

/* 字号档位（挂在 .pr-body 上） */
.pr-body.fs-s { font-size: 15px; }
.pr-body.fs-l { font-size: 17.5px; }
.pr-body.fs-xl { font-size: 19px; }

@media (max-width: 1080px) {
  .pr-rd { grid-template-columns: 1fr; gap: 18px; }
  .pr-side { position: static; max-height: none; order: 2; }
  .pr-body { padding: 26px 22px 34px; }
  .pr-outline { display: flex; flex-wrap: wrap; gap: 4px; }
  .pr-outline a { border-left: 0; border: 1px solid #EFE2D6; }
  .pr-art .pr-copy { display: none; }
}
@media (max-width: 720px) {
  .pr-hero-in { padding: 32px 18px 30px; }
  .pr-hero h1 { font-size: 25px; }
  .pr-wrap { padding: 20px 16px 46px; }
  .pr-grid { grid-template-columns: 1fr; }
  .pr-search { margin-left: 0; width: 100%; }
  .pr-search input { width: 100%; }
  .pr-rd { padding: 16px 12px 50px; }
  .pr-body { padding: 22px 16px 30px; font-size: 15.5px; line-height: 1.95; }
  .pr-doc-hd h1 { font-size: 21px; }
  .pr-rd-bar-in { padding: 8px 12px; gap: 8px; }
  .pr-rd-name { display: none; }
  .pr-pager { flex-direction: column; }
  .pr-pager a.next { text-align: left; }
}
@media print {
  .pr-rd-bar, .pr-side, .pr-pager, .pr-art .pr-copy, .pr-tools { display: none !important; }
  .pr-rd { display: block; padding: 0; }
  .pr-body { border: 0; box-shadow: none; padding: 0; }
}
