/*!
 * JSON 在线编辑器页样式（独立文件）
 */
.tool-form-json-editor {
    width: 100%;
    box-sizing: border-box;
}

.tool-form-json-editor .tool-header-split {
    margin-bottom: 10px;
}

.tool-form-json-editor .json-online-workspace {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    height: calc(100vh - 210px);
    min-height: 560px;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    box-sizing: border-box;
}

.tool-form-json-editor .json-online-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 6px 10px;
    border-bottom: 1px solid #ececec;
    background: #fff;
}

.tool-form-json-editor .json-online-toolbar-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.tool-form-json-editor .json-online-toolbar-label {
    margin-right: 2px;
    font-size: 12px;
    color: #888;
    user-select: none;
}

.tool-form-json-editor .json-online-btn {
    appearance: none;
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #333;
    border-radius: 4px;
    height: 30px;
    padding: 0 12px;
    font-size: 13px;
    line-height: 28px;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.tool-form-json-editor .json-online-btn:hover {
    border-color: #1677ff;
    color: #1677ff;
}

.tool-form-json-editor .json-online-btn:active {
    background: #f0f7ff;
}

.tool-form-json-editor .json-online-btn.is-primary {
    border-color: #1677ff;
    background: #1677ff;
    color: #fff;
}

.tool-form-json-editor .json-online-btn.is-primary:hover {
    border-color: #0958d9;
    background: #0958d9;
    color: #fff;
}

.tool-form-json-editor .json-online-btn.is-ghost {
    background: transparent;
}

.tool-form-json-editor .json-online-sync-mode {
    display: inline-flex;
    align-items: center;
    height: 30px;
    gap: 10px;
    margin: 0 0 0 auto;
    padding: 0;
    box-sizing: border-box;
    font-size: 13px;
    line-height: 30px;
    color: #1677ff;
    user-select: none;
    vertical-align: middle;
    flex-shrink: 0;
}

.tool-form-json-editor .json-online-sync-mode-label {
    display: inline-flex;
    align-items: center;
    height: 30px;
    color: #1677ff !important;
    font-size: 12px;
    line-height: 30px;
    font-weight: 500;
}

.tool-form-json-editor .json-online-sync-option {
    display: inline-flex;
    align-items: center;
    height: 30px;
    gap: 4px;
    margin: 0;
    padding: 0;
    cursor: pointer;
    white-space: nowrap;
    line-height: 30px;
    color: #1677ff;
}

.tool-form-json-editor .json-online-sync-option input {
    width: 14px;
    height: 14px;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    cursor: pointer;
    flex-shrink: 0;
}

.tool-form-json-editor .json-online-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    color: #999;
    border-color: #e0e0e0;
    background: #f7f7f7;
}

.tool-form-json-editor .json-online-btn:disabled:hover {
    color: #999;
    border-color: #e0e0e0;
}

.tool-form-json-editor .json-online-split {
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
}

.tool-form-json-editor .json-online-pane {
    display: flex;
    flex-direction: column;
    min-width: 180px;
    min-height: 0;
    background: #fff;
}

.tool-form-json-editor .json-online-pane-left {
    flex: 1 1 0;
    width: 0;
}

.tool-form-json-editor .json-online-pane-right {
    flex: 1 1 0;
    width: 0;
}

.tool-form-json-editor .json-online-pane-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex-shrink: 0;
    min-height: 32px;
    padding: 2px 10px;
    border-bottom: 1px solid #ececec;
    background: #fff;
    box-sizing: border-box;
}

.tool-form-json-editor .json-online-pane-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.tool-form-json-editor .json-online-pane-label.is-end {
    margin-left: auto;
}

.tool-form-json-editor .json-online-pane-actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
}

.tool-form-json-editor .json-online-pane-actions.is-end {
    margin-left: auto;
    justify-content: flex-end;
}

.tool-form-json-editor .json-online-pane-actions .json-online-btn {
    height: 26px;
    padding: 0 8px;
    font-size: 12px;
    line-height: 24px;
}

.tool-form-json-editor .json-online-tree-search {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
}

.tool-form-json-editor .json-online-tree-search-count {
    min-width: 0;
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    user-select: none;
}

