/* 对话阅读规范：只调整显示，保留原消息、Markdown 结构与业务事件。 */
body .container-main.legaleasy-unified,
body .app-shell {
  --le-reading-font: 16px;
  --le-reading-leading: 1.9;
  --le-reading-paragraph: 16px;
  --le-reading-message-gap: 28px;
  --le-reading-font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

/* 两种页面结构共用同一套正文规则。 */
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) {
  min-width: 0;
  color: #334155;
  font-family: var(--le-reading-font-family);
  font-size: var(--le-reading-font);
  font-weight: 400;
  line-height: var(--le-reading-leading);
  letter-spacing: .01em;
  text-align: left;
  word-break: normal;
  overflow-wrap: anywhere;
  line-break: auto;
  background: transparent;
}
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) :is(p,li,blockquote) {
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) :is(p,ul,ol,blockquote,pre,table) { margin: 0 0 var(--le-reading-paragraph); }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) > :last-child { margin-bottom: 0; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) :is(h1,h2,h3,h4,h5,h6) {
  margin: 28px 0 12px;
  padding: 0;
  border: 0;
  color: #1e293b;
  font-weight: 650;
  line-height: 1.5;
  scroll-margin-top: 16px;
}
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) > :is(h1,h2,h3,h4,h5,h6):first-child { margin-top: 0; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) h1 { font-size: 24px; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) h2 { font-size: 20px; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) h3 { font-size: 18px; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) :is(h4,h5,h6) { font-size: 16px; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) :is(strong,b) { color: #1e293b; font-weight: 650; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) :is(ul,ol) { padding-left: 1.5em; list-style-position: outside; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) ul { list-style-type: disc; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) ol { list-style-type: decimal; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) li { margin: 8px 0; padding-left: .15em; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) li::marker { color: #64748b; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) li > :is(p,ul,ol) { margin-top: 6px; margin-bottom: 6px; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) ul ul { list-style-type: circle; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) blockquote { padding: 12px 16px; border-left: 3px solid #ccdbee; border-radius: 0 12px 12px 0; background: #f8fafc; color: #475569; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) blockquote > :last-child { margin-bottom: 0; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) a { color: #286bc1; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) a:hover { color: #174c91; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) hr { height: 0; margin: 28px 0; border: 0; border-top: 1px solid #e2e8f0; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) table { display: block; max-width: 100%; width: max-content; overflow-x: auto; border-collapse: collapse; font-size: 14px; line-height: 1.75; overscroll-behavior-inline: contain; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) :is(th,td) { min-width: 7.5em; max-width: 26em; padding: 10px 12px; border: 1px solid #e2e8f0; vertical-align: top; text-align: left; white-space: normal; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) th { color: #334155; background: #f1f5f9; font-weight: 650; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) code { padding: .15em .35em; border-radius: 5px; background: #f1f5f9; font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: .875em; letter-spacing: 0; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) pre { max-width: 100%; padding: 16px; overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; font-size: 14px; line-height: 1.7; letter-spacing: 0; overscroll-behavior-inline: contain; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) pre :is(code,.md-editor-code-block) { padding: 0; border: 0; background: transparent; font-size: inherit; white-space: pre !important; word-break: normal !important; overflow-wrap: normal; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) :is(table,pre) { overflow-y: hidden; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) :is(table,pre)::-webkit-scrollbar { display: block; height: 6px; }
:is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) :is(table,pre)::-webkit-scrollbar-thumb { border-radius: 6px; background: #cbd5e1; }

body .container-main.legaleasy-unified .messages-container > .message { margin: 0; }
body .container-main.legaleasy-unified .messages-container > .message + .message { margin-top: var(--le-reading-message-gap); }
body .container-main.legaleasy-unified .messages-container > .message.ai { width: fit-content; max-width: min(100%,760px); }
body .container-main.legaleasy-unified .messages-container > .message.user { max-width: min(88%,660px); }
body .container-main.legaleasy-unified .messages-container .message.ai .message-text { --md-bk-color: transparent; margin: 0; padding: 0; border-radius: 0; background: transparent; }
body .container-main.legaleasy-unified .messages-container .message.ai .preview-wrapper { min-width: 0; padding-bottom: 36px; }
body .container-main.legaleasy-unified .messages-container .message.ai :is(.copy-icon,.copy-icon2) { display: inline-flex; align-items: center; justify-content: center; left: 0; bottom: 0; width: 28px; height: 28px; border-radius: 8px; }
body .container-main.legaleasy-unified .messages-container .message.user .message-text,
body .app-shell .conversation .user-bubble { margin: 0; padding: 12px 16px; color: #334155; font-family: var(--le-reading-font-family); font-size: var(--le-reading-font); line-height: 1.8; letter-spacing: .01em; }
body .container-main.legaleasy-unified .messages-container .message.user .aligned-text { color: inherit; font-size: inherit; line-height: inherit; }
body .app-shell .conversation .message { margin-bottom: var(--le-reading-message-gap); }
body .app-shell .conversation .message + .message { margin-top: 0; }
body .app-shell .conversation .message-assistant .message-body { width: min(100%,760px); }
body .app-shell .conversation .message-user .message-body { max-width: min(88%,660px); }
body .app-shell .conversation .answer-footer { color: #94a3b8; font-size: 12px; letter-spacing: 0; line-height: 1.6; }

@media (min-width: 801px) {
  body .container-main.legaleasy-unified .conver-main .messages-container { padding: 0 max(0px,calc((100% - 840px)/2)) 12px; }
  body .app-shell .conversation { max-width: 840px; }
}
@media (max-width: 800px), (max-width: 1000px) and (max-height: 500px) and (pointer: coarse) {
  body .container-main.legaleasy-unified, body .app-shell { --le-reading-leading: 1.85; --le-reading-message-gap: 24px; }
  body .container-main.legaleasy-unified .conver-main .messages-container { padding: 0 0 12px; }
  body .container-main.legaleasy-unified .messages-container > .message.ai { width: 100%; max-width: 100%; }
  body .container-main.legaleasy-unified .messages-container > .message.user { max-width: 94%; }
  body .container-main.legaleasy-unified .messages-container .message.ai .preview-wrapper { padding-bottom: 48px; }
  body .container-main.legaleasy-unified .messages-container .message.ai :is(.copy-icon,.copy-icon2) { width: 44px; height: 44px; opacity: .7; }
  body .app-shell .conversation .message-assistant .message-body { width: 100%; }
  body .app-shell .conversation .message-user .message-body { max-width: 94%; }
  :is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) h1 { font-size: 22px; }
  :is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) h2 { font-size: 19px; }
  :is(body .container-main.legaleasy-unified .messages-container .md-editor-preview, body .app-shell .conversation .answer-card) h3 { font-size: 17px; }
}
