/* 富文本（Quill / 编辑器）样式——独立文件，作用域为新闻详情页与片场详情页的 #news-detail-content .prose 与 #studio-content .prose */

/* 对齐支持：确保常见的对齐类在新闻详情区生效 */
#news-detail-content, #news-detail-content .prose, #studio-content, #studio-content .prose {
  /* 允许子元素的内联 text-align 或类控制对齐 */
  text-align: inherit !important;
}

/* 常见编辑器输出的对齐类（局部 scoped 到新闻详情，避免全站影响） */
#news-detail-content .ql-align-center,
#news-detail-content .align-center,
#news-detail-content .text-center,
#news-detail-content [style*="text-align:center"],
#news-detail-content p[style*="text-align:center"],
#news-detail-content div[style*="text-align:center"],
#studio-content .ql-align-center,
#studio-content .align-center,
#studio-content .text-center,
#studio-content [style*="text-align:center"],
#studio-content p[style*="text-align:center"],
#studio-content div[style*="text-align:center"] {
  text-align: center !important;
}

#news-detail-content .ql-align-right,
#news-detail-content .align-right,
#news-detail-content .text-right,
#news-detail-content [style*="text-align:right"],
#news-detail-content p[style*="text-align:right"],
#news-detail-content div[style*="text-align:right"],
#studio-content .ql-align-right,
#studio-content .align-right,
#studio-content .text-right,
#studio-content [style*="text-align:right"],
#studio-content p[style*="text-align:right"],
#studio-content div[style*="text-align:right"] {
  text-align: right !important;
}

#news-detail-content .ql-align-justify,
#news-detail-content .align-justify,
#news-detail-content .text-justify,
#news-detail-content [style*="text-align:justify"],
#news-detail-content p[style*="text-align:justify"],
#news-detail-content div[style*="text-align:justify"],
#studio-content .ql-align-justify,
#studio-content .align-justify,
#studio-content .text-justify,
#studio-content [style*="text-align:justify"],
#studio-content p[style*="text-align:justify"],
#studio-content div[style*="text-align:justify"] {
  text-align: justify !important;
}

/* 有些编辑器会通过 margin:0 auto 做居中，确保块级元素可以水平居中 */
#news-detail-content p[style*="margin:0 auto"],
#news-detail-content div[style*="margin:0 auto"],
#studio-content p[style*="margin:0 auto"],
#studio-content div[style*="margin:0 auto"] {
  display: block;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 如果编辑器将对齐类附在内联元素(如 span)上，强制其为块级并占满宽度，保证对齐生效 */
#news-detail-content .ql-align-center,
#news-detail-content .ql-align-right,
#news-detail-content .ql-align-justify,
#studio-content .ql-align-center,
#studio-content .ql-align-right,
#studio-content .ql-align-justify {
  display: block !important;
  width: 100% !important;
}

/* 更全面的富文本样式（仅作用于新闻详情的 .prose 范围） */
#news-detail-content .prose, #studio-content .prose {
  color: #374151;
  line-height: 1.8;
  font-size: 16px;
}

/* 图片：响应式、可居中、浮动支持 */
#news-detail-content .prose img, #studio-content .prose img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.25em auto;
  border-radius: 8px;
}
#news-detail-content .prose figure, #studio-content .prose figure {
  margin: 1.25em auto;
  text-align: center;
}
#news-detail-content .prose figure img, #studio-content .prose figure img {
  margin: 0 auto;
}
#news-detail-content .prose figcaption, #studio-content .prose figcaption {
  font-size: 0.9em;
  color: #6B7280;
  margin-top: 0.5em;
}

/* 支持编辑器输出的浮动图片类 */
#news-detail-content .prose .ql-float-left, #studio-content .prose .ql-float-left { float: left; margin-right: 1rem; max-width: 45%; }
#news-detail-content .prose .ql-float-right, #studio-content .prose .ql-float-right { float: right; margin-left: 1rem; max-width: 45%; }
#news-detail-content .prose:after, #studio-content .prose:after { content: ""; display: block; clear: both; }