.tool-form-json-editor .json-online-tree-search-count:empty {
    display: none;
}

.tool-form-json-editor .json-online-tree-search-toggle {
    min-width: 0;
}

.tool-form-json-editor .json-online-tree-search.is-open .json-online-tree-search-toggle {
    display: none;
}

.tool-form-json-editor .json-online-tree-search-box {
    display: none;
    align-items: center;
    height: 24px;
    border: 1px solid #c1c1c1;
    border-radius: 0;
    background: #fff;
    overflow: hidden;
    box-sizing: border-box;
}

.tool-form-json-editor .json-online-tree-search.is-open .json-online-tree-search-box {
    display: inline-flex;
}

.tool-form-json-editor .json-online-tree-search-box:focus-within {
    border-color: #999;
}

.tool-form-json-editor .json-online-tree-search-input {
    width: 88px;
    height: 100%;
    padding: 0 4px;
    border: none;
    background: transparent;
    color: #1a1a1a;
    font-size: 12px;
    line-height: 22px;
    outline: none;
    box-sizing: border-box;
}

.tool-form-json-editor .json-online-tree-search-nav {
    appearance: none;
    width: 16px;
    height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    border-left: none;
    background: transparent;
    color: #666;
    font-size: 8px;
    line-height: 1;
    cursor: pointer;
}

.tool-form-json-editor .json-online-tree-search-nav:hover {
    background: #e6f4ff;
    color: #1677ff;
}

.tool-form-json-editor .json-online-editor-host {
    flex: 1;
    min-height: 0;
    position: relative;
}

.tool-form-json-editor .json-online-pane-left .json-online-editor-host {
    border: none;
}

.tool-form-json-editor .json-online-pane-left .json-online-editor-host .ace_editor {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace !important;
    font-size: 14.8px !important;
    line-height: 20px !important;
}

/* 行号栏背景与 index.html 一致 */
.tool-form-json-editor .json-online-pane-left .ace-chrome .ace_gutter,
.tool-form-json-editor .json-online-pane-left .ace-chrome .ace_gutter-active-line {
    background-color: #f6f6f6;
}

/* 未聚焦时隐藏默认光标，点击编辑后再显示 */
.tool-form-json-editor .json-online-pane-left .ace_editor:not(.ace_focus) .ace_cursor {
    opacity: 0 !important;
}

.tool-form-json-editor .json-online-pane-left .ace_bracket {
    opacity: 0 !important;
    border: none !important;
    background: transparent !important;
}

.tool-form-json-editor .json-online-pane-left .ace_marker-layer .ace_selection {
    background: rgba(45, 130, 255, 0.18) !important;
}

/* ========== 右侧：经典 JSONEditor（BeJSON 同款布局） ========== */
.tool-form-json-editor .json-online-pane-right .json-online-editor-host > .jsoneditor-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none !important;
    box-sizing: border-box;
    color: #1a1a1a;
}

/* 顶部菜单已挪到面板标题栏，隐藏内置菜单 */
.tool-form-json-editor .json-online-pane-right .jsoneditor-menu {
    display: none !important;
}

.tool-form-json-editor .json-online-pane-right .jsoneditor-content-outer {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    height: 100%;
}

.tool-form-json-editor .json-online-pane-right .jsoneditor-content {
    width: 100%;
    height: 100%;
}

/*
 * 覆盖 course.css 的全局 table/td 边框、width:100%、margin，
 * 否则树形会变成「格子表格」，且 key/value 被撑开一大段空白。
 */
