/* ============================================================
   Markdown 转 HTML —— 页面私有样式（/devtools/markdown-converter）
   通用结构复用 devtools.css，颜色只用 --c-* 变量，自动适配黑夜模式
   ============================================================ */

[hidden] { display: none; }

.mc-note {
    display: block;
    margin-bottom: 12px;
}

.mc-textarea {
    min-height: 420px;
}

/* 预览 / 源码输出面板限高滚动 */
.mc-pane {
    max-height: 420px;
    overflow: auto;
}

/* 源码面板内嵌的 pre 去掉自身边框与内边距，避免双重嵌套 */
.mc-html {
    min-height: 0;
    border: none;
    padding: 0;
    margin: 0;
}

/* ---------------- Markdown 渲染内容排版 ---------------- */
.md-render {
    line-height: 1.75;
    color: var(--c-text);
    word-break: break-word;
}

.md-render h1,
.md-render h2,
.md-render h3,
.md-render h4 {
    margin: 1.1em 0 .5em;
    font-weight: 800;
    line-height: 1.35;
    color: var(--c-text);
}

.md-render h1 { font-size: 1.5em; border-bottom: 1px solid var(--c-border); padding-bottom: .3em; }
.md-render h2 { font-size: 1.28em; border-bottom: 1px solid var(--c-border); padding-bottom: .25em; }
.md-render h3 { font-size: 1.12em; }

.md-render p { margin: .7em 0; }

.md-render a { color: var(--c-primary); text-decoration: underline; }

.md-render ul,
.md-render ol { margin: .7em 0; padding-left: 1.6em; }
.md-render li { margin: .3em 0; }

.md-render blockquote {
    margin: .8em 0;
    padding: .4em 1em;
    border-left: 4px solid var(--c-primary);
    background: var(--c-bg-soft);
    color: var(--c-text-sub);
    border-radius: 0 8px 8px 0;
}

.md-render code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .92em;
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--c-bg-soft);
    border: 1px solid var(--c-border);
    color: var(--c-primary);
}

.md-render pre {
    margin: .8em 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--c-bg-soft);
    border: 1px solid var(--c-border);
    overflow: auto;
}

.md-render pre code {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--c-text);
}

.md-render table {
    width: 100%;
    border-collapse: collapse;
    margin: .9em 0;
    font-size: 14px;
}

.md-render th,
.md-render td {
    border: 1px solid var(--c-border);
    padding: 8px 10px;
    text-align: left;
}

.md-render th { background: var(--c-bg-soft); font-weight: 700; }

.md-render img { max-width: 100%; border-radius: 8px; }

.md-render hr {
    border: none;
    border-top: 1px solid var(--c-border);
    margin: 1.2em 0;
}

/* 任务列表（GFM）去掉项目符号 */
.md-render li.task-list-item,
.md-render li:has(> input[type="checkbox"]) {
    list-style: none;
    margin-left: -1.3em;
}

@media (max-width: 860px) {
    .mc-textarea { min-height: 240px; }
    .mc-pane { max-height: 320px; }
}