/* 表格：横向滚动，表格样式清晰 */
#news-detail-content .prose table, #studio-content .prose table { width: 100%; border-collapse: collapse; margin: 1em 0; overflow: auto; display: block; }
#news-detail-content .prose table th, #studio-content .prose table th,
#news-detail-content .prose table td, #studio-content .prose table td { padding: 0.6em 0.8em; border: 1px solid #e5e7eb; text-align: left; }
#news-detail-content .prose table thead th, #studio-content .prose table thead th { background: #f9fafb; font-weight: 600; }

/* 代码块和行内代码 */
#news-detail-content .prose pre, #studio-content .prose pre { background: #0f172a; color: #e6edf3; padding: 1em; border-radius: 8px; overflow: auto; margin: 1em 0; }
#news-detail-content .prose code, #studio-content .prose code { background: rgba(15,23,42,0.06); padding: .15em .3em; border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Helvetica Neue", monospace; }

/* 嵌入视频：响应式比例容器 */
#news-detail-content .prose .embed-responsive, #studio-content .prose .embed-responsive { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; margin: 1em 0; }
#news-detail-content .prose .embed-responsive iframe, #studio-content .prose .embed-responsive iframe,
#news-detail-content .prose .embed-responsive video, #studio-content .prose .embed-responsive video,
#news-detail-content .prose .embed-responsive embed, #studio-content .prose .embed-responsive embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* 引用样式 */
#news-detail-content .prose blockquote, #studio-content .prose blockquote { border-left: 4px solid #E60012; padding-left: 1em; margin: 1.25em 0; color: #6B7280; font-style: italic; }

/* 列表样式 */
#news-detail-content .prose ul, #news-detail-content .prose ol, #studio-content .prose ul, #studio-content .prose ol { margin: 1em 0; padding-left: 1.5em; }
#news-detail-content .prose li, #studio-content .prose li { margin: 0.45em 0; }

/* 分割线 */
#news-detail-content .prose hr, #studio-content .prose hr { border: 0; height: 1px; background: #e5e7eb; margin: 1.5em 0; }

/* 表格/图片/视频在移动端保证可滚动或响应 */
@media (max-width: 768px) {
  #news-detail-content .prose table, #studio-content .prose table { display: block; width: 100%; overflow-x: auto; }
  #news-detail-content .prose .ql-float-left, #news-detail-content .prose .ql-float-right, #studio-content .prose .ql-float-left, #studio-content .prose .ql-float-right { float: none; display:block; margin: 1em auto; max-width: 100%; }
}

/* 小型微调：标题和段落间距 */
#news-detail-content .prose h1, #news-detail-content .prose h2, #news-detail-content .prose h3, #news-detail-content .prose h4, #studio-content .prose h1, #studio-content .prose h2, #studio-content .prose h3, #studio-content .prose h4 { margin-top: 1.25em; margin-bottom: .5em; color: #111827; }
#news-detail-content .prose p, #studio-content .prose p { margin-bottom: 1em; }

/* 首行缩进：中文语境常用“首行空两格”，约等于 2em 或 2ch（这里使用 2em 更稳定） */
#news-detail-content .prose p, #studio-content .prose p {
  text-indent: 2em; /* 首行空两格 */
}

/* 不对某些块元素应用首行缩进（如代码块、表格、引用、列表等） */
#news-detail-content .prose pre,
#news-detail-content .prose code,
#news-detail-content .prose table,
#news-detail-content .prose blockquote,
#news-detail-content .prose ul,
#news-detail-content .prose ol,
#news-detail-content .prose li,
#studio-content .prose pre,
#studio-content .prose code,
#studio-content .prose table,
#studio-content .prose blockquote,
#studio-content .prose ul,
#studio-content .prose ol,
#studio-content .prose li {
  text-indent: 0 !important;
}

/* 如果段落以图片或嵌入内容开头，取消缩进（编辑器可在该段落添加 .no-indent 类） */
#news-detail-content .prose p.no-indent, #studio-content .prose p.no-indent { text-indent: 0 !important; }
