/* 报纸风排版：字号与间距分档，覆盖 editorial.css 的阅读层级。 */

body.layout-editorial {
  --paper-rule: color-mix(in srgb, var(--theme-text) 24%, transparent);
  --paper-rail: 380px;
  --paper-muted: color-mix(in srgb, var(--theme-text) 58%, transparent);
  --paper-serif: "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", "Source Han Serif CN", STSong, SimSun, serif;
}

/* ---------- 报头 ---------- */

body.layout-editorial .masthead {
  display: flex;
  align-items: baseline;
  gap: 24px;
}

/* 链接悬浮高亮用暖色（覆盖 editorial.css 的冷灰，贴近纸张底色） */
body.layout-editorial {
  --highlight-weak: rgba(178, 150, 96, 0.24);
}

html[data-theme='dark'] body.layout-editorial {
  --highlight-weak: rgba(214, 198, 162, 0.16);
}

body.layout-editorial .masthead-name {
  font-family: var(--paper-serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--theme-heading);
  text-decoration: none;
  white-space: nowrap;
}

body.layout-editorial .site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
  min-height: auto;
}

body.layout-editorial .site-nav :is(a:any-link, .notes-toggle) {
  font-size: 14.5px;
  letter-spacing: 0.08em;
  line-height: 1.6;
}

body.layout-editorial .masthead-rule {
  height: 7px;
  margin-top: 2px;
  border-top: 2px solid var(--theme-text);
  border-bottom: 1px solid var(--theme-text);
}

/* ---------- 标题区 ---------- */

body.layout-editorial > article.report-article {
  padding-top: 2px;
}

body.layout-editorial .report-article > section > .report-dateline {
  width: calc(100% - var(--paper-rail));
  max-width: none;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  text-align: center;
  margin: 0 0 12px;
  padding: 0;
  /* 正文段落的 2em 首行缩进会被子元素继承，日期行必须是 0 */
  text-indent: 0;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--paper-muted);
}

body.layout-editorial .report-dateline > span + span::before {
  content: none;
}

/* 分隔线作为独立的 flex 子项：用 1px 实线代替「|」字形，
   避免字体左右边距导致竖线看起来偏左或偏右 */
body.layout-editorial .report-dateline > .report-sep {
  align-self: center;
  flex: none;
  width: 1px;
  height: 0.86em;
  margin: 0 14px;
  overflow: hidden;
  color: transparent;
  background: var(--paper-muted);
  white-space: nowrap;
  opacity: 0.6;
}

body.layout-editorial .report-dateline .report-kicker {
  font-weight: 700;
  letter-spacing: 0.32em;
  /* 字距会在末字之后也留一格，抵消掉，竖线到两边的距离才一致 */
  margin-right: -0.32em;
  color: var(--theme-text);
}


/* ---------- 正文与板块 ---------- */

body.layout-editorial .report-article[data-report-id] > section > :is(p, ul, ol, dl, h3, h4, h5, h6, blockquote, pre, .table-scroll) {
  width: calc(100% - var(--paper-rail));
  max-width: none;
  box-sizing: border-box;
}

body.layout-editorial .report-article[data-report-id] > section > h3:not(.report-overview) {
  font-family: var(--paper-serif);
  font-size: 30px;
  line-height: 1.36;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 64px 0 18px;
  padding-top: 16px;
  border-top: 1px solid var(--theme-text);
}

body.layout-editorial .report-article:not([data-report-id]) > section > h3 {
  font-family: var(--paper-serif);
  font-size: 26px;
  line-height: 1.4;
  font-weight: 700;
  margin: 48px 0 14px;
}

body.layout-editorial .report-article > section > h3.report-overview {
  font-family: var(--paper-serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.28em;
  margin: 34px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--paper-rule);
}

/* 首字下沉：概览段首字放大两行，替代原来的两字缩进 */
body.layout-editorial .report-article > section > h3.report-overview + p {
  text-indent: 0;
}

body.layout-editorial .report-article > section > h3.report-overview + p::first-letter {
  float: left;
  font-family: var(--paper-serif);
  font-size: 3.45em;
  line-height: 1;
  font-weight: 400;
  color: var(--theme-heading);
  margin: 0 0.09em 0 0;
}

