/* ==========================================================================
   News Detail Page — Mobile (m202606)
   Design width: 1080px
   ========================================================================== */

.news-detail-page {
  --news-detail-main-width: calc(100% - 18%);
  position: absolute;
  /* [inset-fallback] iOS<14.5 不支持 inset 简写，勿删 */
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0;
  background: #d6cfc4 url('/m/assets/images/newsList/m-bg.png') center 1rem / cover no-repeat;
  /* [ios-overflow-fix] 同 news-list：防横向橡皮筋撑出深色底 */
  overflow: hidden auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(180, 160, 120, .4) transparent;
}

/* Webkit scrollbar */
.news-detail-page::-webkit-scrollbar {
  width: .06rem;
}

.news-detail-page::-webkit-scrollbar-track {
  background: transparent;
}

.news-detail-page::-webkit-scrollbar-thumb {
  background: rgba(180, 160, 120, .4);
  border-radius: .03rem;
}

.news-detail-page::-webkit-scrollbar-thumb:hover {
  background: rgba(180, 160, 120, .6);
}

.news-detail-kv,
.news-detail-header,
.news-detail-divider,
.news-detail-body,
.news-detail-loading,
.news-detail-error,
.news-detail-footer-wrap {
  position: relative;
  z-index: 1;
}

/* KV Banner — reuse news-list visual asset */
.news-list-kv {
  width: 100%;
}

.news-list-kv__img {
  display: block;
  width: 100%;
  height: auto;
}

.news-list-kv__breadcrumb {
  position: absolute;
  left: .59rem;
  bottom: 1.7rem;
  font-family: "HYYouYuan", "Arial Rounded MT Bold", Arial, Helvetica, sans-serif;
  font-size: .46rem;
  font-weight: normal;
  line-height: 1;
  letter-spacing: -.01rem;
  color: #f3f0ea;
  text-shadow: 0 0 .32rem rgba(18, 31, 5, .8);
}

[data-lang="ja"] .news-list-kv__breadcrumb {
  font-family: "ja2";
}

/* Header */
.news-detail-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: var(--news-detail-main-width);
  /* min-height: 1.2rem; */
  margin: 0 auto;
  padding-top: 0.4rem;
}

.news-detail-header__title {
  width: 100%;
  font-size: 0.56rem;
  color: #d56c1f;
  text-align: center;
  line-height: 1.35;
  font-family: "en2";
}

[data-lang="ja"] .news-detail-header__title {
  font-family: "ja2";
}

.news-detail-header__meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .12rem;
  margin: .3rem 0 0;
  font-family: "en1zc";
  font-size: .32rem;
  line-height: 1.4;
  color: #3d3a3a;
  text-align: center;
}

/* [gap-fallback:iOS13] .news-detail-header__meta（wrap 场景用均分法） */
.news-detail-header__meta > * { margin: .06rem; }
@supports (inset-inline: 0) {
  .news-detail-header__meta { gap: .12rem; }
  .news-detail-header__meta > * { margin: 0; }
}

[data-lang="ja"] .news-detail-header__meta {
  font-family: "ja1";
}

.news-detail-header__meta[hidden] {
  display: none;
}

.news-detail-header__date {
  color: inherit;
  font-family: "en1zc";
  font-size: inherit;
  line-height: inherit;
  letter-spacing: 0;
}

.news-detail-header__column {
  color: inherit;
  font: inherit;
  line-height: inherit;
  font-weight: normal;
}

.news-detail-divider {
  width: var(--news-detail-main-width);
  margin: .5rem auto .18rem;
}

.news-detail-divider__img {
  display: block;
  width: 100%;
  height: .35rem;
  object-fit: contain;
}

/* Article body */
.news-detail-body {
  box-sizing: border-box;
  width: var(--news-detail-main-width);
  margin: 0 auto;
  padding: .42rem 0 1rem;
  color: #3d362f;
  font-family: "en1zc";
  font-size: .28rem;
  line-height: 1.76;
  overflow-wrap: anywhere;
  word-break: normal;
  border-radius: .24rem;
}

[data-lang="ja"] .news-detail-body {
  font-family: "ja1";
}

.news-detail-body p,
.news-detail-body div {
  margin: 0 0 .28rem;
  color: inherit;
  font: inherit;
  line-height: inherit;
}

