/* ai message content */
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
/* message content */
.message-content h6 {
  font-weight: 800;
  line-height: 1.7;
  margin: 1.1em 0 0.5em;
  color: #7fe3ff;
}

.message-content h2 { font-size: 1.18em; }
.message-content h3 { font-size: 1.08em; }
.message-content h4 { font-size: 1em; }

.message-content h2:first-child,
.message-content h3:first-child,
.message-content p:first-child { margin-top: 0; }

.message-content p { margin: 0 0 0.75em; line-height: 2.05; }
.message-content p:last-child { margin-bottom: 0; }

.message-content strong { font-weight: 800; color: #fff; }
.message-content em { font-style: italic; opacity: 0.94; }
.message-content del { opacity: 0.6; }

.message-content ul,
.message-content ol {
  margin: 0 0 0.8em;
  padding-right: 1.4em;
  padding-left: 0;
}

.message-content li { margin-bottom: 0.4em; line-height: 1.95; }
.message-content li::marker { color: #7c5cff; }

.message-content ul ul,
.message-content ol ol,
.message-content ul ol,
.message-content ol ul { margin-bottom: 0.2em; margin-top: 0.35em; }

.message-content blockquote {
  margin: 0 0 0.85em;
  padding: 0.6em 1em;
  border-right: 3px solid #7c5cff;
  border-radius: 0 10px 10px 0;
  background: rgba(124, 92, 255, 0.09);
  line-height: 2;
}

.message-content hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  margin: 1.1em 0;
}

.message-content a {
  color: #4cc9f0;
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-word;
}

/* md inline */
.md-inline {
  font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.86em;
  padding: 0.15em 0.42em;
  border-radius: 6px;
  background: rgba(124, 92, 255, 0.16);
  color: #c9b8ff;
  direction: ltr;
  display: inline-block;
  unicode-bidi: embed;
}

/* md code */
.md-code {
  margin: 0 0 0.9em;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0d0d18;
  direction: ltr;
}

.md-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.42em 0.85em;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.72em;
  color: #9aa0c0;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* md copy */
.md-copy {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: none;
  color: inherit;
  border-radius: 7px;
  padding: 0.18em 0.65em;
  font-size: 0.95em;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.md-copy:hover { border-color: #7c5cff; color: #c9b8ff; }

/* md code */
.md-code pre {
  margin: 0;
  padding: 0.9em 1em;
  overflow-x: auto;
  background: transparent;
  border-radius: 0;
}

.md-code code {
  font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.84em;
  line-height: 1.75;
  color: #e6e6f5;
  white-space: pre;
}

.tok-key { color: #ff7ab6; }
.tok-str { color: #a5e075; }
.tok-num { color: #ffb86c; }
.tok-com { color: #6b7394; font-style: italic; }

/* md table */
.md-table-wrap {
  margin: 0 0 0.9em;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
}

/* message content */
.message-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88em;
  min-width: 320px;
}

.message-content th,
.message-content td {
  padding: 0.6em 0.85em;
  text-align: right;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.message-content th {
  background: rgba(124, 92, 255, 0.16);
  font-weight: 800;
  color: #d6ccff;
  white-space: nowrap;
}

.message-content tbody tr:last-child td { border-bottom: none; }
.message-content tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.025); }

.md-math { direction: ltr; display: inline-block; unicode-bidi: embed; }
/* md math */
.md-math[data-display="1"] {
  display: block;
  text-align: center;
  margin: 0.8em 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25em 0;
}

/* light theme */
body.light-theme .message-content h2,
body.light-theme .message-content h3,
body.light-theme .message-content h4 { color: #0b5cad; }

body.light-theme .message-content strong { color: #10121f; }
body.light-theme .message-content a { color: #0066cc; }
body.light-theme .message-content li::marker { color: #6a4bff; }

/* message content */
body.light-theme .message-content blockquote {
  background: rgba(106, 75, 255, 0.08);
  border-right-color: #6a4bff;
}

body.light-theme .message-content hr { border-top-color: rgba(16, 24, 48, 0.14); }

/* md inline */
body.light-theme .md-inline {
  background: rgba(106, 75, 255, 0.12);
  color: #4a34b8;
}

/* md code */
body.light-theme .md-code {
  background: #f3f4fb;
  border-color: rgba(16, 24, 48, 0.12);
}

body.light-theme .md-code-head {
  background: rgba(16, 24, 48, 0.05);
  color: #5b6180;
}

body.light-theme .md-copy { border-color: rgba(16, 24, 48, 0.18); }
body.light-theme .md-code code { color: #232741; }
body.light-theme .tok-key { color: #c2185b; }
body.light-theme .tok-str { color: #2e7d32; }
body.light-theme .tok-num { color: #b26500; }
body.light-theme .tok-com { color: #767d99; }

body.light-theme .md-table-wrap { border-color: rgba(16, 24, 48, 0.12); }
body.light-theme .message-content th,
body.light-theme .message-content td { border-bottom-color: rgba(16, 24, 48, 0.09); }
body.light-theme .message-content th { background: rgba(106, 75, 255, 0.12); color: #34306b; }
body.light-theme .message-content tbody tr:nth-child(even) { background: rgba(16, 24, 48, 0.02); }

/* mobile 640px */
@media (max-width: 640px) {
  .message-content table { font-size: 0.8em; }
  .message-content th,
  .message-content td { padding: 0.5em 0.6em; }
  .md-code code { font-size: 0.78em; }
}
