/* 开发文档布局样式（配合 easydoc.css 的 markdown 正文样式使用） */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    overflow-x: clip;
}

body.dx-body {
    background: #eef1f6;
    color: #1f2d3d;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    padding-top: 60px;
    -webkit-font-smoothing: antialiased;
}

body.dx-lock {
    overflow: hidden;
}

/* ============ 顶部导航（始终吸顶） ============ */
.dx-header {
    background: #fff;
    border-bottom: 1px solid #e6ebf3;
    box-shadow: 0 2px 10px rgba(16, 34, 61, .05);
    height: 60px;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 100;
}

.dx-header-inner {
    align-items: center;
    display: flex;
    gap: 16px;
    height: 60px;
    margin: 0 auto;
    max-width: 1400px;
    padding: 0 24px;
}

.dx-logo {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
    text-decoration: none;
}

.dx-logo img {
    display: block;
    height: 26px;
    max-width: 150px;
    object-fit: contain;
}

.dx-logo .dx-site {
    color: #1f2d3d;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.dx-version {
    background: #f2f5f9;
    border-radius: 10px;
    display: flex;
    flex: 0 0 auto;
    gap: 2px;
    margin-left: auto;
    padding: 3px;
}

.dx-version a {
    border-radius: 8px;
    color: #5c6b7d;
    font-size: 13px;
    line-height: 1;
    padding: 7px 16px;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
}

.dx-version a:hover {
    color: #2b6cf6;
}

.dx-version a.active {
    background: #fff;
    box-shadow: 0 1px 4px rgba(16, 34, 61, .12);
    color: #2b6cf6;
    font-weight: 600;
}

.dx-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
}

.dx-home {
    color: #8a97a6;
    font-size: 13px;
    padding: 6px 8px;
    text-decoration: none;
    white-space: nowrap;
}

.dx-home:hover {
    color: #2b6cf6;
}

.dx-menu-btn {
    background: none;
    border: 0;
    cursor: pointer;
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px 6px;
}

.dx-menu-btn span {
    background: #4a5568;
    border-radius: 2px;
    display: block;
    height: 2px;
    width: 18px;
}

/* ============ 主体：左侧目录卡片 + 右侧内容卡片 ============ */
.dx-layout {
    align-items: flex-start;
    display: flex;
    gap: 20px;
    margin: 0 auto;
    max-width: 1400px;
    min-height: calc(100vh - 60px);
    padding: 20px 24px 60px;
}

.dx-sidebar {
    background: #fff;
    border: 1px solid #e6ebf3;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(16, 34, 61, .05);
    flex: 0 0 264px;
    height: calc(100vh - 100px);
    overflow-y: auto;
    overscroll-behavior: contain;
    position: sticky;
    top: 80px;
    width: 264px;
}

.dx-sidebar-head {
    align-items: center;
    border-bottom: 1px solid #f0f3f7;
    display: flex;
    gap: 8px;
    padding: 18px 20px 14px;
}

.dx-sidebar-tag {
    background: #2b6cf6;
    border-radius: 5px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    line-height: 1;
    padding: 4px 6px;
}

.dx-sidebar-title {
    color: #1f2d3d;
    font-size: 14px;
    font-weight: 600;
}

.dx-nav {
    padding: 10px 12px 24px;
}

.dx-nav-group {
    color: #98a4b3;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    padding: 14px 10px 6px;
}

.dx-nav-item {
    border-radius: 8px;
    color: #4a5568;
    display: block;
    font-size: 13.5px;
    line-height: 1.4;
    margin: 1px 0;
    overflow: hidden;
    padding: 8px 12px;
    position: relative;
    text-decoration: none;
    text-overflow: ellipsis;
    transition: background .15s, color .15s;
    white-space: nowrap;
}

.dx-nav-item:hover {
    background: #f5f8ff;
    color: #2b6cf6;
}

.dx-nav-item.active {
    background: #eaf1ff;
    color: #2b6cf6;
    font-weight: 600;
}

.dx-nav-item.active::before {
    background: #2b6cf6;
    border-radius: 0 2px 2px 0;
    bottom: 8px;
    content: "";
    left: 0;
    position: absolute;
    top: 8px;
    width: 3px;
}

.dx-nav-sub {
    padding-left: 22px;
}

/* 右侧内容卡片 */
.dx-main {
    -webkit-box-flex: 1;
    background: #fff;
    border: 1px solid #e6ebf3;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(16, 34, 61, .05);
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: hidden;
}

.dx-article {
    margin: 0 auto;
    max-width: 900px;
    padding: 34px 40px 64px;
}

.dx-markdown {
    max-width: 100%;
}

/* 仅表格（参数表单）自身可左右滑动 */
.dx-table-wrap {
    -webkit-overflow-scrolling: touch;
    margin: 14px 0;
    max-width: 100%;
    overflow-x: auto;
}

.dx-table-wrap table {
    display: table !important;
    margin: 0 !important;
    min-width: 100%;
    overflow: visible !important;
    table-layout: auto;
    width: auto;
}

