@charset "UTF-8";
/*
 * JSON 格式化工具（/devtools/json.htm）专用样式
 * 布局说明：本页已移除站点顶部导航栏、底部导航栏目、开发工具广告位与“更多工具”列表，
 *           改为工具自身撑满视口的独立应用布局：
 *           顶部工具条 + [历史记录侧栏 | 输入区 / 树形结构区] + 底部版权备案行。
 */

/*=============================== 全局与骨架 ===============================*/
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #f5f7fa;
}

/* 兜底：显示 / 隐藏切换不依赖任何外部框架 */
.hidden {
    display: none !important;
}

.oj_app,
.oj_app * {
    box-sizing: border-box;
}

.oj_app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    font-family: "Inter", "Microsoft YaHei", system-ui, sans-serif;
    color: #1d2129;
    background: #eaeff4;
}

/*=============================== 顶部工具条 ===============================*/
/* 与站点主页导航对齐：白底 + 底部细线 + 深灰文字 + 品牌蓝点缀 */
.oj_toolbar {
    flex: 0 0 auto;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 52px;
    padding: 0 16px;
    color: #333842;
    background: #fff;
    border-bottom: 1px solid #eeeeee;
}
.oj_toolbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.oj_logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 16px;
    border-radius: 8px;
    color: #0989E2;
    background: #f4f7fa;
}
.oj_brand__text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    line-height: 1.25;
}
.oj_brand__text strong {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}
.oj_brand__text span {
    font-size: 11px;
    color: #9aa4b0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 返回“更多工具”快捷入口 */
.oj_back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    height: 26px;
    padding: 0 10px;
    margin-left: 4px;
    font-size: 12px;
    white-space: nowrap;
    text-decoration: none;
    color: #0989E2;
    border: 1px solid #0989E2;
    border-radius: 13px;
    background: transparent;
    transition: background .2s ease-in-out, border-color .2s ease-in-out;
}
.oj_back:hover {
    background: rgba(9,137,226, .08);
    border-color: #0989E2;
}
.oj_back .fa {
    font-size: 12px;
}

.oj_divider {
    flex: 0 0 auto;
    width: 1px;
    height: 20px;
    margin: 0 2px;
    background: #e5e6eb;
}

.oj_toolbar__actions {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
}

.oj_btn,
.oj_icon_btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: none;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    color: #333842;
    border-radius: 6px;
    background: #f4f7fa;
    transition: background .2s ease-in-out, transform .1s ease-in-out;
}
.oj_icon_btn {
    width: 32px;
    padding: 0;
    justify-content: center;
}
.oj_btn:hover,
.oj_icon_btn:hover {
    background: #e9eef5;
}
.oj_btn:active,
.oj_icon_btn:active {
    transform: scale(.94);
}
.oj_btn--primary {
    font-weight: 600;
    color: #fff;
    background: #0989E2;
}
.oj_btn--primary:hover {
    background: #2f5a8c;
}
.oj_btn .fa,
.oj_icon_btn .fa {
    font-size: 13px;
}

/*=============================== 主体容器 ===============================*/
.oj_main {
    position: relative;
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

/*=============================== 左侧历史记录 ===============================*/
.oj_sidebar {
    position: relative;
    flex: 0 0 244px;
    width: 244px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid #e3e8ef;
    overflow: hidden;
    transition: margin-left .22s ease-in-out, transform .22s ease-in-out;
}
.oj_app.oj-sidebar-off .oj_sidebar {
    margin-left: -245px;
}

.oj_sidebar__head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 34px;
    padding: 0 8px 0 12px;
    background: #f7f9fb;
    border-bottom: 1px solid #e3e8ef;
}
.oj_sidebar__title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #4e5969;
    white-space: nowrap;
}
.oj_sidebar__title .fa {
    color: #0989E2;
}
.oj_sidebar__ops {
    display: flex;
    align-items: center;
    gap: 4px;
}
.oj_sidebar__op {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 6px;
    border: none;
    font-size: 12px;
    cursor: pointer;
    color: #4e5969;
    border-radius: 4px;
    background: transparent;
    transition: background .2s ease-in-out, color .2s ease-in-out;
}
.oj_sidebar__op:hover {
    color: #0989E2;
    background: rgba(9,137,226, 0.08);
}
.oj_sidebar__op--icon {
    width: 22px;
    padding: 0;
    justify-content: center;
}

.oj_sidebar__list {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 6px;
}
.oj_sidebar__empty {
    padding: 24px 12px;
    font-size: 12px;
    line-height: 1.8;
    color: #86909c;
    text-align: center;
}

