/**
 * 民国纪事系共用：顶栏 + 宣纸 hero（与 republic.html 主站一致）
 * 依赖：/css/fsmag-roc-paper.css（人物志/风物志/联大/李庄 hero 叠纤维时请加 class fsmag-roc-paper-hero--xuan-fiber）
 */
:root {
  /* 与 fsmag.co 首页：顶栏区 max 1400px，正文/纪事主栏 max 1200px（见 index .magazine-page / .magazine-section-inset） */
  --read-pad: clamp(16px, 4vw, 32px);
  --fsmag-shell-max: min(1400px, calc(100vw - 2 * var(--read-pad)));
  --read-max: min(1200px, calc(100vw - 2 * var(--read-pad)));
  --roc-family-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* —— 顶栏（全站民国系统一内容与交互）—— */
.topbar {
  background: rgba(244, 239, 231, 0.95);
  border-bottom: 1px solid rgba(105, 88, 66, 0.18);
  backdrop-filter: blur(3px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  max-width: var(--fsmag-shell-max);
  margin: 0 auto;
  padding: 0 var(--read-pad);
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.topbar .brand {
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  font-size: 14px;
  letter-spacing: 0.22em;
  font-weight: 500;
  color: #121a24;
  text-decoration: none;
  flex-shrink: 0;
}
.topbar .menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.35rem 0.75rem;
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  font-size: 14px;
  letter-spacing: 0.04em;
  font-weight: 500;
  color: #5c5248;
  text-transform: none;
}
.topbar .menu a {
  color: inherit;
  text-decoration: none;
  padding: 0.2em 0.05em;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.topbar .menu a:hover {
  color: #7e2d24;
  border-bottom-color: rgba(143, 42, 36, 0.35);
}
.topbar .menu a.active {
  color: #6e1f20;
  font-weight: 700;
  border-bottom-color: rgba(110, 31, 32, 0.45);
}

/* —— 宣纸首屏（民国纪事主站同款版心与层次）—— */
.hero.hero--republic-xuan {
  max-width: var(--fsmag-shell-max);
  margin: 1rem auto 0;
  padding: 54px 0 44px;
  min-height: 16.5rem;
  box-sizing: border-box;
  border-left: 1px solid rgba(0, 0, 0, 0.04);
  border-right: 1px solid rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.hero.hero--republic-xuan.fsmag-roc-paper-hero {
  background-color: #fefefe;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.048'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.45' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)' opacity='0.032'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 85% 65% at 12% 18%, rgba(28, 53, 94, 0.018), transparent 58%),
    radial-gradient(ellipse 50% 45% at 88% 12%, rgba(80, 70, 55, 0.014), transparent 50%),
    linear-gradient(168deg, #ffffff 0%, #fcfcfc 55%, #f7f7f7 100%);
  background-blend-mode: multiply, multiply, normal, normal, normal;
  background-size: auto, auto, auto, auto, auto;
  background-position: 0 0, 31px 47px, 0 0, 0 0, 0 0;
  background-repeat: repeat, repeat, no-repeat, no-repeat, no-repeat;
}
.hero.hero--republic-xuan.fsmag-roc-paper-hero::before {
  opacity: 0.22;
  background:
    radial-gradient(ellipse 42% 28% at 24% 40%, rgba(90, 100, 120, 0.04), transparent 68%),
    radial-gradient(ellipse 32% 26% at 76% 58%, rgba(70, 85, 105, 0.032), transparent 62%);
}
.hero.hero--republic-xuan.fsmag-roc-paper-hero::after {
  opacity: 0.3;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 31px,
    rgba(28, 53, 94, 0.009) 31px,
    rgba(28, 53, 94, 0.009) 32px
  );
}

/* 子站首屏：在纪事主站同款底上叠真实宣纸纤维（需先加载 fsmag-roc-paper.css 以定义 --fsmag-xuan-fiber-url） */
.hero.hero--republic-xuan.fsmag-roc-paper-hero.fsmag-roc-paper-hero--xuan-fiber {
  background-color: #fefefe;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.048'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.45' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)' opacity='0.032'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 85% 65% at 12% 18%, rgba(28, 53, 94, 0.018), transparent 58%),
    radial-gradient(ellipse 50% 45% at 88% 12%, rgba(80, 70, 55, 0.014), transparent 50%),
    var(--fsmag-xuan-fiber-url),
    linear-gradient(168deg, #ffffff 0%, #fcfcfc 55%, #f7f7f7 100%);
  background-blend-mode: multiply, multiply, normal, normal, multiply, normal;
  background-size: auto, auto, auto, auto, cover, auto;
  background-position: 0 0, 31px 47px, 0 0, 0 0, center, 0 0;
  background-repeat: repeat, repeat, no-repeat, no-repeat, no-repeat, no-repeat;
}

@media (min-width: 720px) {
  .hero.hero--republic-xuan {
    padding: 72px 0 56px;
    min-height: 18.5rem;
  }
}

/* 人物志/风物志：首屏与 #roc-root 白壳同宽，避免窄于下方阅读区；内边距与页内 .magazine-section-inset 一致 */
body[data-republic-subtopic] .hero.hero--republic-xuan {
  max-width: var(--fsmag-shell-max);
}
body[data-republic-subtopic] .hero.hero--republic-xuan .hero-inner {
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 768px) {
  body[data-republic-subtopic] .hero.hero--republic-xuan .hero-inner {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
@media (min-width: 1024px) {
  body[data-republic-subtopic] .hero.hero--republic-xuan .hero-inner {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* 联大/李庄：首屏与 .page 白壳同宽（与 main 阅读栏左右对齐） */
body:has(> .page) > section.hero.hero--republic-xuan {
  max-width: var(--fsmag-shell-max);
}

.hero.hero--republic-xuan .hero-inner {
  max-width: var(--read-max);
  margin: 0 auto;
  padding: 0 var(--read-pad);
}
.hero.hero--republic-xuan .hero-title {
  font-size: clamp(3.5rem, 11vw, 6rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.04;
  margin: 0;
  color: #111;
  font-family: "Noto Serif SC", "Songti SC", serif;
}
.hero.hero--republic-xuan .hero-title .accent {
  color: #8f2a24;
}
.hero.hero--republic-xuan .hero-en {
  font-size: 11px;
  letter-spacing: 0.28em;
  color: rgba(55, 62, 72, 0.72);
  margin-bottom: 16px;
  text-transform: uppercase;
}
.hero.hero--republic-xuan .hero-desc {
  font-size: clamp(1rem, 2.1vw, 1.12rem);
  max-width: 28rem;
  line-height: 1.85;
  margin-top: 18px;
  color: #333;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-weight: 500;
  white-space: pre-line;
}
.hero.hero--republic-xuan .hero-date {
  margin-top: 24px;
  font-size: 11px;
  color: #6b7280;
  letter-spacing: 0.18em;
}

/* 下属专题页：与纪事首页同款衬线层次，主题字整体略小一号 */
.hero.hero--republic-xuan.hero--republic-sub {
  padding-top: 48px;
  padding-bottom: 40px;
  min-height: 15rem;
}
@media (min-width: 720px) {
  .hero.hero--republic-xuan.hero--republic-sub {
    padding-top: 64px;
    padding-bottom: 48px;
    min-height: 17rem;
  }
}
.hero.hero--republic-xuan.hero--republic-sub .hero-title {
  font-size: clamp(3.0625rem, 9.2vw, 5.25rem);
  letter-spacing: 0.11em;
}
.hero.hero--republic-xuan.hero--republic-sub .hero-en {
  font-size: 10px;
  letter-spacing: 0.26em;
  margin-bottom: 14px;
}
.hero.hero--republic-xuan.hero--republic-sub .hero-desc {
  font-size: clamp(0.9375rem, 1.95vw, 1.02rem);
  margin-top: 14px;
}
.hero.hero--republic-xuan.hero--republic-sub .hero-date {
  font-size: 10px;
  margin-top: 20px;
  letter-spacing: 0.16em;
}
