.json-editor-panel-output {
    display: flex;
    flex-direction: column;
}

.json-output-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 2px;
    flex-shrink: 0;
    padding: 4px 0;
}

.json-toolbar-left {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.json-toolbar-fullscreen {
    margin-left: auto;
    flex-shrink: 0;
}

.json-toolbar-icon-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.json-toolbar-icon-btn .fullscreen-img {
    cursor: pointer;
    pointer-events: none;
    float: none;
    margin: 0;
    width: 22px;
    height: 22px;
}

.json-toolbar-icon-btn:hover {
    background: #ececec;
}

.json-toolbar-icon-btn:active {
    background: #e0e0e0;
}

.json-toolbar-icon-btn svg {
    width: 20px;
    height: 20px;
    stroke: #555;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.8;
}

.json-toolbar-icon-btn:hover svg {
    opacity: 1;
}

.json-fold-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.json-sort-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.json-toolbar-icon-btn.is-active {
    background: transparent;
}

.json-toolbar-icon-btn.is-active svg {
    stroke: #1677ff;
    opacity: 1;
}

.json-toolbar-icon-btn.is-active:hover svg {
    stroke: #0958d9;
}

.json-fold-btn-group .json-toolbar-icon-btn svg {
    width: 26px;
    height: 26px;
}

.json-toolbar-icon-btn[data-json-scroll] svg {
    width: 22px;
    height: 22px;
}

.json-toolbar-icon-btn-img {
    padding: 4px;
}

.json-toolbar-hint {
    position: fixed;
    z-index: 10050;
    transform: translate(-50%, -100%);
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.3;
    color: #fff;
    background: rgba(45, 45, 45, 0.94);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.1s ease;
}

.json-toolbar-hint.is-visible {
    opacity: 1;
}

.json-toolbar-hint::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -4px;
    transform: translateX(-50%);
    border-width: 4px 4px 0;
    border-style: solid;
    border-color: rgba(45, 45, 45, 0.94) transparent transparent;
}

.json-output-toolbar .fullscreen-img {
    width: 22px;
    height: 22px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

/* 工具名 + 最大化/收藏 同一行（与下方双栏编辑器等宽对齐） */
.tool-form .tool-header-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 12px;
    /* 与右侧工具栏按钮同高，避免无按钮时标题贴顶 */
    min-height: 32px;
}

.tool-form .tool-header-split .tool-title {
    margin: 0;
    padding-bottom: 0;
    min-width: 0;
}

.tool-form .tool-header-split .tool-title-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.tool-form .tool-title-actions .json-toolbar-fullscreen {
    margin-left: 0;
}

.tool-form .tool-title-actions .json-toolbar-icon-btn-img {
    padding: 0;
}

.tool-form .tool-title.tool-title-with-actions {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    gap: 12px;
    margin: 0 0 12px;
    padding-bottom: 0;
}

.tool-form .tool-title.tool-title-with-actions .tool-name {
    flex: 0 1 auto;
    min-width: 0;
    float: none;
    margin: 0;
}

.tool-form .tool-title.tool-title-with-actions .tool-title-actions {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.tool-form .tool-title-actions .page-collect-wrap-toolbar {
    float: none;
    margin: 0;
}

/* 页面顶部：收藏 + 最大化/最小化（紧凑右对齐，与 JSON 对比一致） */
.tool-form > .json-output-toolbar.tool-top-toolbar,
#container > .json-output-toolbar.tool-top-toolbar {
    justify-content: flex-end;
    padding: 0;
    margin-bottom: 0;
    min-height: 0;
}

.tool-form.fullscreen > .json-output-toolbar.tool-top-toolbar {
    order: 0;
    flex-shrink: 0;
    margin-bottom: 0;
}

.tool-form.fullscreen > .json-output-toolbar.tool-top-toolbar:has(.page-collect-wrap-toolbar) .page-collect-wrap-toolbar {
    margin-left: auto;
}

.tool-form.fullscreen > .json-output-toolbar.tool-top-toolbar:has(.page-collect-wrap-toolbar) .json-toolbar-fullscreen {
    margin-left: 0;
}

#container.tool-container-fullscreen-layout {
    display: flex;
    flex-direction: column;
}

#container.tool-container-fullscreen-layout > .json-output-toolbar.tool-top-toolbar {
    flex-shrink: 0;
}

#container.tool-container-fullscreen-layout > iframe {
    flex: 1;
    min-height: 0;
    width: 100%;
    border: none;
}

#container.tool-container-fullscreen-layout.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    box-sizing: border-box;
    padding: 8px 16px 16px;
}

#container.tool-container-fullscreen-layout.fullscreen > .json-output-toolbar.tool-top-toolbar:has(.page-collect-wrap-toolbar) .page-collect-wrap-toolbar {
    margin-left: auto;
}

#container.tool-container-fullscreen-layout.fullscreen > .json-output-toolbar.tool-top-toolbar:has(.page-collect-wrap-toolbar) .json-toolbar-fullscreen {
    margin-left: 0;
}

.json-editor-panel-output .wd-editor,
.json-editor-panel-output .output-panel {
    flex: 1;
    min-height: 0;
}
