/* 在线链接服务仅供平台体验和调试使用，平台不承诺服务的稳定性，企业客户需下载字体包自行发布使用并做好备份。 */
@font-face {
  font-family: 'iconfont';  /* Project id 549174 */
  src: url('//at.alicdn.com/t/c/font_549174_3m57pi94p06.woff2?t=1762795109141') format('woff2'),
       url('//at.alicdn.com/t/c/font_549174_3m57pi94p06.woff?t=1762795109141') format('woff'),
       url('//at.alicdn.com/t/c/font_549174_3m57pi94p06.ttf?t=1762795109141') format('truetype');
}

* {
    box-sizing: border-box;
}

body {
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
	font-family: 'iconfont';
}

.container {
    display: flex;
    flex-direction: column;
    padding: 0 20px;
    height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
pre{
    background: black;
    color: limegreen;
    padding: 0.5em 0.75em;
}

table{
    border-collapse: collapse;
    text-align: center;
}

table th, table td{
    padding: 0.5em;
    border: 1px solid gray;
}

.editor-container {
    display: flex;
    gap: 20px;
}

.editor-section, .preview-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    position: relative;
    height: calc(100vh - 7em);
}
.editor-section:before, .preview-section:before {
    content: "输入区";
    position: absolute;
    transform: translate(1em, -50%);
    background: black;
    color: white;
    padding: 0 .5em;
}
.preview-section:before{
    content: "预览区";
}

.editor-section{
    border: 1px dashed;
}
.preview-section{
    border: 1px solid;
    background: #eee;
}

#editor {
    border: none;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    max-height: none;
}

.preview {
    /* 使用浏览器默认样式，不添加任何自定义样式 */
}

#editor, .preview{
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* 当前对应的语法元素高亮样式 */
.preview .highlight {
    background-color: white;
}
.preview img{
    max-width: 50%;
    background: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .editor-container {
        flex-direction: column;
    }
    .editor-section, .preview-section {
        height: calc(50vh - 5em);
        flex: auto;
    }
    .header {
        flex-direction: column;
        align-items: center;
    }
}