@use '@/styles/variables.scss' as *;
// AppCard API 文档样式 - 简化版

.api-doc-drawer {
    .ant-drawer-body {
        padding: 0;
    }
}

.api-doc-content {
    padding: $spacing-4 $spacing-5;
    max-width: 650px;
    margin: 0 auto;

    // 章节样式
    .api-section {
        margin-bottom: $spacing-5;

        .section-title {
            font-size: $font-xl;
            font-weight: $font-weight-semibold;
            color: $text-primary;
            margin-bottom: $spacing-2;
            padding-bottom: $spacing-2;
            border-bottom: 1px solid $border-base;
        }

        .section-content {
            color: $text-secondary;
            line-height: $line-height-relaxed;

            p {
                margin-bottom: $spacing-2;
            }

            .app-id-badge {
                background: $bg-tertiary;
                padding: 2px 8px;
                border-radius: $radius-sm;
                color: $primary-color;
                font-family: monospace;
                font-size: $font-sm;
            }
        }
    }

    // 信息卡片
    .info-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: $spacing-2;
        margin-top: $spacing-2;
    }

    .info-card {
        background: $bg-tertiary;
        border-radius: $radius-md;
        padding: $spacing-2;
        border: 1px solid $border-light;

        .card-label {
            font-size: $font-xs;
            color: $text-hint;
            margin-bottom: $spacing-1;
        }

        .card-value {
            font-size: $font-sm;
            color: $text-primary;
            font-family: monospace;

            code {
                background: $bg-secondary;
                padding: 2px 6px;
                border-radius: $radius-sm;
                font-size: $font-xs;
            }
        }
    }

    // API 项目样式
    .api-item {
        padding: $spacing-3 0;
        border-bottom: 1px solid $border-light;

        &:last-child {
            border-bottom: none;
        }

        .api-header {
            display: flex;
            align-items: center;
            gap: $spacing-2;
            margin-bottom: $spacing-2;

            .api-method {
                display: inline-block;
                padding: 3px 10px;
                border-radius: $radius-sm;
                font-size: 11px;
                font-weight: $font-weight-semibold;
                text-transform: uppercase;

                &.method-post {
                    background: rgba($success-color, 0.1);
                    color: $success-color;
                }

                &.method-get {
                    background: rgba($info-color, 0.1);
                    color: $info-color;
                }
            }

            .api-path {
                font-size: $font-md;
                font-family: monospace;
                color: $text-primary;
                font-weight: $font-weight-medium;
            }
        }

        .api-description {
            color: $text-secondary;
            margin-bottom: $spacing-3;
            line-height: $line-height-relaxed;
        }

        h4 {
            font-size: $font-sm;
            font-weight: $font-weight-semibold;
            color: $text-primary;
            margin: $spacing-3 0 $spacing-2 0;
        }
    }

    // 参数表格
    .params-table {
        margin: $spacing-2 0;
        overflow-x: auto;

        table {
            width: 100%;
            border-collapse: collapse;
            font-size: $font-sm;

            th, td {
                padding: $spacing-2;
                text-align: left;
                border-bottom: 1px solid $border-light;
            }

            th {
                background: $bg-tertiary;
                font-weight: $font-weight-semibold;
                color: $text-primary;
                white-space: nowrap;
            }

            td {
                color: $text-secondary;

                &:nth-child(1) {
                    code {
                        background: $bg-tertiary;
                        padding: 2px 6px;
                        border-radius: $radius-sm;
                        font-size: $font-sm;
                        color: $primary-color;
                    }
                }

                &:nth-child(2) {
                    .param-type {
                        color: $text-hint;
                        font-family: monospace;
                        font-size: $font-sm;
                    }
                }
            }
        }
    }

    // 代码块
    .code-block {
        margin: $spacing-2 0;
        border-radius: $radius-md;
        overflow: hidden;
        border: 1px solid $border-base;

        .code-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: $spacing-2 $spacing-3;
            background: $bg-tertiary;
            border-bottom: 1px solid $border-light;

            .code-language {
                font-size: $font-xs;
                color: $text-hint;
                text-transform: uppercase;
            }

            .ant-btn {
                font-size: $font-xs;
            }
        }

        .code-content {
            margin: 0;
            padding: $spacing-2;
            background: #1a1a2e;
            overflow-x: auto;
            max-height: 200px;

            code {
                font-family: 'Monaco', 'Consolas', monospace;
                font-size: $font-xs;
                line-height: 1.5;
                color: #e0e0e0;
            }
        }
    }

    // 响应示例
    .response-example {
        margin: $spacing-2 0;

        .example-content {
            margin: 0;
            padding: $spacing-2;
            background: $bg-tertiary;
            border-radius: $radius-md;
            border: 1px solid $border-light;
            overflow-x: auto;
            max-height: 150px;

            code {
                font-family: 'Monaco', 'Consolas', monospace;
                font-size: $font-xs;
                line-height: 1.5;
                color: $text-primary;
            }
        }
    }

    // API Tabs
    .api-tabs {
        margin-top: $spacing-3;

        .ant-tabs-tab {
            font-size: $font-sm;
        }
    }
}

// 响应式适配
@media (max-width: $screen-md) {
    .api-doc-content {
        padding: $spacing-3;

        .info-cards {
            grid-template-columns: 1fr;
        }
    }
}
