/* 仅首页 index.html：编辑器铺满视口，左右两个独立面板 */

body.page-json-home {
    overflow-x: hidden;
}

body.page-json-home #page-sidebar,
body.page-json-home .page-sidebar {
    display: none !important;
}

/* 首页不走通用 tool-header-split，最大化在右侧输出区工具栏 */
body.page-json-home .tool-form-json > .tool-header-split {
    display: none;
}

body.page-json-home .json-editor-fullbleed .json-output-toolbar .json-toolbar-fullscreen {
    margin-left: auto;
}

body.page-json-home .my-class {
    padding-bottom: 0;
}

body.page-json-home .my-class > .tool-info {
    display: none;
}

body.page-json-home .my-class > .content {
    margin-bottom: 0;
}

body.page-json-home .tool-form-json {
    margin-bottom: 0;
}

body.page-json-home .json-editor-fullbleed {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    box-sizing: border-box;
}

body.page-json-home .json-editor-fullbleed .form-field {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

body.page-json-home .json-editor-fullbleed #container.json-editor-workspace {
    --json-home-editor-gap-top: 18px;
    --json-home-editor-gap-bottom: 0px;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: calc(
        100dvh - var(--json-home-editor-top, 44px) -
        var(--json-home-editor-gap-top) - var(--json-home-editor-gap-bottom)
    );
    min-height: 320px;
    padding: var(--json-home-editor-gap-top) 12px var(--json-home-editor-gap-bottom);
    box-sizing: border-box;
}

body.page-json-home .json-editor-split {
    height: auto !important;
}

body.page-json-home .json-editor-fullbleed .json-editor-workspace > .json-editor-split {
    flex: 1 1 auto;
    min-height: 0;
    height: 100% !important;
    gap: 12px;
    padding: 0;
    align-items: stretch;
}

body.page-json-home .json-editor-fullbleed .json-editor-panel-input {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    min-height: 0;
    align-self: stretch;
}

body.page-json-home .json-editor-fullbleed .json-editor-panel-output {
    min-height: 0;
}

body.page-json-home .json-editor-fullbleed .json-editor-panel-output > .json-output-toolbar {
    flex-shrink: 0;
    min-height: 40px;
    padding-right: 4px;
    margin-bottom: 2px;
    box-sizing: border-box;
}

body.page-json-home .json-editor-fullbleed #input-editor-host {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    background: #fff;
    border: 1px solid #d8d8d8;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

body.page-json-home .json-editor-fullbleed #input-editor-host .ln-textarea,
body.page-json-home .json-editor-fullbleed #input-editor-host .cm-editor {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

body.page-json-home .json-editor-fullbleed .json-editor-panel-output .wd-editor,
body.page-json-home .json-editor-fullbleed .json-editor-panel-output .output-panel {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
}

/* 全屏：fullbleed 必须参与 tool-form 的 flex 撑高 */
body.page-json-home .tool-form-json.fullscreen .json-editor-fullbleed {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

body.page-json-home .tool-form-json.fullscreen .json-editor-fullbleed .form-field {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

body.page-json-home .tool-form-json.fullscreen #container.json-editor-workspace {
    flex: 1 1 0;
    height: auto !important;
    min-height: 0;
    --json-home-editor-gap-top: 8px;
    --json-home-editor-gap-bottom: 0px;
    padding: var(--json-home-editor-gap-top) 0 var(--json-home-editor-gap-bottom);
}

body.page-json-home .tool-form-json.fullscreen #container.json-editor-workspace > .json-editor-split {
    flex: 1 1 0;
    min-height: 0;
    height: 100% !important;
    flex-direction: row;
}

@media screen and (max-width: 640px) {
    body.page-json-home .json-editor-fullbleed #container.json-editor-workspace {
        --json-home-editor-gap-top: 8px;
        --json-home-editor-gap-bottom: 0px;
        min-height: 280px;
        padding-left: 8px;
        padding-right: 8px;
    }

    body.page-json-home .json-editor-fullbleed .json-editor-workspace > .json-editor-split {
        gap: 8px;
    }
}
