/* 挂载前隐藏目标 textarea，避免闪一下 */
textarea.form-textarea,
textarea.form-textarea-1-row,
textarea.form-textarea-4-row,
textarea.form-textarea-16-row,
textarea.single-calc-textarea,
textarea.pwd-result,
textarea.excel-manual-fields {
    visibility: hidden;
}

body.cm-text-ready textarea.form-textarea,
body.cm-text-ready textarea.form-textarea-1-row,
body.cm-text-ready textarea.form-textarea-4-row,
body.cm-text-ready textarea.form-textarea-16-row,
body.cm-text-ready textarea.single-calc-textarea,
body.cm-text-ready textarea.pwd-result,
body.cm-text-ready textarea.excel-manual-fields {
    visibility: visible;
}

/*
 * CodeMirror text 宿主：与 simplified-traditional-converter.css 的 .st-editor-host 一致
 */
.main-three-part-grid-container .form-field .st-editor-host,
.main-three-part-grid-container .st-editor-host,
.st-editor-host {
    height: 240px;
    min-height: 240px;
    padding: 0;
    border: 1px solid #efefef;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    resize: none;
}

.main-three-part-grid-container .form-field .st-editor-host:focus-within,
.st-editor-host:focus-within {
    border-color: #efefef;
    outline: none;
}

.st-editor-host .cm-editor {
    height: 100% !important;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    outline: none;
    background: #fff;
}

.st-editor-host .cm-scroller {
    overflow: auto;
    font-family: var(--font-mono, Menlo, Monaco, "Courier New", monospace);
}

.st-editor-host .cm-gutters {
    background-color: #f6f6f6;
    border-right: none;
}

.st-editor-host .cm-placeholder {
    color: var(--placeholder-color, #aaa);
    font-size: var(--placeholder-font-size, 0.875rem);
}

/* 单行结果（原 form-textarea-1-row） */
.main-three-part-grid-container .form-field .st-editor-host.st-editor-host-oneline,
.st-editor-host.st-editor-host-oneline {
    height: 36px;
    min-height: 36px;
}

/* 四行模板区（原 form-textarea-4-row） */
.main-three-part-grid-container .form-field .st-editor-host.st-editor-host-4row,
.st-editor-host.st-editor-host-4row {
    height: 120px;
    min-height: 120px;
}

.form-field > .st-editor-host {
    display: flex;
}

/* 与简繁转换页相同的按钮区间距 */
.tool-form .form-field + .form-btn {
    margin-top: 10px;
}

.tool-form .form-btn + .form-field {
    margin-top: 10px;
}

.tool-form.fullscreen .st-editor-host {
    flex: 1;
    min-height: 0;
    height: 100% !important;
}