body.layout-editorial .report-article > section > h4 {
  font-family: var(--paper-serif);
  font-size: 22px;
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 40px 0 10px;
}

body.layout-editorial .report-article > section > :is(p) {
  font-size: 18px;
  line-height: 1.85;
  margin-block: 0 10px;
  text-indent: 2em;
}

body.layout-editorial .report-article > section > :is(ul, ol) > li {
  font-size: 18px;
  line-height: 1.85;
  text-indent: 0;
}

body.layout-editorial .report-article > section > :is(ul, ol) {
  margin-block: 0 18px;
}

/* ---------- 边注 ---------- */

/* 正文首行缩进会继承进边注，这里清零，保持编号与标题、注释同一左边界。 */
body.layout-editorial .report-article .marginnote,
body.layout-editorial .report-article .marginnote * {
  text-indent: 0;
}

/* ---------- 上/下一期 ---------- */

body.layout-editorial .report-pager {
  width: calc(100% - var(--paper-rail));
  max-width: none;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  margin: 64px 0 0;
  padding-top: 16px;
  border-top: 3px double var(--theme-text);
}

body.layout-editorial .report-pager a {
  color: inherit;
  text-decoration: none;
  font-size: 12.5px;
  letter-spacing: 0.22em;
  color: var(--paper-muted);
}

body.layout-editorial .report-pager a > span {
  display: block;
  margin-top: 8px;
  font-family: var(--paper-serif);
  font-size: 16px;
  letter-spacing: 0.01em;
  color: var(--theme-text);
}

/* 旁注开关：正文宽度做过渡，文字逐帧重排，看起来像「补位」而不是瞬移。
   width 是长度值，浏览器可以逐帧插值，重排就跟着动画走。 */
body.layout-editorial .report-article > section > :is(p, ul, ol, dl, h3, h4, h5, h6, blockquote, pre, figure, .table-scroll, .report-dateline, .report-pager) {
  transition: width 260ms cubic-bezier(0.25, 0.8, 0.35, 1);
}

@media (prefers-reduced-motion: reduce) {
  body.layout-editorial .report-article > section > :is(p, ul, ol, dl, h3, h4, h5, h6, blockquote, pre, figure, .table-scroll, .report-dateline, .report-pager) {
    transition: none;
  }
}

/* 概览没有旁注可用：打开旁注时正文让出 320px 给右栏，概览却无处安放，
   于是右侧空出一条 380px 的空白。这里让概览整块占满文章宽度。 */
body.layout-editorial .report-article[data-report-id] > section > :is(h3, p, ul, ol, dl).report-overview,
body.layout-editorial .report-article[data-report-id] > section > p.report-dateline {
  width: 100%;
  max-width: none;
}

/* 没有「历史记录」标题后，归档页与来源页也从报头下留出同样的上边距 */
body.layout-editorial > article.report-article:not([data-report-id]) {
  padding-top: 34px;
}

body.layout-editorial .masthead-name:hover,
body.layout-editorial .masthead-name:focus-visible {
  background: transparent;
}

body.layout-editorial .report-pager-empty {
  display: block;
  min-width: 1px;
}

@media (max-width: 1119px) {
  /* editorial.css 在 1119px 以下把边注收成行内注释、正文占满整行，这里同步收掉右侧留白 */
  body.layout-editorial {
    --paper-rail: 0px;
  }
}

/* 关掉旁注时正文会占满整行（editorial.css:67），日期行与页脚双线也要跟着占满 */
html[data-notes-visible='false'] body.layout-editorial {
  --paper-rail: 0px;
}

@media (max-width: 900px) {
  body.layout-editorial .masthead {
    flex-wrap: wrap;
    gap: 10px;
  }

  body.layout-editorial .site-nav {
    margin-left: 0;
  }

  body.layout-editorial .report-article > section > h3:not(.report-overview) {
    font-size: 25px;
    margin-top: 48px;
  }

  body.layout-editorial .report-article > section > h4 {
    font-size: 20px;
  }
}

