/* 对齐 json-convert / jsonpath 双栏面板风格 */
.json-compare-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    width: 100%;
    height: 46.8vh;
    min-height: 46.8vh;
    max-height: 46.8vh;
    overflow: hidden;
}

.json-compare-panel {
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #efefef;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.json-compare-panel-title {
    padding: 8px 12px;
    font-size: 0.925rem;
    font-weight: 600;
    color: #686868;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    flex-shrink: 0;
}

.json-compare-panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.json-compare-diff-meta {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-left: auto;
    font-size: 0.825rem;
    font-weight: 400;
    color: #888;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}

.json-compare-diff-meta-item {
    white-space: nowrap;
}

.json-compare-editor {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    overflow: hidden;
    background: #fff;
}

.json-compare-gutter {
    padding: 6px 10px 6px 12px;
    border-right: none;
    color: #888;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 22px;
    white-space: pre;
    overflow: hidden;
    user-select: none;
    background: #f6f6f6;
}

.json-compare-editable {
    padding: 6px 10px;
    overflow: auto;
    white-space: pre;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 22px;
    color: #444;
    background: #fff;
    outline: none;
    min-width: 0;
}

.json-compare-editable:focus {
    outline: none;
}

.json-compare-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}

.tool-form-json-compare.fullscreen .form-field {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.tool-form-json-compare.fullscreen .json-compare-split {
    flex: 1;
    height: 100% !important;
    min-height: 0;
    max-height: none;
}

.tool-form-json-compare.fullscreen .json-compare-actions {
    margin-top: 10px;
}

.tool-form-json-compare.fullscreen .json-compare-legend {
    order: 3;
    flex-shrink: 0;
    margin-top: 8px;
}

.json-compare-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px 20px;
    margin-top: 10px;
    font-size: 0.825rem;
    color: #888;
}

.json-compare-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.json-compare-legend-sample {
    display: inline;
    min-width: 0;
    font-family: inherit;
    font-size: 0.825rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    flex-shrink: 0;
}

.json-compare-legend-sample.is-removed,
.json-diff-removed {
    color: red;
    background: transparent;
    font-weight: bold;
}

.json-compare-legend-sample.is-changed,
.json-diff-changed {
    color: orange;
    background: transparent;
    font-weight: bold;
}

.json-compare-legend-sample.is-added,
.json-diff-added {
    color: green;
    background: transparent;
    font-weight: bold;
}

.json-diff-error {
    color: red;
    font-weight: bold;
}

@media screen and (max-width: 768px) {
    .json-compare-split {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
        max-height: none;
    }

    .json-compare-panel {
        min-height: 220px;
        height: auto;
    }

    .json-compare-legend {
        justify-content: flex-start;
        padding-bottom: 2px;
    }
}