/* 表格内容单行显示，超出部分由外层横向滑动查看 */
.dx-table-wrap table th,
.dx-table-wrap table td {
    white-space: nowrap;
    word-break: keep-all;
}

/* ============ JSON 返回示例美化 ============ */
/* 代码块统一外观（easydoc 默认 pre>code 无背景无内边距，这里补齐） */
.dx-markdown pre {
    background-color: #f6f8fa;
    border-radius: 6px;
    margin: 14px 0;
    overflow-x: auto;
    padding: 12px 16px;
}

.dx-markdown pre code {
    background: transparent !important;
    display: block;
    font-size: 13px;
    line-height: 1.6;
    padding: 0;
    white-space: pre;
}

/* JSON 语法高亮配色：属性名深海军蓝、字符串红色、数字蓝绿、布尔/常量蓝色 */
.dx-markdown pre code.json .token.property,
.dx-markdown pre code.language-json .token.property {
    color: #0b3e91;
}

.dx-markdown pre code.json .token.string,
.dx-markdown pre code.language-json .token.string {
    color: #d14;
}

.dx-markdown pre code.json .token.number,
.dx-markdown pre code.language-json .token.number {
    color: #008080;
}

.dx-markdown pre code.json .token.boolean,
.dx-markdown pre code.language-json .token.boolean {
    color: #0086b3;
}

/* 正文标题锚点不显示链接样式 */
.dx-markdown h1>a,
.dx-markdown h2>a,
.dx-markdown h3>a,
.dx-markdown h4>a,
.dx-markdown h5>a {
    color: inherit !important;
    font-weight: inherit !important;
    text-decoration: none !important;
}

.dx-markdown h1>a:hover,
.dx-markdown h2>a:hover,
.dx-markdown h3>a:hover,
.dx-markdown h4>a:hover {
    color: #2b6cf6 !important;
}

.dx-markdown img {
    max-width: 100%;
}

/* 跳转定位时避开固定导航 */
.dx-markdown h1,
.dx-markdown h2,
.dx-markdown h3,
.dx-markdown h4 {
    scroll-margin-top: 78px;
}

/* 合并后的接口章节分隔 */
.dx-markdown>h1:not(:first-child) {
    border-top: 1px solid #eef1f6;
    margin-top: 38px;
    padding-top: 34px;
}

/* ============ 遮罩与返回顶部 ============ */
.dx-mask {
    background: rgba(15, 27, 45, .5);
    bottom: 0;
    display: none;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 90;
}

.dx-mask.show {
    display: block;
}

.dx-backtop {
    align-items: center;
    background: linear-gradient(180deg, #4e86ff, #2b6cf6);
    border: 0;
    border-radius: 50%;
    bottom: 32px;
    box-shadow: 0 6px 16px rgba(43, 108, 246, .35);
    color: #fff;
    cursor: pointer;
    display: none;
    font-size: 18px;
    height: 42px;
    justify-content: center;
    position: fixed;
    right: 32px;
    width: 42px;
    z-index: 80;
}

.dx-backtop.show {
    display: flex;
}

/* ============ 移动端 ============ */
@media (max-width: 900px) {
    body.dx-body {
        padding-top: 56px;
    }

    .dx-header {
        height: 56px;
    }

    .dx-header-inner {
        gap: 10px;
        height: 56px;
        padding: 0 14px;
    }

    .dx-logo .dx-site {
        display: none;
    }

    .dx-logo {
        min-width: 0;
        overflow: hidden;
    }

    .dx-logo img {
        height: 24px;
        max-width: 108px;
    }

    .dx-menu-btn {
        display: flex;
        order: -1;
    }

    .dx-version {
        margin-left: 0;
    }

    .dx-version a {
        font-size: 12.5px;
        padding: 7px 11px;
    }

    .dx-home {
        display: none;
    }

    .dx-actions {
        margin-left: auto;
    }

    .dx-layout {
        display: block;
        min-height: calc(100vh - 56px);
        padding: 12px;
    }

    .dx-sidebar {
        border-radius: 0 14px 14px 0;
        bottom: 0;
        box-shadow: 10px 0 40px rgba(16, 34, 61, .18);
        height: calc(100vh - 56px);
        left: 0;
        max-width: 320px;
        position: fixed;
        top: 56px;
        transform: translateX(-102%);
        transition: transform .25s ease;
        width: 82%;
        z-index: 95;
    }

    .dx-sidebar.open {
        transform: translateX(0);
    }

    .dx-sidebar-head {
        padding-top: 20px;
    }

    .dx-main {
        border-radius: 12px;
    }

    .dx-article {
        padding: 22px 16px 48px;
    }

    .dx-markdown h1,
    .dx-markdown h2,
    .dx-markdown h3,
    .dx-markdown h4 {
        scroll-margin-top: 68px;
    }

    .dx-backtop {
        bottom: 20px;
        right: 18px;
    }
}

@media (max-width: 480px) {
    .dx-header-inner {
        gap: 8px;
    }

    .dx-logo img {
        height: 22px;
        max-width: 88px;
    }

    .dx-version a {
        font-size: 11.5px;
        padding: 6px 8px;
    }

    .dx-article {
        padding: 18px 14px 44px;
    }
}