@media (max-width: 600px) {
  body.layout-editorial .report-dateline {
    font-size: 12px;
    letter-spacing: 0.02em;
  }

  body.layout-editorial .report-article > section > h3.report-overview + p::first-letter {
    font-size: 2.7em;
  }
}

/* 旁注配图：挂在来源第一次引用旁，与脚注同一套浮动定位 */
body.layout-editorial .report-article .marginnote.margin-image {
  margin: 10px 0 20px;
  break-inside: avoid;
}

body.layout-editorial .report-article .margin-image img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--paper-rule);
  background: var(--theme-surface, transparent);
}

@media print {
  body.layout-editorial .report-article .marginnote.margin-image {
    break-inside: avoid;
  }
}

/* 右栏轨道：每个小节一条，绝对定位在正文栏右侧，从这一节开头起排。
   之前用 float 时，上一节脚注高过正文就会把下一节的第一条往下压，两栏对不齐。 */
body.layout-editorial .report-article > section { position: relative; }
body.layout-editorial .report-article .section-rail {
  position: absolute;
  top: 0;
  right: -380px;
  width: 264px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
body.layout-editorial .report-article .section-rail > .marginnote {
  float: none;
  clear: none;
  position: static;
  inline-size: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
html[data-notes-visible='false'] body.layout-editorial .report-article .section-rail > .marginnote { display: none; }
/* 页脚：备案信息与版权说明 */
/* 页脚：报纸刊尾（双线 + 站名 + 二维码 + 法务行） */
.site-footer {
  flex: 1 0 100%;
  width: 100%;
  max-width: none;
  margin: 56px 0 44px;
  padding: 0;
  color: var(--paper-ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

.footer-rule {
  height: 8px;
  border-top: 2px solid var(--theme-text);
  border-bottom: 1px solid var(--theme-text);
  margin-bottom: 22px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 28px;
  align-items: start;
}

.footer-name {
  margin: 0 0 6px;
  font-family: var(--paper-serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--theme-heading);
  text-indent: 0;
}

.footer-tagline {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--paper-ink-soft);
  text-indent: 0;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
  margin: 0;
}

.footer-col { text-indent: 0; }

.footer-col-title {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--paper-ink-soft);
  text-indent: 0;
}

.footer-col a {
  display: block;
  font-size: 13px;
  line-height: 1.9;
  color: var(--theme-text);
  text-decoration: none;
  padding: 1px 3px;
  margin: 0 -3px;
  border-radius: 2px;
}

.footer-col a:hover,
.footer-col a:focus-visible { color: var(--theme-heading); }

.footer-follow {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.footer-qr { display: block; width: 110px; height: 110px; }

.footer-legal {
  margin: 22px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--paper-rule);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--paper-ink-soft);
  text-align: center;
  text-indent: 0;
}

.footer-legal a {
  color: inherit;
  text-decoration: none;
  padding: 1px 3px;
  margin: 0 -3px;
  border-radius: 2px;
}

.footer-legal a:hover,
.footer-legal a:focus-visible { color: var(--theme-heading); }

@media (max-width: 900px) {
  .footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 28px;
  align-items: start;
}
  .footer-follow { align-items: flex-start; }
  .site-footer { margin-top: 40px; }
}

@media print {
  .site-footer { break-inside: avoid; }
}

/* ---------- 打印 ----------
   只打印正文：页眉、导航、左侧目录轨道、翻页、页脚、回到顶部全部不进纸面；
   右栏脚注打印时落回正文流，避免压字。 */
@page {
  size: A4;
  margin: 15mm 14mm;
}

