/* Markdown render for problem/notice pages
   Scoped to .uoj-markdown-body to avoid breaking existing UI. */

.uoj-markdown-body {
  --md-fg: #24292f;
  --md-muted: #57606a;
  --md-border: rgba(175, 184, 193, 0.45);
  --md-bg-subtle: rgba(175, 184, 193, 0.14);
  --md-code-bg: rgba(175, 184, 193, 0.18);
  line-height: 1.7;
  font-size: 15px;
  color: var(--md-fg);
}
html[data-theme="dark"] .uoj-markdown-body {
  --md-fg: #e6edf3;
  --md-muted: #9da7b3;
  --md-border: rgba(175, 184, 193, 0.28);
  --md-bg-subtle: rgba(175, 184, 193, 0.10);
  --md-code-bg: rgba(175, 184, 193, 0.14);
}

.uoj-markdown-body > :first-child { margin-top: 0 !important; }
.uoj-markdown-body > :last-child { margin-bottom: 0 !important; }

.uoj-markdown-body p { margin: 0 0 12px; }

.uoj-markdown-body h1,
.uoj-markdown-body h2,
.uoj-markdown-body h3,
.uoj-markdown-body h4,
.uoj-markdown-body h5,
.uoj-markdown-body h6 {
  margin: 20px 0 12px;
  font-weight: 700;
  line-height: 1.25;
}
.uoj-markdown-body h1 { font-size: 1.8em; padding-bottom: .25em; border-bottom: 1px solid var(--md-border); }
.uoj-markdown-body h2 { font-size: 1.45em; padding-bottom: .2em; border-bottom: 1px solid var(--md-border); }
.uoj-markdown-body h3 { font-size: 1.22em; }
.uoj-markdown-body h4 { font-size: 1.05em; }

.uoj-markdown-body hr { border: 0; border-top: 1px solid var(--md-border); margin: 16px 0; }

.uoj-markdown-body blockquote {
  margin: 0 0 12px;
  padding: 0.2em 1em;
  color: var(--md-muted);
  border-left: 0.25em solid var(--md-border);
}

.uoj-markdown-body ul,
.uoj-markdown-body ol { margin: 0 0 12px; padding-left: 1.4em; }
.uoj-markdown-body li { margin: 4px 0; }

.uoj-markdown-body a { text-decoration: underline; text-underline-offset: 2px; }

.uoj-markdown-body img { max-width: 100%; height: auto; }

.uoj-markdown-body code {
  padding: .18em .4em;
  border-radius: 6px;
  background: var(--md-code-bg);
  font-size: 0.92em;
}
.uoj-markdown-body pre {
  margin: 0 0 12px;
  padding: 12px 14px;
  overflow: auto;
  border: 1px solid var(--md-border);
  border-radius: 10px;
  background: var(--md-bg-subtle);
}
.uoj-markdown-body pre code {
  background: transparent;
  padding: 0;
  font-size: 0.92em;
}

.uoj-markdown-body table {
  width: 100%;
  margin: 0 0 12px;
  border-collapse: collapse;
}
.uoj-markdown-body table th,
.uoj-markdown-body table td {
  border: 1px solid var(--md-border);
  padding: 6px 10px;
}
.uoj-markdown-body table th {
  background: var(--md-bg-subtle);
  font-weight: 700;
}

/* md-editor-v3 preview artifacts (e.g. "plain 复制代码") — hide on display pages */
.uoj-markdown-body .md-editor-code-head,
.uoj-markdown-body .md-editor-code-action,
.uoj-markdown-body .md-editor-code-head-language,
.uoj-markdown-body .md-editor-code-head-lang,
.uoj-markdown-body .md-editor-copy-button,
.uoj-markdown-body .md-editor-code-lang,
.uoj-markdown-body .md-editor-code-lang-name,
.uoj-markdown-body .md-editor-code-header,
.uoj-markdown-body .md-editor-code-header-left,
.uoj-markdown-body .md-editor-code-header-right {
  display: none !important;
}

/* GitHub markdown default sets background; let page background show through */
.uoj-markdown-body.markdown-body {
  background: transparent;
}

/* md-editor-v3 accessibility wrapper spans can leak into saved HTML */
.uoj-markdown-body [rn-wrapper],
.uoj-markdown-body span[rn-wrapper],
.uoj-markdown-body [aria-hidden="true"][rn-wrapper],
.uoj-markdown-body [aria-hidden="true"][rn-wrapper] * {
  display: none !important;
}

