| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263 |
- @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;
- }
- }
- // 响应式适配
- @media (max-width: $screen-md) {
- .api-doc-content {
- padding: $spacing-3;
- .info-cards {
- grid-template-columns: 1fr;
- }
- }
- }
|