*{margin:0;padding:0;box-sizing:border-box}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;font-size:16px;color:#333;background:#fff;line-height:1.7}
a{color:#1890ff;text-decoration:none}
a:hover{color:#40a9ff}
/* === Sidebar Layout (ant-design Menu inline 风格) === */
.doc-layout{display:flex;min-height:100vh}
.doc-sidebar{width:375px;background:#fff;border-right:1px solid #f0f0f0;position:fixed;top:0;left:0;bottom:0;z-index:100;display:flex;flex-direction:column;box-shadow:2px 0 8px 0 rgba(29,35,41,.05)}
.doc-main{margin-left:375px;flex:1;padding:50px 60px 50px 60px;max-width:none;min-width:0}
/* Logo 区 */
.sidebar-header{padding:18px 24px;border-bottom:1px solid #f0f0f0;flex-shrink:0;height:auto}
.sidebar-header h2{font-size:18px;color:rgba(0,0,0,.85);font-weight:600;line-height:1.4}
.sidebar-header p{font-size:13px;color:rgba(0,0,0,.45);margin-top:6px;font-weight:normal}
/* 菜单容器（可滚动） */
.sidebar-nav{padding:8px 0;flex:1;overflow-y:auto;overflow-x:hidden}
/* 顶级菜单项 / 子菜单项（统一样式，子项额外缩进） */
.sidebar-nav a{display:block;height:40px;line-height:40px;padding:0 16px 0 24px;color:rgba(0,0,0,.65);font-size:14px;border-right:3px solid transparent;transition:color .3s,background .3s,border-color .3s;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar-nav a:hover{color:#1890ff;background:transparent}
.sidebar-nav a.active{color:#1890ff;background:#e6f7ff;border-right-color:#1890ff;font-weight:normal}
/* SubMenu 标题（可折叠分组） */
.nav-group{margin:0}
.nav-group-title{display:flex;justify-content:space-between;align-items:center;height:40px;line-height:40px;padding:0 16px 0 24px;color:rgba(0,0,0,.65);font-size:14px;font-weight:normal;cursor:pointer;user-select:none;transition:color .3s}
.nav-group-title:hover{color:#1890ff}
.nav-group-title>span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nav-arrow{width:6px;height:6px;border-right:1.2px solid currentColor;border-bottom:1.2px solid currentColor;transform:rotate(45deg);transition:transform .3s;margin-right:4px;opacity:.45}
.nav-group.collapsed .nav-arrow{transform:rotate(-45deg)}
.nav-group-items{overflow:hidden;max-height:800px;transition:max-height .3s cubic-bezier(.215,.61,.355,1)}
.nav-group.collapsed .nav-group-items{max-height:0}
/* 子菜单项缩进（一级 24px + 二级 24px = 48px） */
.nav-group-items a{padding-left:48px}
/* 底部链接区 */
.sidebar-links{padding:8px 0;border-top:1px solid #f0f0f0;flex-shrink:0}
.sidebar-links a{display:block;height:36px;line-height:36px;padding:0 24px;font-size:13px;color:rgba(0,0,0,.45);transition:color .3s}
.sidebar-links a:hover{color:#1890ff}
/* === Mobile nav === */
.mobile-header{display:none;position:sticky;top:0;background:#fff;border-bottom:1px solid #f0f0f0;padding:12px 16px;z-index:200;box-shadow:0 1px 4px rgba(0,21,41,.08)}
.mobile-header h2{font-size:15px;display:inline;color:rgba(0,0,0,.85);font-weight:600}
.menu-btn{float:right;background:none;border:1px solid #d9d9d9;border-radius:4px;padding:4px 12px;font-size:12px;color:rgba(0,0,0,.65);cursor:pointer;transition:all .3s}
.menu-btn:hover{color:#1890ff;border-color:#1890ff}
.mobile-nav{display:none;background:#fff;border-bottom:1px solid #f0f0f0;padding:8px 0}
.mobile-nav.show{display:block}
.mobile-nav a{display:block;height:40px;line-height:40px;padding:0 24px;color:rgba(0,0,0,.65);font-size:14px;border-right:3px solid transparent;transition:color .3s,background .3s}
.mobile-nav a.active{color:#1890ff;background:#e6f7ff;border-right-color:#1890ff;font-weight:normal}
.mobile-nav-group-title{padding:0 24px;height:36px;line-height:36px;color:rgba(0,0,0,.45);font-size:13px;font-weight:normal;background:#fafafa}
/* Content */
.api-section{margin-bottom:70px;padding-top:10px}
.api-section h2{font-size:26px;font-weight:600;margin-bottom:10px;padding-bottom:12px;border-bottom:1px solid #f0f0f0}
.api-endpoint{display:flex;align-items:center;margin:14px 0 18px;flex-wrap:wrap;gap:10px}
.method-badge{display:inline-block;padding:4px 12px;border-radius:3px;font-size:13px;font-weight:600;color:#fff;text-transform:uppercase}
.method-post{background:#49cc90}
.method-get{background:#61affe}
.endpoint-url{font-family:"SF Mono",Consolas,"Liberation Mono",Menlo,monospace;font-size:15px;color:#555;background:#f5f5f5;padding:6px 14px;border-radius:3px;word-break:break-all}
.api-desc{color:#666;margin-bottom:22px;line-height:1.85;font-size:13px}
.api-desc code{background:#f5f5f5;padding:2px 6px;border-radius:3px;font-size:14px;color:#e83e8c}
.api-note{background:#fffbe6;border:1px solid #ffe58f;border-radius:4px;padding:12px 16px;margin:14px 0;font-size:13px;color:#d48806}
.api-tip{background:#e6f7ff;border:1px solid #91d5ff;border-radius:4px;padding:12px 16px;margin:14px 0;font-size:15px;color:#096dd9}
/* Tables */
.param-title{font-size:16px;font-weight:600;margin:28px 0 12px;color:#333}
.param-table{width:100%;border-collapse:collapse;margin-bottom:22px;font-size:15px;table-layout:fixed}
.param-table th{background:#fafafa;text-align:left;padding:12px 14px;border:1px solid #f0f0f0;font-weight:500;color:#666;white-space:nowrap;word-wrap:break-word;overflow-wrap:break-word}
.param-table td{padding:12px 14px;border:1px solid #f0f0f0;vertical-align:top;word-wrap:break-word;overflow-wrap:break-word}
/* === 列宽规范（按表头列数自动匹配） ===
 * 参数名列：统一 200px（所有表格一致）
 * 类型列  ：统一 100px（所有表格一致）
 * 必填/验签列：按列数微调
 * 示例值/说明  ：剩余宽度自适应
 */
/* 3列表（响应参数/失败响应/type取值等）：参数名/类型/说明 */
.param-table th:first-child:nth-last-child(3),
.param-table td:first-child:nth-last-child(3){width:200px}
.param-table th:first-child:nth-last-child(3) ~ th:nth-child(2),
.param-table td:first-child:nth-last-child(3) ~ td:nth-child(2){width:100px}
/* 4列表（通知参数）：参数名/类型/示例值/说明 */
.param-table th:first-child:nth-last-child(4),
.param-table td:first-child:nth-last-child(4){width:200px}
.param-table th:first-child:nth-last-child(4) ~ th:nth-child(2),
.param-table td:first-child:nth-last-child(4) ~ td:nth-child(2){width:100px}
/* 5列表（退款查询等请求参数：无验签列）：参数名/必填/类型/示例值/说明 */
.param-table th:first-child:nth-last-child(5),
.param-table td:first-child:nth-last-child(5){width:200px}
.param-table th:first-child:nth-last-child(5) ~ th:nth-child(2),
.param-table td:first-child:nth-last-child(5) ~ td:nth-child(2){width:80px;text-align:center}
.param-table th:first-child:nth-last-child(5) ~ th:nth-child(3),
.param-table td:first-child:nth-last-child(5) ~ td:nth-child(3){width:100px}
/* 6列表（标准请求参数）：参数名/必填/类型/验签/示例值/说明 */
.param-table th:first-child:nth-last-child(6),
.param-table td:first-child:nth-last-child(6){width:200px}
.param-table th:first-child:nth-last-child(6) ~ th:nth-child(2),
.param-table td:first-child:nth-last-child(6) ~ td:nth-child(2){width:80px;text-align:center}
.param-table th:first-child:nth-last-child(6) ~ th:nth-child(3),
.param-table td:first-child:nth-last-child(6) ~ td:nth-child(3){width:100px}
.param-table th:first-child:nth-last-child(6) ~ th:nth-child(4),
.param-table td:first-child:nth-last-child(6) ~ td:nth-child(4){width:80px;text-align:center}
/* 特殊语义表（如 initiatepay 的 type 取值说明）：列宽按内容自适应，覆盖默认固定宽度 */
table.param-table.flex-cols th,
table.param-table.flex-cols td{width:auto!important;text-align:left!important}
.param-table td code{background:#f5f5f5;padding:2px 6px;border-radius:2px;font-size:14px;color:#c41d7f}
.param-table tr:hover td{background:#fafafa}
.required-tag{color:#f5222d;font-weight:500}
.optional-tag{color:#999}
/* 嵌套对象折叠按钮（ant-design Table 风格） */
.param-toggle{display:inline-block;width:17px;height:17px;line-height:13px;text-align:center;border:1px solid #d9d9d9;border-radius:2px;color:rgba(0,0,0,.65);font-size:14px;cursor:pointer;user-select:none;margin-left:8px;background:#fff;transition:all .3s;vertical-align:middle;font-weight:500}
.param-toggle:hover{color:#1890ff;border-color:#1890ff}
.param-child td:first-child{padding-left:34px}
/* 文档/JSON Tabs（ant-design Tabs 风格） */
.param-tabs{display:flex;border-bottom:1px solid #f0f0f0;margin:28px 0 0;font-size:14px}
.param-tab{padding:10px 16px;color:rgba(0,0,0,.65);cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px;transition:color .3s,border-color .3s;user-select:none;display:inline-block;text-decoration:none}
.param-tab:hover{color:#1890ff}
.param-tab.active{color:#1890ff;border-bottom-color:#1890ff;font-weight:500}
.param-tab-pane>.param-title:first-child{margin-top:18px}
/* Code blocks */
.code-block{position:relative;margin:18px 0}
.code-block pre{background:#282c34;color:#abb2bf;padding:18px 22px;border-radius:6px;overflow-x:auto;font-size:14px;line-height:1.75}
.code-block .copy-btn{position:absolute;top:10px;right:10px;background:#3e4451;color:#aaa;border:none;border-radius:3px;padding:5px 12px;font-size:12px;cursor:pointer}
.code-block .copy-btn:hover{color:#fff}
/* Responsive */
@media(max-width:768px){
    .doc-sidebar{display:none}
    .doc-main{margin-left:0;padding:20px 15px;font-size:14px}
    .mobile-header{display:flex;justify-content:space-between;align-items:center}
    body{font-size:14px}
    .api-section h2{font-size:20px}
    .param-title{font-size:16px}
    .param-table{display:block;overflow-x:auto;font-size:13px}
    .code-block pre{font-size:12px}
    .api-endpoint{flex-direction:column;align-items:flex-start}
}
/* === 支付方式弹窗 (Modal) === */
.pt-modal[hidden]{display:none!important}
.pt-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:24px}
.pt-modal-mask{position:absolute;inset:0;background:rgba(0,0,0,.45);animation:ptFade .2s}
.pt-modal-body{position:relative;background:#fff;border-radius:6px;box-shadow:0 4px 24px rgba(0,0,0,.15);max-width:760px;width:100%;max-height:calc(100vh - 48px);display:flex;flex-direction:column;animation:ptZoom .2s}
.pt-modal-close{position:absolute;top:12px;right:14px;width:28px;height:28px;line-height:24px;border:none;background:transparent;color:rgba(0,0,0,.45);font-size:22px;cursor:pointer;border-radius:4px;transition:all .2s;z-index:1}
.pt-modal-close:hover{color:rgba(0,0,0,.85);background:#f5f5f5}
.pt-modal-content{padding:20px 28px 24px;overflow-y:auto}
.pt-modal-content .api-section{margin-bottom:0;padding-top:0}
.pt-modal-content .api-section h2{font-size:18px;margin-bottom:8px;padding-bottom:10px}
.pt-modal-content .api-desc{font-size:14px;margin-bottom:14px}
.pt-modal-content .param-table{font-size:14px;margin-bottom:0}
@keyframes ptFade{from{opacity:0}to{opacity:1}}
@keyframes ptZoom{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}
.paytype-trigger{display:inline-block;margin-left:8px;height:24px;line-height:22px;padding:0 9px;font-size:13px;color:#fff;background:#1890ff;border:1px solid #1890ff;border-radius:3px;cursor:pointer;text-decoration:none;vertical-align:middle;transition:all .2s;font-family:inherit;white-space:nowrap}
.paytype-trigger:hover{color:#fff;border-color:#40a9ff;text-decoration:none;background:#40a9ff}
.paytype-trigger:active{color:#fff;border-color:#096dd9;background:#096dd9}
@media(max-width:768px){
    .pt-modal{padding:12px}
    .pt-modal-content{padding:16px 18px 20px}
}
/* Sign section */
.sign-section{background:#f9f9f9;border:1px solid #eee;border-radius:6px;padding:22px;margin:22px 0}
.sign-section h4{font-size:16px;margin-bottom:12px}
.sign-section ol{padding-left:22px;color:#555;font-size:15px;line-height:2}
/* Version Tabs */
.version-tabs{position:fixed;top:0;right:20px;z-index:300;display:flex;gap:4px;padding:8px 0}
.version-tab{display:inline-block;padding:4px 14px;font-size:12px;font-weight:500;color:#666;background:#f5f5f5;border:1px solid #e8e8e8;border-radius:4px;text-decoration:none;transition:all .2s}
.version-tab:hover{color:#1890ff;border-color:#1890ff;background:#f0f7ff}
.version-tab.active{color:#fff;background:#1890ff;border-color:#1890ff}
.version-badge{display:inline-block;font-size:10px;background:#1890ff;color:#fff;padding:1px 6px;border-radius:3px;vertical-align:middle;margin-left:4px}
@media(max-width:768px){
    .version-tabs{right:auto;left:50%;transform:translateX(-50%);top:auto;bottom:15px;background:#fff;padding:6px 12px;border-radius:20px;box-shadow:0 2px 12px rgba(0,0,0,.15)}
}
