/* 静态页在复用官网 news/detail 样式类时的少量补丁 */
html,
body {
  margin: 0;
}
a.news_item_j5gu1e {
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}
.news_item_j5gu1e.is-hidden {
  display: none !important;
}
.label_item_cdEkvj {
  cursor: pointer;
}

/* 资讯列表 Tab：当前未选中的列表面板不占位（与 data-filter 对应 data-tab） */
html.ace-news-list-page .ace-news-tab-panel[hidden] {
  display: none !important;
}
a.back_QOTn6d,
a.back_scUput {
  display: block;
  text-decoration: none;
  color: transparent;
}
.news_text_9-otn9 p {
  margin: 0 0 0.18rem;
}
.container_FhUsvS.is-hidden {
  display: none !important;
}

/*
 * 详情页：与官网 detail?type=2 同结构。
 * 问题根源 1）.title_nuZw5M 写死 width:7.6rem，与右侧+返回并排时总宽可超过 .top_35MNaO(9.96rem)；
 * 2）.content_box_SkhO6y 固定 height:7.4rem + overflow:hidden，标题多行后会把顶栏或正文裁掉。
 */
.content_5NOSRR {
  height: auto !important;
  min-height: 8.39rem;
  box-sizing: border-box;
  /* 右侧装饰滚动条在 .news_wrap 外（right:-2.69rem），横向勿裁切 */
  overflow-x: visible;
  /*
   * 原站 background-size: contain — 标题折行后底板变高，contain 会在上下「留白」，
   * 流式布局仍占满整块高度，正文会画进留白区，视觉上像越过羊皮纸底纹落到外层木纹上。
   * 改为铺满底板（随容器拉伸），让底图边框与盒子边界一致。
   */
  background-size: 100% 100% !important;
  /*
   * 底图内框通常比素材边缘略高，加一点底内边距把正文区整体上抬；仍不够可再略减 --ace-detail-news-viewport。
   */
  --ace-detail-parchment-inset-bottom: 0.42rem;
  padding-bottom: var(--ace-detail-parchment-inset-bottom);
  /*
   * 正文滚动视区高度（与官网一致默认 6rem）。单独改 .news_list_qSAgkI 的 height 往往无效：
   * 补丁里对它写了固定高度，完全跟随变量。
   * 要缩小以贴合背景图里的「纸张」区域，请改下面变量（并保留与轨道同高）。
   */
  --ace-detail-news-viewport: 4.5rem;
}

.content_box_SkhO6y {
  height: auto !important;
  min-height: 7.4rem;
  overflow: visible !important;
  align-items: stretch !important;
}