.tool-form-json-editor .json-online-pane-right table,
.tool-form-json-editor .json-online-pane-right th,
.tool-form-json-editor .json-online-pane-right td {
    border: none !important;
    border-collapse: collapse;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* 内层树节点表必须自适应内容，不能 100% 撑满 */
.tool-form-json-editor .json-online-pane-right table {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
}

/* 外层主表仍铺满编辑区 */
.tool-form-json-editor .json-online-pane-right table.jsoneditor-table {
    width: 100% !important;
    margin: 0 !important;
    border: none !important;
}

.tool-form-json-editor .json-online-pane-right td.jsoneditor-td {
    padding: 0 3px !important;
    vertical-align: middle;
    background: transparent !important;
}

.tool-form-json-editor .json-online-pane-right td.jsoneditor-td-tree {
    white-space: nowrap;
    vertical-align: middle;
    padding: 0 !important;
}

/* Expand column: always reserve 24px so leaf keys align with object/array keys */
.tool-form-json-editor .json-online-pane-right tr > td.jsoneditor-td-tree:first-child {
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
}

/* Row height 24px (native sprite grid) */
.tool-form-json-editor .json-online-pane-right button.jsoneditor-remove,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-append,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-duplicate,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-collapsed,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-expanded,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-invisible,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-dragarea,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-auto,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-string,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-number,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-boolean,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-null,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-array,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-object {
    float: none !important;
    display: inline-block !important;
    box-sizing: border-box;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    border: none;
    line-height: 0;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-collapsed,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-expanded,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-invisible {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-dragarea {
    width: 16px !important;
    height: 24px !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-remove,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-append,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-duplicate,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-auto,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-string,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-number,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-boolean,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-null,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-array,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-object {
    width: 24px !important;
    height: 24px !important;
}

/*
 * Shared plate icons (same gray / hover blue):
 * 0 string(A) 1 number(12) 2 boolean(B) 3 null 4 array([]) 5 object({})
 * 6 remove 7 duplicate 8 append
 */
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-string,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-number,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-boolean,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-null,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-array,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-object,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-auto,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-remove,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-duplicate,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-append {
    background-image: url("/assets/js/libs/jsoneditor-classic/jsoneditor-type-extra.png?v=20260718ar") !important;
    background-repeat: no-repeat !important;
    background-color: transparent !important;
    border: none !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-string {
    background-position: 0 -24px !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-string:hover {
    background-position: 0 0 !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-number,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-auto {
    background-position: -24px -24px !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-number:hover,
.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-auto:hover {
    background-position: -24px 0 !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-boolean {
    background-position: -48px -24px !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-boolean:hover {
    background-position: -48px 0 !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-null {
    background-position: -72px -24px !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-null:hover {
    background-position: -72px 0 !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-array {
    background-position: -96px -24px !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-array:hover {
    background-position: -96px 0 !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-object {
    background-position: -120px -24px !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-type-object:hover {
    background-position: -120px 0 !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-remove {
    background-position: -144px -24px !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-remove:hover {
    background-position: -144px 0 !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-duplicate {
    background-position: -168px -24px !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-duplicate:hover {
    background-position: -168px 0 !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-append {
    background-position: -192px -24px !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-append:hover {
    background-position: -192px 0 !important;
}

/* Dropdown is appended to body */
div.jsoneditor-option-string,
div.jsoneditor-option-number,
div.jsoneditor-option-boolean,
div.jsoneditor-option-null,
div.jsoneditor-option-array,
div.jsoneditor-option-object,
div.jsoneditor-option-auto {
    float: left;
    width: 24px;
    height: 24px;
    display: inline-block;
    background: url("/assets/js/libs/jsoneditor-classic/jsoneditor-type-extra.png?v=20260718ar") no-repeat !important;
}

div.jsoneditor-option-string {
    background-position: 0 0 !important;
}

div.jsoneditor-option-number,
div.jsoneditor-option-auto {
    background-position: -24px 0 !important;
}

div.jsoneditor-option-boolean {
    background-position: -48px 0 !important;
}

div.jsoneditor-option-null {
    background-position: -72px 0 !important;
}

div.jsoneditor-option-array {
    background-position: -96px 0 !important;
}

div.jsoneditor-option-object {
    background-position: -120px 0 !important;
}

.tool-form-json-editor .json-online-pane-right button.jsoneditor-invisible {
    visibility: hidden !important;
    background: transparent !important;
}

.tool-form-json-editor .json-online-pane-right .jsoneditor-separator {
    vertical-align: middle !important;
    padding: 0 2px !important;
    line-height: 26px;
}

.tool-form-json-editor .json-online-pane-right td.jsoneditor-td-edit {
    background-color: #f5f5f5 !important;
    padding: 0 !important;
    width: 24px;
}

.tool-form-json-editor .json-online-pane-right .jsoneditor-field,
.tool-form-json-editor .json-online-pane-right .jsoneditor-value,
.tool-form-json-editor .json-online-pane-right .jsoneditor-readonly,
.tool-form-json-editor .json-online-pane-right .jsoneditor-td {
    font-family: "droid sans mono", Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 10pt;
}

.tool-form-json-editor .json-online-pane-right .jsoneditor-field,
.tool-form-json-editor .json-online-pane-right .jsoneditor-value,
.tool-form-json-editor .json-online-pane-right .jsoneditor-readonly {
    float: none !important;
    display: inline-block;
    vertical-align: middle;
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
    box-sizing: border-box;
    margin: 0;
    padding: 0 2px;
    min-height: 26px;
    line-height: 26px;
}

.tool-form-json-editor .json-online-pane-right .jsoneditor-value:focus,
.tool-form-json-editor .json-online-pane-right .jsoneditor-field:focus,
.tool-form-json-editor .json-online-pane-right .jsoneditor-value:hover,
.tool-form-json-editor .json-online-pane-right .jsoneditor-field:hover,
.tool-form-json-editor .json-online-pane-right .jsoneditor-search-highlight {
    background-color: #e6f4ff !important;
    border: 1px solid #91caff !important;
    border-radius: 2px;
}

.tool-form-json-editor .json-online-pane-right .jsoneditor-search-highlight-active,
.tool-form-json-editor .json-online-pane-right .jsoneditor-search-highlight-active:focus,
.tool-form-json-editor .json-online-pane-right .jsoneditor-search-highlight-active:hover {
    background-color: #bae0ff !important;
    border: 1px solid #1677ff !important;
}

.tool-form-json-editor .json-online-pane-right tr.jsoneditor-tr-highlight {
    background-color: #e6f4ff !important;
}

.tool-form-json-editor .json-online-pane-right div.jsoneditor-option:hover {
    background-color: #e6f4ff !important;
    color: #1677ff;
}

.tool-form-json-editor .json-online-divider {
    position: relative;
    flex: 0 0 4px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: #ececec;
    border: none;
    user-select: none;
}

.tool-form-json-editor .json-online-divider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -3px;
    right: -3px;
    cursor: col-resize;
    z-index: 1;
}

.tool-form-json-editor .json-online-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    min-height: 32px;
    padding: 0 12px;
    border-top: 1px solid #ececec;
    background: #fafafa;
    font-size: 12px;
    color: #888;
}

.tool-form-json-editor .json-online-statusbar-left,
.tool-form-json-editor .json-online-statusbar-right {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.tool-form-json-editor .json-online-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #bfbfbf;
    flex-shrink: 0;
}

.tool-form-json-editor .json-online-status-dot.is-ok {
    background: #52c41a;
}

.tool-form-json-editor .json-online-status-dot.is-error {
    background: #ff4d4f;
}

.tool-form-json-editor #json-editor-status {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tool-form-json-editor #json-editor-status.is-error {
    color: #cf1322;
}

.tool-form-json-editor #json-editor-status.is-ok {
    color: #389e0d;
}

.tool-form-json-editor .json-online-meta {
    color: #999;
    white-space: nowrap;
}

.tool-form-json-editor.fullscreen .json-online-workspace {
    height: calc(100vh - 72px);
    min-height: 0;
    border-radius: 0;
}

.tool-form-json-editor.fullscreen .tool-info {
    display: none;
}

@media (max-width: 960px) {
    .tool-form-json-editor .json-online-workspace {
        height: auto;
        min-height: 0;
    }

    .tool-form-json-editor .json-online-split {
        flex-direction: column;
    }

    .tool-form-json-editor .json-online-pane-left,
    .tool-form-json-editor .json-online-pane-right {
        width: auto;
        flex: none;
        height: 420px;
    }

    .tool-form-json-editor .json-online-divider {
        flex: 0 0 4px;
        flex-direction: row;
        border: none;
        background: #ececec;
    }

    .tool-form-json-editor .json-online-divider-handle {
        top: -3px;
        bottom: -3px;
        left: 0;
        right: 0;
        cursor: row-resize;
    }
}