.oj_history__item {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    border: 1px solid #eef1f5;
    border-radius: 6px;
    background: #fff;
    transition: border-color .2s ease-in-out, background .2s ease-in-out;
}
.oj_history__item:hover {
    border-color: #b3cfdd;
    background: #f4f7fa;
}
.oj_history__item.is-active {
    border-color: #0989E2;
    background: #f4f7fa;
}
.oj_history__main {
    flex: 1 1 0;
    min-width: 0;
}
.oj_history__title {
    font-size: 13px;
    font-weight: 600;
    color: #1d2129;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.oj_history__meta {
    margin-top: 3px;
    font-size: 11px;
    color: #86909c;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.oj_history__del {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #86909c;
    border-radius: 4px;
    background: transparent;
    transition: background .2s ease-in-out, color .2s ease-in-out;
}
.oj_history__del:hover {
    color: #f53f3f;
    background: #ffece8;
}

.oj_sidebar__foot {
    flex: 0 0 auto;
    height: 26px;
    line-height: 26px;
    padding: 0 12px;
    font-size: 11px;
    color: #86909c;
    overflow: hidden;
    white-space: nowrap;
    background: #f7f9fb;
    border-top: 1px solid #e3e8ef;
}
.oj_sidebar__foot b {
    color: #4e5969;
}

/*=============================== 工作区 ===============================*/
.oj_workspace {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: stretch;
    background: #eaeff4;
}

.oj_pane {
    flex: 1 1 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
}
#inputPane {
    flex: 0 0 50%;
}

.oj_pane__head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: #4e5969;
    background: #f7f9fb;
    border-bottom: 1px solid #e3e8ef;
}
.oj_pane__head .fa {
    color: #0989E2;
}
.oj_pane__ops {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}
.oj_pane__op {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 8px;
    border: 1px solid #dfe4ea;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    color: #4e5969;
    border-radius: 4px;
    background: #fff;
    transition: background .2s ease-in-out, color .2s ease-in-out, border-color .2s ease-in-out;
}
.oj_pane__op:hover {
    color: #0989E2;
    border-color: #b3cfdd;
    background: #f4f7fa;
}

/* 输入区状态标记 */
.oj_status {
    margin-left: 8px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 400;
    border-radius: 10px;
    white-space: nowrap;
}
.oj_status--ok {
    color: #0f7b3f;
    background: #e3f9ec;
}
.oj_status--error {
    color: #cb2634;
    background: #ffece8;
}

.oj_pane__body {
    flex: 1 1 0;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

/*=============================== 输入编辑区（带行号） ===============================*/
.oj_editor {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: stretch;
    background: #fff;
}
.oj_gutter {
    flex: 0 0 48px;
    overflow: hidden;
    background: #f7f9fb;
    border-right: 1px solid #eef1f5;
    user-select: none;
}
.oj_gutter__inner {
    padding: 14px 10px 14px 0;
    text-align: right;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 21px;
    color: #b7bfcb;
    white-space: pre;
    will-change: transform;
}
#jsonInput {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    padding: 14px 14px 14px 12px;
    border: none;
    outline: none;
    resize: none;
    overflow: auto;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 21px;
    color: #1d2129;
    background: #fff;
    tab-size: 4;
}
#jsonInput::placeholder {
    color: #b7bfcb;
}

/*=============================== 树形展示区 ===============================*/
#jsonOutput {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: auto;
    padding: 14px 16px 14px 30px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 21px;
    color: #1d2129;
    background: #fcfdfe;
}
#jsonOutput .jsonview {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-all;
}
#jsonOutput .jsonview .prop {
    color: #0989E2;
}
#jsonOutput .jsonview .string {
    color: #0f7b3f;
}
#jsonOutput .jsonview .num {
    color: #d9821b;
}
#jsonOutput .jsonview .bool {
    color: #7b3fbf;
}
#jsonOutput .jsonview .null,
#jsonOutput .jsonview .undefined {
    color: #cb2634;
}
#jsonOutput .jsonview .collapser {
    color: #86909c;
}
.oj_placeholder {
    padding: 24px 0;
    font-size: 13px;
    color: #a9aeb8;
    text-align: center;
}

