AppCardApiDoc.scss 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. @use '@/styles/variables.scss' as *;
  2. // AppCard API 文档样式 - 简化版
  3. .api-doc-drawer {
  4. .ant-drawer-body {
  5. padding: 0;
  6. }
  7. }
  8. .api-doc-content {
  9. padding: $spacing-4 $spacing-5;
  10. max-width: 650px;
  11. margin: 0 auto;
  12. // 章节样式
  13. .api-section {
  14. margin-bottom: $spacing-5;
  15. .section-title {
  16. font-size: $font-xl;
  17. font-weight: $font-weight-semibold;
  18. color: $text-primary;
  19. margin-bottom: $spacing-2;
  20. padding-bottom: $spacing-2;
  21. border-bottom: 1px solid $border-base;
  22. }
  23. .section-content {
  24. color: $text-secondary;
  25. line-height: $line-height-relaxed;
  26. p {
  27. margin-bottom: $spacing-2;
  28. }
  29. .app-id-badge {
  30. background: $bg-tertiary;
  31. padding: 2px 8px;
  32. border-radius: $radius-sm;
  33. color: $primary-color;
  34. font-family: monospace;
  35. font-size: $font-sm;
  36. }
  37. }
  38. }
  39. // 信息卡片
  40. .info-cards {
  41. display: grid;
  42. grid-template-columns: repeat(2, 1fr);
  43. gap: $spacing-2;
  44. margin-top: $spacing-2;
  45. }
  46. .info-card {
  47. background: $bg-tertiary;
  48. border-radius: $radius-md;
  49. padding: $spacing-2;
  50. border: 1px solid $border-light;
  51. .card-label {
  52. font-size: $font-xs;
  53. color: $text-hint;
  54. margin-bottom: $spacing-1;
  55. }
  56. .card-value {
  57. font-size: $font-sm;
  58. color: $text-primary;
  59. font-family: monospace;
  60. code {
  61. background: $bg-secondary;
  62. padding: 2px 6px;
  63. border-radius: $radius-sm;
  64. font-size: $font-xs;
  65. }
  66. }
  67. }
  68. // API 项目样式
  69. .api-item {
  70. padding: $spacing-3 0;
  71. border-bottom: 1px solid $border-light;
  72. &:last-child {
  73. border-bottom: none;
  74. }
  75. .api-header {
  76. display: flex;
  77. align-items: center;
  78. gap: $spacing-2;
  79. margin-bottom: $spacing-2;
  80. .api-method {
  81. display: inline-block;
  82. padding: 3px 10px;
  83. border-radius: $radius-sm;
  84. font-size: 11px;
  85. font-weight: $font-weight-semibold;
  86. text-transform: uppercase;
  87. &.method-post {
  88. background: rgba($success-color, 0.1);
  89. color: $success-color;
  90. }
  91. &.method-get {
  92. background: rgba($info-color, 0.1);
  93. color: $info-color;
  94. }
  95. }
  96. .api-path {
  97. font-size: $font-md;
  98. font-family: monospace;
  99. color: $text-primary;
  100. font-weight: $font-weight-medium;
  101. }
  102. }
  103. .api-description {
  104. color: $text-secondary;
  105. margin-bottom: $spacing-3;
  106. line-height: $line-height-relaxed;
  107. }
  108. h4 {
  109. font-size: $font-sm;
  110. font-weight: $font-weight-semibold;
  111. color: $text-primary;
  112. margin: $spacing-3 0 $spacing-2 0;
  113. }
  114. }
  115. // 参数表格
  116. .params-table {
  117. margin: $spacing-2 0;
  118. overflow-x: auto;
  119. table {
  120. width: 100%;
  121. border-collapse: collapse;
  122. font-size: $font-sm;
  123. th, td {
  124. padding: $spacing-2;
  125. text-align: left;
  126. border-bottom: 1px solid $border-light;
  127. }
  128. th {
  129. background: $bg-tertiary;
  130. font-weight: $font-weight-semibold;
  131. color: $text-primary;
  132. white-space: nowrap;
  133. }
  134. td {
  135. color: $text-secondary;
  136. &:nth-child(1) {
  137. code {
  138. background: $bg-tertiary;
  139. padding: 2px 6px;
  140. border-radius: $radius-sm;
  141. font-size: $font-sm;
  142. color: $primary-color;
  143. }
  144. }
  145. &:nth-child(2) {
  146. .param-type {
  147. color: $text-hint;
  148. font-family: monospace;
  149. font-size: $font-sm;
  150. }
  151. }
  152. }
  153. }
  154. }
  155. // 代码块
  156. .code-block {
  157. margin: $spacing-2 0;
  158. border-radius: $radius-md;
  159. overflow: hidden;
  160. border: 1px solid $border-base;
  161. .code-header {
  162. display: flex;
  163. justify-content: space-between;
  164. align-items: center;
  165. padding: $spacing-2 $spacing-3;
  166. background: $bg-tertiary;
  167. border-bottom: 1px solid $border-light;
  168. .code-language {
  169. font-size: $font-xs;
  170. color: $text-hint;
  171. text-transform: uppercase;
  172. }
  173. .ant-btn {
  174. font-size: $font-xs;
  175. }
  176. }
  177. .code-content {
  178. margin: 0;
  179. padding: $spacing-2;
  180. background: #1a1a2e;
  181. overflow-x: auto;
  182. max-height: 200px;
  183. code {
  184. font-family: 'Monaco', 'Consolas', monospace;
  185. font-size: $font-xs;
  186. line-height: 1.5;
  187. color: #e0e0e0;
  188. }
  189. }
  190. }
  191. // 响应示例
  192. .response-example {
  193. margin: $spacing-2 0;
  194. .example-content {
  195. margin: 0;
  196. padding: $spacing-2;
  197. background: $bg-tertiary;
  198. border-radius: $radius-md;
  199. border: 1px solid $border-light;
  200. overflow-x: auto;
  201. max-height: 150px;
  202. code {
  203. font-family: 'Monaco', 'Consolas', monospace;
  204. font-size: $font-xs;
  205. line-height: 1.5;
  206. color: $text-primary;
  207. }
  208. }
  209. }
  210. // API Tabs
  211. .api-tabs {
  212. margin-top: $spacing-3;
  213. }
  214. }
  215. // 响应式适配
  216. @media (max-width: $screen-md) {
  217. .api-doc-content {
  218. padding: $spacing-3;
  219. .info-cards {
  220. grid-template-columns: 1fr;
  221. }
  222. }
  223. }