/* API 详情页面样式 - 黑金风格 */

/* 布局 */
.api-detail {
    max-width: 1200px;
    margin: 140px auto 60px;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
}

/* 左侧边栏 */
.api-sidebar {
    background: #0a0a0a;
    border-radius: 16px;
    border: 1px solid #30363d;
    padding: 24px 20px;
    position: sticky;
    top: 120px;
    align-self: flex-start;
}

.api-sidebar__title {
    font-size: 16px;
    font-weight: 500;
    color: #e6edf3;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(239, 196, 155, 0.2);
}

.api-sidebar__list {
    list-style: none;
}

.api-sidebar__item {
    margin-bottom: 10px;
}

.api-sidebar__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    color: #8b949e;
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.25s;
}

.api-sidebar__link:hover {
    background: rgba(239, 196, 155, 0.08);
    color: #efc49b;
}

.api-sidebar__link.active {
    background: rgba(239, 196, 155, 0.16);
    color: #efc49b;
}

.api-method-badge {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(239, 196, 155, 0.4);
    color: #efc49b;
}

/* 主要内容 */
.api-content {
    background: #0a0a0a;
    border-radius: 16px;
    border: 1px solid #30363d;
    padding: 32px;
}

.api-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(239, 196, 155, 0.2);
}

.api-title {
    font-size: 26px;
    font-weight: 600;
    color: #e6edf3;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.api-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: #8b949e;
}

.api-meta__item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.api-meta__item svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.api-section {
    margin-bottom: 32px;
}

.api-section__title {
    font-size: 18px;
    font-weight: 500;
    color: #e6edf3;
    margin-bottom: 16px;
}

.api-description {
    color: #8b949e;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 20px;
}

.api-description a {
    color: #efc49b;
    text-decoration: none;
    transition: opacity 0.2s;
}

.api-description a:hover {
    opacity: 0.85;
}

.api-url {
    background: #050505;
    border-radius: 10px;
    border: 1px solid #30363d;
    padding: 12px 14px;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 14px;
    color: #e6edf3;
    word-break: break-all;
}

/* 参数表格 */
.params-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #30363d;
}

.params-table th,
.params-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #30363d;
    font-size: 14px;
}

.params-table th {
    background: #111111;
    color: #e6edf3;
    font-weight: 500;
}

.params-table td {
    color: #8b949e;
}

.param-required {
    color: #f85149;
    margin-left: 4px;
}

.param-copy {
    padding: 4px 10px;
    background: #111111;
    border-radius: 999px;
    border: 1px solid #30363d;
    color: #efc49b;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.param-copy:hover {
    border-color: rgba(239, 196, 155, 0.8);
    box-shadow: 0 0 10px rgba(239, 196, 155, 0.25);
}

/* 在线测试 */
.api-test {
    background: #050505;
    border-radius: 12px;
    border: 1px solid #30363d;
    padding: 20px 20px 18px;
}

.api-test__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 14px;
    color: #e6edf3;
}

.form-input {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #30363d;
    background: #000000;
    color: #e6edf3;
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: rgba(239, 196, 155, 0.8);
    box-shadow: 0 0 0 1px rgba(239, 196, 155, 0.4);
}

.test-btn {
    margin-top: 4px;
    padding: 8px 22px;
    border-radius: 999px;
    border: none;
    background: #efc49b;
    color: #000000;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    align-self: flex-start;
    transition: all 0.2s;
}

.test-btn:hover {
    background: #f4d4b4;
    box-shadow: 0 0 18px rgba(239, 196, 155, 0.35);
    transform: translateY(-1px);
}

.response-area {
    margin-top: 14px;
    background: #000000;
    border-radius: 10px;
    border: 1px solid #30363d;
    padding: 12px;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 13px;
    color: #e6edf3;
    white-space: pre-wrap;
    display: none;
}

.response-area.success {
    border-color: rgba(63, 185, 80, 0.7);
}

.response-area.error {
    border-color: rgba(248, 81, 73, 0.8);
}

/* Markdown 内容样式 */
#rendered-markdown {
    color: #8b949e;
    font-size: 15px;
    line-height: 1.8;
}

#rendered-markdown img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

#rendered-markdown pre {
    background: #050505;
    padding: 14px;
    border-radius: 10px;
    overflow-x: auto;
    border: 1px solid #30363d;
}

#rendered-markdown code {
    background: #050505;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 13px;
    color: #efc49b;
}

#rendered-markdown blockquote {
    border-left: 3px solid #efc49b;
    padding-left: 14px;
    margin: 16px 0;
    color: #8b949e;
}

#rendered-markdown table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

#rendered-markdown th,
#rendered-markdown td {
    padding: 10px 12px;
    border: 1px solid #30363d;
}

#rendered-markdown th {
    background: #111111;
    color: #e6edf3;
}

/* 响应式 */
@media screen and (max-width: 992px) {
    .api-detail {
        grid-template-columns: 1fr;
    }

    .api-sidebar {
        position: static;
    }
}

@media screen and (max-width: 768px) {
    .api-detail {
        margin: 120px auto 50px;
        padding: 0 16px;
    }

    .api-content {
        padding: 20px;
    }
}

@media screen and (max-width: 480px) {
    .api-detail {
        padding: 0 12px;
    }

    .api-content {
        padding: 16px;
    }
}