/*=============================== 面板底部状态栏 ===============================*/
.oj_pane__foot {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 28px;
    padding: 0 12px;
    overflow: hidden;
    font-size: 12px;
    background: #f7f9fb;
    border-top: 1px solid #e3e8ef;
}
.oj_pane__count {
    flex: 0 0 auto;
    color: #4e5969;
    white-space: nowrap;
}
.oj_pane__count b {
    color: #0989E2;
    font-weight: 600;
}
.oj_pane__tip {
    flex: 1 1 auto;
    min-width: 0;
    color: #86909c;
    text-align: right;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.oj_pane__tip--error {
    color: #cb2634;
}

/*=============================== 可拖拽分隔条 ===============================*/
.oj_splitter {
    flex: 0 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: col-resize;
    background: #dfe4ea;
    transition: background .2s ease-in-out;
}
.oj_splitter:hover,
body.oj_dragging .oj_splitter {
    background: #0989E2;
}
.oj_splitter span {
    width: 2px;
    height: 26px;
    border-radius: 2px;
    background: #b7bfcb;
}
body.oj_dragging {
    user-select: none;
    cursor: col-resize;
}
body.oj_dragging * {
    cursor: col-resize !important;
}

/*=============================== 版权 / 备案行 ===============================*/
.oj_copyright {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    min-height: 32px;
    padding: 6px 16px;
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
    color: #86909c !important;
    background: #fff;
    border-top: 1px solid #e3e8ef;
}
.oj_copyright a {
    color: #86909c !important;
    text-decoration: none;
}
.oj_copyright a:hover {
    color: #0989E2 !important;
}

/*=============================== 轻提示 ===============================*/
.oj_toast {
    position: fixed;
    top: 64px;
    left: 50%;
    z-index: 999;
    padding: 8px 16px;
    font-size: 13px;
    color: #fff;
    border-radius: 6px;
    background: rgba(29, 33, 41, .9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -8px);
    transition: opacity .22s ease-in-out, transform .22s ease-in-out;
}
.oj_toast--show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/*=============================== JSON 语法知识弹窗 ===============================*/
.oj_modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(29, 33, 41, .55);
}
.oj_modal[hidden] {
    display: none !important;
}
.oj_modal__panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 980px;
    max-height: 88vh;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .24);
}
.oj_modal__head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 16px;
    font-size: 15px;
    font-weight: 600;
    color: #1d2129;
    border-bottom: 1px solid #e3e8ef;
}
.oj_modal__head .fa {
    color: #0989E2;
}
.oj_modal__close {
    margin-left: auto;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 15px;
    color: #86909c;
    border-radius: 6px;
    background: transparent;
    transition: background .2s ease-in-out, color .2s ease-in-out;
}
.oj_modal__close:hover {
    color: #1d2129;
    background: #f2f4f7;
}
.oj_modal__body {
    /* 面板是自动高度（仅受 max-height 限制），这里必须用 auto 基准，
       否则 flex-basis 为 0 时正文会被压成 0 高度，内容完全看不见 */
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(88vh - 110px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px 24px 24px;
}
.oj_modal__foot {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    padding: 12px 16px;
    border-top: 1px solid #e3e8ef;
    background: #f7f9fb;
}
.oj_modal__foot .oj_btn--primary {
    border: none;
}

/* 弹窗内容排版 */
.oj_doc {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}
.oj_doc__col {
    flex: 1 1 320px;
    min-width: 0;
}
.oj_doc h4 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1d2129;
}
.oj_doc h4:not(:first-child) {
    margin-top: 20px;
}
.oj_doc p {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.85;
    color: #4e5969;
}
.oj_doc ul {
    margin: 0;
    padding-left: 18px;
}
.oj_doc li {
    font-size: 13px;
    line-height: 1.9;
    color: #4e5969;
}
.oj_doc code {
    padding: 1px 5px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    color: #0989E2;
    border-radius: 4px;
    background: rgba(9,137,226, 0.08);
}
.oj_doc__type {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.8;
    color: #4e5969;
}
.oj_doc__type b {
    flex: 0 0 auto;
    font-weight: 600;
}
.oj_doc__pre {
    margin: 0;
    padding: 12px 14px;
    overflow-x: auto;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12.5px;
    line-height: 1.7;
    color: #e6edf3;
    border-radius: 8px;
    background: #1d2129;
}

/*=============================== 小屏适配 ===============================*/
@media screen and (max-width: 1366px) {
    .oj_brand__text span {
        display: none;
    }
}
@media screen and (max-width: 1200px) {
    .oj_btn {
        padding: 0 9px;
    }
    .oj_btn span {
        display: none;
    }
}

@media screen and (max-width: 1023px) {
    html, body {
        height: auto;
        overflow: auto;
    }
    .oj_app {
        height: auto;
        min-height: 100vh;
    }
    .oj_toolbar {
        height: auto;
        padding: 8px 12px;
        flex-wrap: wrap;
    }
    .oj_toolbar__actions {
        flex-wrap: wrap;
    }
    .oj_main {
        display: block;
        overflow: visible;
        min-height: 0;
    }
    /* 侧栏在小屏改为浮层，收起时移出屏幕 */
    .oj_sidebar {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 35;
        box-shadow: 2px 0 10px rgba(0, 0, 0, .18);
    }
    .oj_app.oj-sidebar-off .oj_sidebar {
        margin-left: 0;
        transform: translateX(-100%);
    }
    .oj_workspace {
        flex-direction: column;
    }
    .oj_splitter {
        display: none;
    }
    .oj_pane,
    #inputPane {
        flex: 1 1 auto;
    }
    .oj_pane__body {
        flex: 0 0 auto;
        height: 60vh;
    }
    .oj_pane__foot {
        height: auto;
        padding: 6px 12px;
        flex-wrap: wrap;
    }
    .oj_pane__tip {
        text-align: left;
        white-space: normal;
    }
    .oj_modal {
        padding: 12px;
    }
    .oj_modal__panel {
        max-height: 92vh;
    }
    .oj_modal__body {
        max-height: calc(92vh - 110px);
    }
}