.news-detail-body span,
.news-detail-body strong,
.news-detail-body em,
.news-detail-body b,
.news-detail-body i,
.news-detail-body u,
.news-detail-body s {
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.news-detail-body strong,
.news-detail-body b {
  font-family: "en2", Arial, Helvetica, sans-serif;
  font-weight: 700;
}

[data-lang="ja"] .news-detail-body strong,
[data-lang="ja"] .news-detail-body b {
  font-family: "ja2", sans-serif;
}

.news-detail-body em,
.news-detail-body i {
  font-style: italic;
}

.news-detail-body h1,
.news-detail-body h2,
.news-detail-body h3,
.news-detail-body h4,
.news-detail-body h5,
.news-detail-body h6 {
  margin: .48rem 0 .24rem;
  color: #2f2923;
  font-family: "HYYouYuan", "Arial Rounded MT Bold", Arial, Helvetica, sans-serif;
  font-weight: 700;
  line-height: 1.35;
}

.news-detail-body h1 {
  font-size: .42rem;
}

.news-detail-body h2 {
  font-size: .38rem;
}

.news-detail-body h3 {
  font-size: .34rem;
}

.news-detail-body h4 {
  font-size: .32rem;
}

.news-detail-body h5 {
  font-size: .3rem;
}

.news-detail-body h6 {
  font-size: .28rem;
}

.news-detail-body ul,
.news-detail-body ol {
  margin: .24rem 0 .32rem;
  padding-left: .42rem;
}

.news-detail-body li {
  margin: 0 0 .16rem;
  color: inherit;
  line-height: inherit;
}

/* Quill 列表符号体系：JS 清洗后 class 被移除，但 data-list 属性保留，
   用属性选择器 + ::before 重建符号（bullet/checkbox 列表同样输出在 <ol> 内，
   不处理会被 UA 误显为数字编号） */
.news-detail-body li[data-list] {
  list-style: none;
  padding-left: .4rem;
}

.news-detail-body li[data-list]::before {
  display: inline-block;
  width: .26rem;
  margin-left: -.4rem;
  margin-right: .14rem;
  text-align: right;
  white-space: nowrap;
}

/* 有序列表：每个 ol 独立计数 */
.news-detail-body ol {
  counter-reset: ql-list;
}

.news-detail-body li[data-list="ordered"] {
  counter-increment: ql-list;
}

.news-detail-body li[data-list="ordered"]::before {
  content: counter(ql-list, decimal) ". ";
}

/* 无序列表：圆点 */
.news-detail-body li[data-list="bullet"]::before {
  content: "\2022";
  font-weight: 700;
}

/* 任务列表：勾选 / 未勾选 */
.news-detail-body li[data-list="checked"]::before {
  content: "\2611";
}

.news-detail-body li[data-list="unchecked"]::before {
  content: "\2610";
}

/* 嵌套缩进（JS 白名单保留 ql-indent-* class，基础 .4rem 按级 +.3rem） */
.news-detail-body li.ql-indent-1 { padding-left: .7rem; }
.news-detail-body li.ql-indent-2 { padding-left: 1rem; }
.news-detail-body li.ql-indent-3 { padding-left: 1.3rem; }
.news-detail-body li.ql-indent-4 { padding-left: 1.6rem; }
.news-detail-body li.ql-indent-5 { padding-left: 1.9rem; }
.news-detail-body li.ql-indent-6 { padding-left: 2.2rem; }
.news-detail-body li.ql-indent-7 { padding-left: 2.5rem; }
.news-detail-body li.ql-indent-8 { padding-left: 2.8rem; }
.news-detail-body li.ql-indent-9 { padding-left: 3.1rem; }

.news-detail-body a,
.news-detail-richtext__link {
  color: #b9651c;
  text-decoration: underline;
  text-underline-offset: .04rem;
}

.news-detail-body img,
.news-detail-richtext__image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: .34rem auto;
  border-radius: .16rem;
  object-fit: contain;
}

.news-detail-body video,
.news-detail-body iframe,
.news-detail-richtext__video,
.news-detail-richtext__frame {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  margin: .34rem auto;
  border: 0;
  border-radius: .16rem;
  background: #111;
}

/* iOS 13 等不支持 aspect-ratio 的浏览器：按正文容器宽度（视口的 82%）换算 16:9 兜底高度 */
@supports not (aspect-ratio: 16 / 9) {
  .news-detail-body video,
  .news-detail-body iframe,
  .news-detail-richtext__video,
  .news-detail-richtext__frame {
    height: calc(82vw * 9 / 16);
  }
}

.news-detail-table-wrap {
  width: 100%;
  margin: .34rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.news-detail-body table,
.news-detail-richtext__table {
  width: 100%;
  min-width: 6rem;
  border-collapse: collapse;
  color: inherit;
  font-size: .24rem;
  line-height: 1.5;
}

.news-detail-body th,
.news-detail-body td {
  padding: .16rem .18rem;
  border: .02rem solid rgba(61, 54, 47, .22);
  background: rgba(255, 255, 255, .35);
  vertical-align: top;
}

/* 格内段落：消除 .news-detail-body p 的 .28rem 下间距污染 */
.news-detail-body td p {
  margin-bottom: 0;
}

/* 表头行：主题深棕底 + 浅色字（Quill 无 thead，表头为 tbody 首行） */
.news-detail-body thead th,
.news-detail-body tbody tr:first-child td {
  background: #625d57;
  color: #f5f0e8;
}

/* 引用块 */
.news-detail-body blockquote {
  margin: 0 0 .28rem;
  padding: .18rem .24rem;
  border-left: .06rem solid #b9651c;
  border-radius: 0 .16rem .16rem 0;
  background: rgba(255, 255, 255, .35);
  color: #625d57;
}

.news-detail-body blockquote p {
  margin-bottom: .12rem;
}

.news-detail-body blockquote p:last-child {
  margin-bottom: 0;
}

/* 代码块 */
.news-detail-body pre {
  margin: 0 0 .28rem;
  padding: .24rem;
  border-radius: .16rem;
  background: #2f2923;
  color: #f5f0e8;
  font-family: Monaco, "Courier New", monospace;
  font-size: .24rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.news-detail-body code {
  font-family: Monaco, "Courier New", monospace;
}

.news-detail-body > :last-child {
  margin-bottom: 0;
}

/* Loading & Error */
.news-detail-loading,
.news-detail-error {
  width: var(--news-detail-main-width);
  margin-right: auto;
  margin-left: auto;
  text-align: center;
  padding: 1rem 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.26rem;
}

.news-detail-error[hidden] {
  display: none;
}

.news-detail-error a {
  display: inline-block;
  margin-top: 0.3rem;
  color: #ffc832;
  text-decoration: underline;
}

.news-detail-footer-wrap {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: .6rem;
}

.news-detail-footer-wrap .site-footer {
  margin-top: 0;
}
