*, *::before, *::after { box-sizing: border-box; }
:root {
--bg: #f8f9fa;
--surface: #ffffff;
--border: #e1e4e8;
--border-md: #d0d7de;
--text: #1f2328;
--text-muted:#656d76;
--accent: #0969da;
--accent-bg: #ddf4ff;
--tab-h: 36px;
--toolbar-h: 36px;
--radius: 6px;
--mono: ui-monospace, "SFMono-Regular", "Consolas", monospace;
--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
body {
margin: 0;
font-family: var(--sans);
font-size: 14px;
color: var(--text);
background: var(--bg);
height: 100dvh;
display: flex;
flex-direction: column;
}
[data-md-root] {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
margin: 16px;
border: 1px solid var(--border-md);
border-radius: var(--radius);
background: var(--surface);
overflow: hidden;
box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
}
[role="tablist"] {
display: flex;
align-items: stretch;
height: var(--tab-h);
border-bottom: 1px solid var(--border);
background: var(--bg);
padding: 0 8px;
gap: 0;
flex-shrink: 0;
}
[role="tab"] {
display: inline-flex;
align-items: center;
padding: 0 14px;
height: 100%;
border: none;
background: none;
font: inherit;
font-size: 13px;
font-weight: 500;
color: var(--text-muted);
cursor: pointer;
border-bottom: 2px solid transparent;
margin-bottom: -1px;
transition: color .15s, border-color .15s;
white-space: nowrap;
}
[role="tab"]:hover { color: var(--text); }
[role="tab"][data-state="active"] {
color: var(--accent);
border-bottom-color: var(--accent);
}
[role="tab"]:focus-visible {
outline: 2px solid var(--accent);
outline-offset: -2px;
border-radius: 3px;
}
[role="toolbar"] {
display: flex;
align-items: center;
height: var(--toolbar-h);
padding: 0 8px;
gap: 2px;
border-bottom: 1px solid var(--border);
background: var(--bg);
flex-shrink: 0;
}
[role="toolbar"] button {
display: inline-flex;
align-items: center;
padding: 0 10px;
height: 26px;
border: 1px solid transparent;
background: none;
border-radius: 4px;
font: inherit;
font-size: 12px;
font-weight: 500;
color: var(--text-muted);
cursor: pointer;
transition: background .1s, border-color .1s, color .1s;
}
[role="toolbar"] button:hover {
background: var(--border);
border-color: var(--border-md);
color: var(--text);
}
[role="toolbar"] button:active {
background: #dae8f4;
}
[role="toolbar"] [role="separator"] {
width: 1px;
height: 18px;
background: var(--border-md);
margin: 0 4px;
flex-shrink: 0;
}
.split-pane {
display: flex;
flex: 1;
min-height: 0;
}
[data-md-editor] {
display: flex;
flex: 1;
min-width: 0;
min-height: 0;
}
[data-md-editor] textarea {
flex: 1;
width: 100%;
min-height: 0;
resize: none;
border: none;
outline: none;
padding: 16px 20px;
font-family: var(--mono);
font-size: 13px;
line-height: 1.6;
color: var(--text);
background: var(--surface);
caret-color: var(--accent);
}
[data-md-inline-editor] {
flex: 1;
min-height: 0;
outline: none;
padding: 16px 20px;
line-height: 1.7;
color: var(--text);
overflow-y: auto;
}
[data-md-inline-editor] h1,
[data-md-inline-editor] h2,
[data-md-inline-editor] h3,
[data-md-inline-editor] h4 {
margin: 1em 0 .4em;
line-height: 1.25;
font-weight: 600;
}
[data-md-inline-editor] h1 { font-size: 1.75em; }
[data-md-inline-editor] h2 { font-size: 1.35em; border-bottom: 1px solid var(--border); padding-bottom: .3em; }
[data-md-inline-editor] h3 { font-size: 1.1em; }
[data-md-inline-editor] p { margin: .6em 0; }
[data-md-inline-editor] ul,
[data-md-inline-editor] ol { margin: .6em 0; padding-left: 1.8em; }
[data-md-inline-editor] li { margin: .2em 0; }
[data-md-inline-editor] blockquote {
margin: .6em 0;
padding: .4em 1em;
border-left: 3px solid var(--border-md);
color: var(--text-muted);
}
[data-md-inline-editor] pre {
background: var(--bg);
border: 1px solid var(--border);
border-radius: 4px;
padding: .75em 1em;
overflow-x: auto;
font-family: var(--mono);
font-size: .9em;
line-height: 1.5;
margin: .6em 0;
}
[data-md-inline-editor] code {
font-family: var(--mono);
font-size: .9em;
background: var(--accent-bg);
padding: .1em .35em;
border-radius: 3px;
}
[data-md-inline-editor] pre code {
background: none;
padding: 0;
}
[data-md-inline-editor] [data-block-index]:focus-within,
[data-md-inline-editor] [data-block-index]:empty:not(:focus-within) {
}
[data-md-splitter] {
width: 1px;
background: var(--border);
cursor: col-resize;
flex-shrink: 0;
transition: background .15s;
}
[data-md-splitter]:hover { background: var(--accent); }
[data-md-preview] {
flex: 1;
min-width: 0;
overflow-y: auto;
padding: 16px 20px;
background: var(--surface);
line-height: 1.7;
}
[data-md-preview] h1,
[data-md-preview] h2,
[data-md-preview] h3 { font-weight: 600; line-height: 1.25; }
[data-md-preview] h1 { font-size: 1.75em; }
[data-md-preview] h2 { font-size: 1.35em; border-bottom: 1px solid var(--border); padding-bottom: .3em; }
[data-md-preview] code {
font-family: var(--mono);
font-size: .9em;
background: var(--accent-bg);
padding: .1em .35em;
border-radius: 3px;
}
[data-md-preview] pre {
background: var(--bg);
border: 1px solid var(--border);
border-radius: 4px;
padding: .75em 1em;
overflow-x: auto;
}
[data-md-preview] pre code { background: none; padding: 0; }
[data-md-preview] blockquote {
margin: .6em 0;
padding: .4em 1em;
border-left: 3px solid var(--border-md);
color: var(--text-muted);
}
[data-md-editor][data-state="inactive"],
[data-md-preview][data-state="inactive"] {
display: none;
}
aside {
padding: 12px 16px;
border-top: 1px solid var(--border);
background: var(--bg);
font-size: 12px;
color: var(--text-muted);
flex-shrink: 0;
}
aside h3 {
margin: 0 0 8px;
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: .07em;
color: var(--text-muted);
}
aside ul {
margin: 0;
padding: 0;
list-style: none;
display: flex;
flex-wrap: wrap;
gap: 4px 16px;
}
aside li { color: var(--accent); }