/* API 接口详情页样式 */

.api-detail-hero {
    background: #fff;
    border-bottom: 1px solid #e8ecf0;
    padding: 30px 0 24px;
    margin-bottom: 30px;
}
.api-detail-hero .back-link {
    display: inline-block;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 14px;
}
.api-detail-hero .back-link:hover { color: var(--primary); }
.api-detail-hero .hero-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}
.api-detail-hero .hero-header h3 i { margin-right: 6px; }
.api-detail-hero .hero-meta {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 0.92rem;
}
.api-detail-hero .hero-meta .endpoint-label i,
.api-detail-hero .hero-meta .cost-label i {
    margin-right: 4px;
}
.api-detail-hero .hero-meta .endpoint-label {
    color: #495057;
}
.api-detail-hero .hero-meta .cost-label {
    color: var(--primary);
    font-weight: 600;
}

.doc-section {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}
.doc-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8ecf0;
}
.doc-section pre {
    background: #f5f6fa;
    padding: 16px;
    border-radius: 6px;
    font-size: 0.88rem;
    overflow-x: auto;
    margin-bottom: 0;
}
.doc-section code { font-size: 0.88rem; }

/* ========== VS Code 风格代码窗口 ========== */
.code-window {
    border-radius: 12px;
    overflow: hidden;
    background: #1e1e2e;
    box-shadow: 0 8px 30px rgba(0,0,0,.2);
    border: 1px solid #333;
    margin-bottom: 20px;
}
.code-title-bar {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #2c2c3e;
    border-bottom: 1px solid #3a3a4a;
}
.window-dots {
    display: flex;
    gap: 7px;
    margin-right: 16px;
}
.window-dots span {
    width: 11px; height: 11px;
    border-radius: 50%;
    transition: transform .15s;
}
.window-dots span:hover { transform: scale(1.2); }
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }
.code-filename {
    font-size: .78rem;
    color: #8b8fa3;
    flex: 1;
}
.copy-code-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,.1);
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: .75rem;
    color: #8b8fa3;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.copy-code-btn:hover {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.2);
    color: #e2e6ed;
}
/* 语言 Tab（代码窗口内部） */
.code-lang-tabs {
    display: flex;
    background: #252536;
    border-bottom: 1px solid #3a3a4a;
}
.code-lang-tab {
    padding: 8px 18px;
    font-size: .82rem;
    color: #8b8fa3;
    cursor: pointer;
    transition: all .2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.code-lang-tab:hover { color: #ccc; background: rgba(255,255,255,.03); }
.code-lang-tab.active {
    background: #1e1e2e;
    color: #fff;
    border-bottom-color: #007acc;
}
/* 代码面板 */
.code-panel {
    display: none;
    padding: 18px 20px;
    overflow-x: auto;
}
.code-panel.active { display: block; }
.code-panel pre {
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
}
.code-panel pre code {
    font-size: .85rem;
    line-height: 1.8;
    color: #d4d4d4;
    background: none;
    padding: 0;
    font-family: 'Fira Code', 'SF Mono', 'Cascadia Code', Consolas, monospace;
}
/* 保留 .code-block-wrap 用于调试结果等其他场景 */
.code-block-wrap {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #1e2028;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
}
.code-block-wrap pre {
    border: none;
    border-radius: 0;
    margin: 0;
    background: #1e2028;
    color: #e2e6ed;
    padding: 20px;
    overflow-x: auto;
}
.code-block-wrap pre code {
    font-size: .85rem;
    line-height: 1.8;
    color: #e2e6ed;
    background: none;
    padding: 0;
    font-family: 'Fira Code', 'SF Mono', 'Cascadia Code', Consolas, monospace;
}

.endpoint-box {
    display: flex;
    align-items: center;
    background: #f5f6fa;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
}
.endpoint-box .http-badge {
    background: #27ae60; color: #fff;
    padding: 3px 12px; border-radius: 4px;
    font-weight: 600; font-size: 0.8rem;
    margin-right: 12px;
}
.endpoint-box .url {
    font-family: monospace;
    font-size: 0.95rem;
    color: #333;
}
.copy-btn {
    margin-left: auto;
    background: #e8ecf0;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}
.copy-btn:hover { background: #d1d7e0; }

/* ========== TAB 导航（pill 风格） ========== */
.api-tabs { margin-bottom: 20px; }
.api-tabs .tabs-nav {
    display: flex;
    flex-wrap: wrap;
    border-radius: 10px;
    background: #f0f2f5;
    padding: 4px;
    gap: 0;
    margin-bottom: 0;
}
.api-tabs .tabs-nav .tab-link {
    flex: 1 1 auto;
    text-align: center;
    padding: 10px 18px;
    font-size: .88rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    background: transparent;
    white-space: nowrap;
    transition: all .2s ease;
}
.api-tabs .tabs-nav .tab-link:hover {
    color: #374151;
    background: rgba(255,255,255,.5);
}
.api-tabs .tabs-nav .tab-link.active {
    color: #111827;
    font-weight: 600;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.api-tabs .tab-panel { display: none; padding-top: 20px; }
.api-tabs .tab-panel.active { display: block; }

/* ========== 接口信息卡片 ========== */
.doc-info-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}
.doc-info-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.doc-info-title {
    font-size: .95rem;
    font-weight: 700;
    color: #1a1a2e;
}
.doc-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.doc-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.doc-info-label {
    font-size: .75rem;
    font-weight: 500;
    color: #9ca3af;
}
.doc-info-value {
    font-size: .88rem;
    color: #374151;
}
.doc-info-value code {
    font-size: .82rem;
    background: #f5f7fb;
    padding: 4px 10px;
    border-radius: 6px;
    word-break: break-all;
    display: inline-block;
}
.http-method-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: .74rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .2px;
}
.http-method-badge.get  { background: #27ae60; }
.http-method-badge.post { background: #f39c12; }

/* ========== 参数列表（卡片风格） ========== */
.doc-section-label {
    font-size: .92rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 24px 0 12px;
}
.doc-param-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
}
.doc-param-item {
    background: #fff;
    padding: 12px 18px;
}
.doc-param-item + .doc-param-item { border-top: 1px solid #f8f8f8; }
.doc-param-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}
.doc-param-indent {
    display: inline-block;
    flex-shrink: 0;
    position: relative;
}
.doc-param-indent::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #e5e7eb;
}
.doc-param-name {
    font-size: .85rem;
    font-weight: 600;
    color: #374151;
    background: #f5f7fb;
    padding: 2px 8px;
    border-radius: 4px;
}
.doc-param-type {
    font-size: .72rem;
    font-weight: 500;
    color: #1E78FF;
    background: rgba(30,120,255,.06);
    padding: 2px 8px;
    border-radius: 4px;
}
.doc-param-req {
    font-size: .7rem;
    font-weight: 600;
    color: #ef4444;
    background: rgba(239,68,68,.06);
    padding: 2px 6px;
    border-radius: 4px;
}
.doc-param-desc {
    font-size: .82rem;
    color: #6b7280;
    line-height: 1.5;
}

/* ========== 错误码 ========== */
.error-code-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.error-code-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.error-code-list li:last-child { border-bottom: none; }
.error-code-list .ec-code {
    min-width: 44px;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: .8rem;
    font-weight: 600;
    text-align: center;
}
.ec-code.ec-ok { background: #f6ffed; color: #52c41a; }
.ec-code.ec-err { background: #fff2f0; color: #f5222d; }
.error-code-list .ec-desc {
    font-size: .88rem;
    color: #333;
    line-height: 1.6;
}

/* ========== 在线调试（重构版） ========== */
/* 文档信息摘要 */
.debug-info-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}
.debug-info-item {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #fbfdff);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}
.debug-info-item span {
    display: block;
    margin-bottom: 4px;
    color: #8a94a6;
    font-size: .75rem;
    font-weight: 600;
}
.debug-info-item strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #172033;
    font-size: .85rem;
    line-height: 1.4;
    font-family: 'Fira Code', 'SF Mono', Consolas, monospace;
}

.debug-send-btn {
    height: 36px;
    min-width: 92px;
    padding: 0 18px;
    border: none;
    border-radius: 8px;
    background: #1E78FF;
    color: #fff;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    justify-content: center;
}
.debug-send-btn:hover { background: #1666e0; }
.debug-send-btn:disabled { background: #93c5fd; cursor: not-allowed; }

/* 请求区 */
.debug-request-area {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 14px;
}
/* 配置行 */
.debug-config-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
}
.debug-config-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.debug-config-item label {
    font-size: .78rem;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}
.debug-config-item input {
    height: 36px;
    width: 220px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0 10px;
    font-size: .82rem;
    color: #1a1a2e;
    background: #fafbfc;
    outline: none;
    transition: border-color .2s;
    font-family: 'Fira Code', 'SF Mono', Consolas, monospace;
}
.debug-config-item input:focus { border-color: #1E78FF; background: #fff; }
.btn-ai-generate {
    height: 36px;
    padding: 0 14px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #1E78FF, #6C3AED);
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
}
.btn-ai-generate:hover { box-shadow: 0 2px 8px rgba(30,120,255,.3); }
.btn-ai-generate:disabled { opacity: .5; cursor: not-allowed; box-shadow: none!important; }
.btn-ai-generate.loading { background: #94a3b8; }

/* Tab 栏 */
.debug-tab-bar {
    display: flex;
    background: #f8f9fb;
    padding: 3px;
    gap: 2px;
    border-bottom: 1px solid #f0f0f0;
}
.debug-tab {
    padding: 7px 16px;
    font-size: .82rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-radius: 6px;
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.debug-tab i { font-size: .75rem; }
.debug-tab:hover { color: #374151; background: rgba(0,0,0,.03); }
.debug-tab.active { background: #fff; color: #111827; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.debug-panel { display: none; }
.debug-panel.active { display: block; }
.debug-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px 0;
}
.debug-panel-title span {
    color: #111827;
    font-size: .86rem;
    font-weight: 700;
}
.debug-panel-title em {
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef5ff;
    color: #1E78FF;
    font-size: .72rem;
    font-style: normal;
}
.debug-panel-title small {
    color: #8a94a6;
    font-size: .76rem;
}

/* Params 表格 */
.debug-kv-table { padding: 12px 16px; }
.debug-kv-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.debug-kv-key, .debug-kv-val {
    flex: 1;
    height: 38px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0 10px;
    font-size: .85rem;
    color: #1a1a2e;
    background: #fafbfc;
    outline: none;
    transition: border-color .2s;
    font-family: 'Fira Code', 'SF Mono', Consolas, monospace;
}
.debug-kv-key:focus, .debug-kv-val:focus { border-color: #1E78FF; background: #fff; }
.btn-kv-remove {
    width: 32px; height: 32px;
    border: none; background: transparent;
    color: #d1d5db; cursor: pointer;
    border-radius: 6px; font-size: .75rem;
    transition: all .15s;
    display: flex; align-items: center; justify-content: center;
}
.btn-kv-remove:hover { background: #fef2f2; color: #ef4444; }
.btn-kv-add {
    display: flex; align-items: center; gap: 5px;
    width: 100%; padding: 10px 0;
    border: none; background: transparent;
    color: #6b7280; font-size: .82rem;
    cursor: pointer; transition: color .2s;
}
.btn-kv-add:hover { color: #1E78FF; }

/* Body 编辑器（深色） */
.debug-code-editor {
    margin: 12px 16px 16px;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    overflow: hidden;
    background: #1e1e2e;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}
.debug-code-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #2c2c3e;
}
.window-dots { display: flex; gap: 5px; }
.dot-red, .dot-yellow, .dot-green { width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }
.debug-code-title {
    font-size: .78rem;
    color: #8b8fa3;
    margin-right: auto;
    font-family: 'Fira Code', 'SF Mono', Consolas, monospace;
}
.btn-icon {
    min-width: 28px; height: 28px;
    padding: 0 8px;
    border: none; background: transparent;
    color: #8b8fa3; cursor: pointer;
    border-radius: 5px; font-size: .75rem;
    transition: all .15s;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 5px;
    white-space: nowrap;
}
.btn-icon:hover { background: rgba(255,255,255,.08); color: #e2e6ed; }
.btn-icon.copied {
    background: rgba(16,185,129,.16);
    color: #34d399;
}
.debug-code-textarea {
    width: 100%;
    min-height: 160px;
    border: none;
    padding: 16px;
    font-size: .85rem;
    line-height: 1.7;
    color: #d4d4d4;
    background: #1e1e2e;
    outline: none;
    resize: vertical;
    font-family: 'Fira Code', 'SF Mono', Consolas, monospace;
    tab-size: 2;
    box-sizing: border-box;
}
.debug-code-textarea::placeholder { color: #4a4a5a; }

/* AI 生成按钮 */
.btn-ai-generate {
    padding: 4px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: linear-gradient(135deg, #1E78FF, #6C3AED);
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.btn-ai-generate:hover { box-shadow: 0 2px 8px rgba(30,120,255,.3); }
.btn-ai-generate:disabled { opacity: .5; cursor: not-allowed; box-shadow: none!important; }
.btn-ai-generate.loading { background: #94a3b8; }

/* 响应区 */
.debug-response-area {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}
.debug-res-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #2c2c3e;
    border-radius: 14px 14px 0 0;
}
.debug-res-header .debug-status-badge {
    order: 1;
    margin-left: auto;
}
.debug-res-header .debug-time-text {
    order: 2;
}
.debug-res-header .btn-icon {
    order: 3;
}
.debug-status-badge {
    font-size: .72rem; font-weight: 700;
    padding: 2px 8px; border-radius: 4px;
}
.debug-status-badge.ok { background: rgba(16,185,129,.15); color: #34d399; }
.debug-status-badge.err { background: rgba(239,68,68,.15); color: #f87171; }
.debug-time-text { font-size: .72rem; color: #8b8fa3; }
.debug-res-body {
    background: #1e1e2e;
    padding: 16px;
    max-height: 400px;
    overflow: auto;
}
.debug-res-body pre {
    margin: 0;
    font-size: .82rem;
    line-height: 1.7;
    color: #d4d4d4;
    white-space: pre-wrap;
    word-break: break-all;
}
.debug-res-body pre code { color: #d4d4d4; background: none; padding: 0; }

/* 文档区块标题行（标题 + 按钮） */
.doc-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
/* 复制接口文档按钮 */
.btn-copy-md {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    background: transparent;
    border: 1px solid #e0e5ec;
    border-radius: 6px;
    font-size: .78rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all .2s;
}
.btn-copy-md:hover {
    background: #f0f5ff;
    border-color: rgba(30,120,255,.2);
    color: var(--primary);
}

/* 接口说明图片自适应 */
.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    /* 接口详情 Hero */
    .api-detail-hero { padding: 20px 0; }
    .api-detail-hero h3 { font-size: 1.2rem; }
    .hero-meta { flex-wrap: wrap; gap: 6px; }
    .endpoint-label { font-size: .78rem; }

    /* Tab 导航 */
    .api-tabs .tabs-nav { border-radius: 8px; padding: 3px; }
    .api-tabs .tabs-nav .tab-link { padding: 8px 10px; font-size: .8rem; }

    /* 接口信息卡片 */
    .doc-info-grid { grid-template-columns: 1fr; gap: 10px; }
    .doc-info-card { padding: 16px; }

    /* 参数列表 */
    .doc-param-item { padding: 10px 14px; }
    .doc-param-head { flex-wrap: wrap; gap: 6px; }

    /* 代码窗口 */
    .code-window { border-radius: 10px; }
    .code-lang-tabs { overflow-x: auto; }
    .code-lang-tab { padding: 6px 12px; font-size: .78rem; }
    .code-panel { padding: 12px; }
    .code-panel pre code { font-size: .78rem; }

    /* 在线调试 */
    .debug-info-card {
        grid-template-columns: 1fr;
    }
    .debug-send-btn {
        flex: 1;
        min-width: 120px;
    }
    .debug-panel-title {
        display: block;
    }
    .debug-panel-title small {
        display: block;
        margin-top: 4px;
    }
    .debug-card { padding: 14px; }
    .debug-top-row {
        display: block;
    }
    .debug-method-tag {
        height: 36px;
        padding: 0 10px;
        font-size: .78rem;
        display: inline-flex;
        vertical-align: middle;
        margin-right: 8px;
    }
    .debug-url-text {
        display: block;
        font-size: .82rem;
        padding: 10px 14px;
        margin: 10px 0;
        background: #f5f7fb;
        border-radius: 8px;
        white-space: normal;
        word-break: break-all;
        line-height: 1.5;
    }
    .debug-top-actions {
        display: flex;
        gap: 8px;
    }
    .btn-ai-generate {
        flex: 1;
        justify-content: center;
        height: 40px;
        font-size: .82rem;
    }
    .debug-send-btn { font-size: .82rem; justify-content: center; }
    .debug-key-row {
        display: block;
        margin-bottom: 14px;
    }
    .debug-key-row label {
        display: block;
        margin-bottom: 6px;
    }
    .debug-key-row input {
        width: 100%;
        height: 42px;
    }
    .debug-json-textarea { min-height: 140px; padding: 12px; font-size: .8rem; }
    .debug-json-header { padding: 8px 12px; flex-wrap: wrap; gap: 6px; }
    .btn-json-format { font-size: .72rem; padding: 3px 10px; }

    /* 响应区 */
    .debug-res-header { padding: 8px 12px; flex-wrap: wrap; gap: 6px; }
    .debug-res-code { padding: 12px; max-height: 300px; }
    .debug-res-code pre { font-size: .78rem; }

    /* 响应区 */
    .debug-res-header { padding: 8px 12px; flex-wrap: wrap; gap: 6px; }
    .debug-res-code { padding: 12px; max-height: 300px; }
    .debug-res-code pre { font-size: .78rem; }

    /* 快速信息 */
    .doc-section { padding: 16px; }
    .doc-section h3 { font-size: .95rem; }

    /* 错误码 */
    .error-code-list li { padding: 10px 14px; }
    .ec-code { min-width: 38px; font-size: .75rem; padding: 2px 8px; }
}