/* 顶栏 / 分割线 / 正文区与官网一致保持约 9.96rem 内容宽，在底板内水平居中（用后代选择器，避免多包一层 div 后规则失效） */
.content_box_SkhO6y .top_35MNaO,
.content_box_SkhO6y .line_vC6zff,
.content_box_SkhO6y .news_wrap_vR7VO- {
  width: 9.96rem;
  max-width: calc(100% - 0.48rem);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.content_box_SkhO6y .top_35MNaO {
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  row-gap: 0.08rem;
  column-gap: 0.12rem;
}

/* 标题占剩余空间，禁止再使用 7.6rem 固定宽导致横向溢出 */
.top_35MNaO .title_nuZw5M {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  width: auto !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  line-height: 1.15;
  box-sizing: border-box;
}

.top_35MNaO .top_right_g8y95a,
.top_35MNaO a.back_scUput {
  flex-shrink: 0;
}

/*
 * 正文区：父级改为 height:auto 后，flex 子项默认 min-height:auto 会把 .news_wrap 撑高，
 * .news_list 的 height:100% 不再等于「固定视口」，长文无法内部滚动，右侧装饰滑块也不会动。
 * 视口高度由 .content_5NOSRR 上的 --ace-detail-news-viewport 统一控制（须与轨道同高）。
 */
.content_box_SkhO6y .news_wrap_vR7VO- {
  flex: 0 0 var(--ace-detail-news-viewport, 6rem);
  height: var(--ace-detail-news-viewport, 6rem);
  max-height: var(--ace-detail-news-viewport, 6rem);
  min-height: 0;
  /*
   * 不可用 overflow:hidden：官网 .scrollbar_track_kPeBkh 为 position:absolute; right:-2.69rem，
   * 在框外绘制；hidden 会把整条轨道与 scrollbar_thumb_l9ZOqL 裁没。
   * 正文裁切与滚动仅由下方 .news_list_qSAgkI 负责即可（与线上 detail 一致）。
   */
  overflow: visible;
  box-sizing: border-box;
}

.content_box_SkhO6y .news_wrap_vR7VO- .scrollbar_track_kPeBkh {
  /* 官网写死 6rem；与正文视口联动，否则条比正文长/短会穿帮 */
  height: var(--ace-detail-news-viewport, 6rem) !important;
  z-index: 2;
  pointer-events: none;
}

.content_box_SkhO6y .news_wrap_vR7VO- .scrollbar_track_kPeBkh .scrollbar_thumb_l9ZOqL {
  pointer-events: auto;
}

/*
 * 关键：仅用 height:100% 依赖父级算高；父级在 flex/多层嵌套下常变成 height:auto，
 * 此时百分比按 auto 处理，列表会随正文无限变高，羊皮纸底框外仍是一整块「死文字」、也不触发滚动。
 * 这里对列表直接用与视口相同的固定高度（rem），保证一定有 scrollHeight>clientHeight，自定义滑块才能同步。
 */
.content_box_SkhO6y .news_list_qSAgkI {
  min-height: 0 !important;
  height: var(--ace-detail-news-viewport, 6rem) !important;
  max-height: var(--ace-detail-news-viewport, 6rem) !important;
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  overscroll-behavior: contain;
  position: relative;
  z-index: 1;
}

/*
 * 详情页：禁止整页超出视口（浏览器出现横/纵滚动条）。
 * - 官网 .container_FhUsvS 用 width:100vw，在出现纵向条时 100vw 仍按「无条宽度」算，常诱发横向条。
 * - 标题折行后 .content_5NOSRR 变高，在 100vh 内居中时子项仍会溢出文档。
 * detail.html 根节点需带 class="ace-detail-page"。略缩小 rem 见 detail.html 中 window.remScale。
 */
html.ace-detail-page {
  height: 100%;
  overflow: hidden;
}

html.ace-detail-page body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

html.ace-detail-page #root,
html.ace-detail-page .app-container,
html.ace-detail-page .swiper-wrapper {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

html.ace-detail-page .container_FhUsvS {
  flex: 1 1 auto;
  width: 100% !important;
  max-width: 100%;
  height: 100% !important;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

html.ace-detail-page .content_5NOSRR {
  /* 允许在视口内略缩小底板，避免顶破 100% 父级 */
  min-height: 0 !important;
  max-height: 100%;
  width: min(17.06rem, calc(100% - 0.6rem)) !important;
  max-width: min(17.06rem, calc(100% - 0.6rem)) !important;
  margin-left: auto;
  margin-right: auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* -------------------------------------------------------------------------- */
/* 资讯列表页（Category/index）：news-official-local 中 100vw + 纵向条导致横向溢出； */
/* 装饰滚动条 right 负值也会撑出横向滚动。与详情页一致用 100% + 裁剪横向。 */
/* -------------------------------------------------------------------------- */

html.ace-news-list-page {
  height: 100%;
  overflow: hidden;
}

html.ace-news-list-page body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

html.ace-news-list-page #root,
html.ace-news-list-page .app-container,
html.ace-news-list-page .swiper-wrapper {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  width: 100% !important;
  max-width: 100%;
}

html.ace-news-list-page .container_8qrPET {
  flex: 1 1 auto;
  width: 100% !important;
  max-width: 100%;
  height: 100% !important;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

html.ace-news-list-page .content_GTJI3Y {
  min-height: 0 !important;
  max-height: 100%;
  width: min(17.06rem, calc(100% - 0.6rem)) !important;
  max-width: min(17.06rem, calc(100% - 0.6rem)) !important;
  margin-left: auto;
  margin-right: auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}