@media print {
  body.layout-editorial .site-header,
  body.layout-editorial .site-nav,
  body.layout-editorial .site-footer,
  body.layout-editorial .report-outline-rail,
  body.layout-editorial .report-pager,
  body.layout-editorial .back-to-top,
  #page-jump-btn,
  .page-jump-btn,
  body.layout-editorial .notes-toggle,
  body.layout-editorial .theme-toggle-btn,
  body.layout-editorial .report-analytics,
  body.layout-editorial [data-analytics] {
    display: none !important;
  }

  body.layout-editorial {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    background: #fff !important;
  }

  body.layout-editorial .report-article,
  body.layout-editorial .report-article > section {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    max-width: none !important;
  }

  body.layout-editorial .report-article > section > :is(p, ul, ol, table, figure) {
    width: auto !important;
    max-width: none !important;
    margin-inline: 0 !important;
  }

  body.layout-editorial .report-article > section > h3.report-overview + p::first-letter {
    float: none !important;
    font-size: inherit !important;
    line-height: inherit !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.layout-editorial .report-article .section-rail {
    position: static !important;
    display: block !important;
    width: auto !important;
    max-width: none !important;
    margin: 6pt 0 10pt !important;
    gap: 0 !important;
  }

  body.layout-editorial .report-article .section-rail > .marginnote,
  body.layout-editorial .report-article .marginnote {
    float: none !important;
    position: static !important;
    display: block !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 0 6pt !important;
    padding: 0 !important;
    font-size: 8.5pt !important;
    line-height: 1.5 !important;
    transform: none !important;
    clear: both !important;
    break-inside: avoid;
  }

  body.layout-editorial .report-article .marginnote.margin-image img {
    max-width: 100% !important;
  }

  body.layout-editorial .report-article .marginnote {
    background: none !important;
    box-shadow: none !important;
    border: 0 !important;
  }
}
/* 移动端阅读（≤760px，390×844 实测）：修窄屏下的错版与可读性 */
@media (max-width: 760px) {
  /* 手机端中文与数字统一走系统默认字体（无衬线），不加载任何 Web 字体 */
  body.layout-editorial {
    --paper-serif: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC",
      "Source Han Sans SC", "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-family: var(--paper-serif);
  }
  body.layout-editorial .report-article,
  body.layout-editorial .masthead-name,
  body.layout-editorial .site-nav :is(a:any-link, .notes-toggle),
  body.layout-editorial .report-article > section > :is(h3, h4, h5, h6, p, li, blockquote) {
    font-family: var(--paper-serif);
  }
  /* 首字下沉在窄屏会把首字挤成单独一行、正文从第二个字开始，直接复位（print 里已有同样处理） */
  body.layout-editorial .report-article > section > h3.report-overview + p::first-letter {
    float: none !important;
    font-size: inherit !important;
    line-height: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* 正文 18→17px、行高 1.85→1.75，左右留白 24→18px，一行多放下两个字 */
  body.layout-editorial {
    padding-left: 18px;
    padding-right: 18px;
  }
  body.layout-editorial .report-article > section > :is(p) {
    font-size: 17px;
    line-height: 1.75;
    margin-block: 0 12px;
  }
  body.layout-editorial .report-article > section > :is(ul, ol) {
    font-size: 17px;
    line-height: 1.75;
  }
  body.layout-editorial .report-article > section > :is(ul, ol) > li {
    font-size: 17px;
    line-height: 1.75;
  }

  /* 标题在窄屏降一档，别把 30px 压在 17px 的正文上 */
  body.layout-editorial .report-article[data-report-id] > section > h3:not(.report-overview) {
    font-size: 24px;
    line-height: 1.45;
    margin: 40px 0 14px;
  }
  body.layout-editorial .report-article[data-report-id] > section > h4 {
    font-size: 18px;
    line-height: 1.5;
    margin: 26px 0 10px;
  }

  /* 日期行：窄屏不用竖线分隔，换行时靠间隙分开 */
  body.layout-editorial .report-dateline {
    gap: 6px 12px;
    font-size: 12.5px;
  }
  body.layout-editorial .report-dateline > .report-sep {
    display: none;
  }

  /* 首字下沉关掉后，导语段落要补回两字缩进，否则它比正文更贴边 */
  body.layout-editorial .report-article > section > h3.report-overview + p {
    text-indent: 2em;
  }

  /* 手机上没有右栏，旁注开关是空按钮，隐藏 */
  .site-nav .notes-toggle {
    display: none !important;
  }

  /* 章节浮层是 fixed 定位，滚动时一直压着正文，窄屏收起 */
  .report-mobile-outline {
    display: none !important;
  }
}
