admin-tokens.css 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. /**
  2. * Admin 后台管理页面样式规范
  3. *
  4. * 设计原则:
  5. * - 基于 Element UI 的默认风格进行扩展
  6. * - 统一间距和尺寸标准
  7. * - 减少内联样式使用,改为 class 复用
  8. */
  9. /* ========================
  10. CSS 自定义属性 (设计令牌)
  11. ======================== */
  12. :root {
  13. /* 主色调 */
  14. --color-primary: #409EFF;
  15. --color-primary-light: #66b1ff;
  16. --color-primary-dark: #337ecc;
  17. /* 成功/警告/危险 */
  18. --color-success: #67C23A;
  19. --color-warning: #E6A23C;
  20. --color-danger: #F56C6C;
  21. --color-info: #909399;
  22. /* 文字色 */
  23. --color-text-primary: #303133;
  24. --color-text-regular: #606266;
  25. --color-text-secondary: #909399;
  26. --color-text-placeholder: #C0C4CC;
  27. /* 边框色 */
  28. --color-border-base: #DCDFE6;
  29. --color-border-light: #E4E7ED;
  30. --color-border-lighter: #EBEEF5;
  31. --color-border-extra-light: #F2F6FC;
  32. /* 背景色 */
  33. --color-bg-page: #f0f2f5;
  34. --color-bg-card: #ffffff;
  35. --color-bg-overlay: rgba(0, 0, 0, 0.5);
  36. /* 字体 */
  37. --font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
  38. --font-size-base: 14px;
  39. --font-size-small: 13px;
  40. --font-size-mini: 12px;
  41. /* 间距 (8px 基准) */
  42. --spacing-xs: 4px;
  43. --spacing-sm: 8px;
  44. --spacing-md: 12px;
  45. --spacing-base: 16px;
  46. --spacing-lg: 20px;
  47. --spacing-xl: 24px;
  48. --spacing-xxl: 32px;
  49. /* 圆角 */
  50. --border-radius-base: 4px;
  51. --border-radius-small: 2px;
  52. --border-radius-large: 8px;
  53. /* 阴影 */
  54. --box-shadow-base: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  55. --box-shadow-light: 0 2px 4px 0 rgba(0, 0, 0, 0.08);
  56. /* 宽度标准 */
  57. --width-search-input: 220px;
  58. --width-select-sm: 120px;
  59. --width-select-base: 150px;
  60. --width-select-lg: 180px;
  61. --width-select-xl: 200px;
  62. /* 高度标准 */
  63. --height-table-max: calc(100vh - 280px);
  64. --height-table-with-filter: calc(100vh - 340px);
  65. }
  66. /* ========================
  67. 全局重置
  68. ======================== */
  69. .admin-page {
  70. padding: var(--spacing-base);
  71. background: var(--color-bg-page);
  72. min-height: calc(100vh - 60px);
  73. }
  74. /* page-container:所有<el-card>包裹的列表页使用此 class */
  75. .page-container {
  76. flex: 1;
  77. display: flex;
  78. flex-direction: column;
  79. min-height: 0;
  80. padding: 20px;
  81. }
  82. .page-container > .el-card {
  83. flex: 1;
  84. display: flex;
  85. flex-direction: column;
  86. min-height: 0;
  87. }
  88. .page-container > .el-card .el-card__body {
  89. flex: 1;
  90. display: flex;
  91. flex-direction: column;
  92. min-height: 0;
  93. padding: 20px;
  94. }
  95. .page-container > .el-card .el-card__body > .el-form:first-child {
  96. flex-shrink: 0;
  97. }
  98. .page-container > .el-card .el-card__body > .el-pagination {
  99. flex-shrink: 0;
  100. margin-top: auto;
  101. padding-top: 20px;
  102. text-align: right;
  103. }
  104. /* ========================
  105. 页面头部标题栏
  106. ======================== */
  107. .admin-page-header {
  108. display: flex;
  109. align-items: center;
  110. justify-content: space-between;
  111. margin-bottom: var(--spacing-base);
  112. }
  113. .admin-page-title {
  114. font-size: 16px;
  115. font-weight: 600;
  116. color: var(--color-text-primary);
  117. }
  118. .admin-page-actions {
  119. display: flex;
  120. align-items: center;
  121. gap: 8px;
  122. }
  123. /* ========================
  124. 筛选器 / 搜索栏
  125. ======================== */
  126. .filter-bar {
  127. display: flex;
  128. align-items: center;
  129. flex-wrap: wrap;
  130. gap: var(--spacing-sm);
  131. margin-bottom: var(--spacing-base);
  132. padding: var(--spacing-base);
  133. background: var(--color-bg-card);
  134. border-radius: var(--border-radius-base);
  135. box-shadow: var(--box-shadow-light);
  136. }
  137. .filter-bar .el-select {
  138. width: var(--width-select-base);
  139. }
  140. .filter-bar .el-input {
  141. width: var(--width-search-input);
  142. }
  143. .filter-bar .el-input--small {
  144. width: var(--width-search-input);
  145. }
  146. .filter-bar .el-input--mini {
  147. width: 160px;
  148. }
  149. /* ========================
  150. 状态标签栏 (ArticleManage 等)
  151. ======================== */
  152. .status-tabs {
  153. display: flex;
  154. align-items: center;
  155. flex-wrap: wrap;
  156. gap: var(--spacing-xs);
  157. margin-bottom: var(--spacing-md);
  158. }
  159. .status-tabs .el-button + .el-button {
  160. margin-left: 0;
  161. }
  162. /* ========================
  163. 表格容器 (滚动)
  164. ======================== */
  165. .table-scroll-wrap {
  166. overflow: auto;
  167. max-height: var(--height-table-max);
  168. border-radius: var(--border-radius-base);
  169. }
  170. .table-scroll-wrap-sm {
  171. overflow: auto;
  172. max-height: calc(100vh - 300px);
  173. border-radius: var(--border-radius-base);
  174. }
  175. .table-scroll-wrap-lg {
  176. overflow: auto;
  177. max-height: var(--height-table-with-filter);
  178. border-radius: var(--border-radius-base);
  179. }
  180. /* ========================
  181. 卡片
  182. ======================== */
  183. .admin-card {
  184. background: var(--color-bg-card);
  185. border-radius: var(--border-radius-base);
  186. box-shadow: var(--box-shadow-light);
  187. margin-bottom: var(--spacing-base);
  188. }
  189. .admin-card .el-card__header {
  190. padding: var(--spacing-base);
  191. border-bottom: 1px solid var(--color-border-lighter);
  192. }
  193. .admin-card .el-card__body {
  194. padding: var(--spacing-base);
  195. }
  196. /* ========================
  197. 操作按钮区 (分页上方/下方)
  198. ======================== */
  199. .table-actions {
  200. display: flex;
  201. align-items: center;
  202. justify-content: space-between;
  203. margin-top: var(--spacing-base);
  204. }
  205. .table-actions-right {
  206. text-align: right;
  207. margin-top: var(--spacing-base);
  208. }
  209. /* ========================
  210. 对话框表单
  211. ======================== */
  212. .admin-form-dialog .el-form-item {
  213. margin-bottom: var(--spacing-base);
  214. }
  215. .admin-form-dialog .el-form-item__label {
  216. color: var(--color-text-regular);
  217. }
  218. /* ========================
  219. 搜索结果统计
  220. ======================== */
  221. .search-result-count {
  222. font-size: var(--font-size-small);
  223. color: var(--color-text-secondary);
  224. margin-bottom: var(--spacing-sm);
  225. }
  226. /* ========================
  227. 空状态
  228. ======================== */
  229. .empty-state {
  230. display: flex;
  231. flex-direction: column;
  232. align-items: center;
  233. justify-content: center;
  234. padding: var(--spacing-xxl) 0;
  235. color: var(--color-text-placeholder);
  236. }
  237. .empty-state i {
  238. font-size: 48px;
  239. margin-bottom: var(--spacing-sm);
  240. }
  241. /* ========================
  242. 分页器
  243. ======================== */
  244. .pagination-wrap {
  245. display: flex;
  246. justify-content: flex-end;
  247. margin-top: var(--spacing-base);
  248. padding: var(--spacing-sm) 0;
  249. }
  250. /* ========================
  251. 详情页布局
  252. ======================== */
  253. .detail-section {
  254. margin-bottom: var(--spacing-lg);
  255. }
  256. .detail-section-title {
  257. font-size: 15px;
  258. font-weight: 600;
  259. color: var(--color-text-primary);
  260. margin-bottom: var(--spacing-md);
  261. padding-bottom: var(--spacing-sm);
  262. border-bottom: 1px solid var(--color-border-lighter);
  263. }
  264. /* ========================
  265. 编辑页通用样式
  266. ======================== */
  267. .edit-form {
  268. max-width: 800px;
  269. }
  270. .edit-form .el-form-item__label {
  271. font-weight: 500;
  272. }
  273. .edit-form-footer {
  274. margin-top: var(--spacing-xl);
  275. padding-top: var(--spacing-base);
  276. border-top: 1px solid var(--color-border-lighter);
  277. text-align: right;
  278. }
  279. /* ========================
  280. 富文本编辑器容器
  281. ======================== */
  282. .rich-editor {
  283. border: 1px solid var(--color-border-base);
  284. border-radius: var(--border-radius-base);
  285. overflow: hidden;
  286. }
  287. .rich-editor /deep/ .w-e-toolbar {
  288. flex-wrap: wrap;
  289. padding: var(--spacing-sm);
  290. }
  291. .rich-editor /deep/ .w-e-text-container {
  292. min-height: 300px;
  293. }
  294. .rich-editor /deep/ .w-e-panel-container {
  295. z-index: 2000;
  296. }
  297. /* ========================
  298. Element UI 组件覆盖样式
  299. ======================== */
  300. /* 表格 */
  301. .el-table {
  302. font-size: var(--font-size-small);
  303. }
  304. .el-table th {
  305. background-color: var(--color-bg-page) !important;
  306. color: var(--color-text-regular);
  307. font-weight: 600;
  308. }
  309. .el-table td {
  310. padding: 8px 0;
  311. }
  312. /* 按钮 */
  313. .el-button--small {
  314. padding: 9px 15px;
  315. }
  316. /* 卡片 */
  317. .el-card {
  318. border-radius: var(--border-radius-base);
  319. box-shadow: var(--box-shadow-light);
  320. }
  321. .el-card__header {
  322. padding: var(--spacing-base);
  323. font-weight: 600;
  324. border-bottom: 1px solid var(--color-border-lighter);
  325. }
  326. .el-card__body {
  327. padding: var(--spacing-base);
  328. }
  329. /* 输入框 */
  330. .el-input--small {
  331. font-size: var(--font-size-small);
  332. }
  333. /* 表单项 */
  334. .el-form-item--small .el-form-item__label {
  335. font-size: var(--font-size-small);
  336. }
  337. /* 标签 */
  338. .el-tag {
  339. border-radius: var(--border-radius-small);
  340. }
  341. /* 分页 */
  342. .el-pagination {
  343. font-weight: normal;
  344. }
  345. /* 对话框 */
  346. .el-dialog__header {
  347. padding: var(--spacing-base);
  348. border-bottom: 1px solid var(--color-border-lighter);
  349. }
  350. .el-dialog__body {
  351. padding: var(--spacing-lg);
  352. }
  353. .el-dialog__footer {
  354. padding: var(--spacing-base);
  355. border-top: 1px solid var(--color-border-lighter);
  356. }
  357. /* ========================
  358. 工具类
  359. ======================== */
  360. /* 文本 */
  361. .text-muted {
  362. color: var(--color-text-placeholder);
  363. }
  364. .text-secondary {
  365. color: var(--color-text-secondary);
  366. }
  367. .text-primary {
  368. color: var(--color-text-primary);
  369. }
  370. .text-success {
  371. color: var(--color-success);
  372. }
  373. .text-warning {
  374. color: var(--color-warning);
  375. }
  376. .text-danger {
  377. color: var(--color-danger);
  378. }
  379. /* 间距 */
  380. .mt-sm { margin-top: var(--spacing-sm); }
  381. .mt-base { margin-top: var(--spacing-base); }
  382. .mt-lg { margin-top: var(--spacing-lg); }
  383. .mb-sm { margin-bottom: var(--spacing-sm); }
  384. .mb-base { margin-bottom: var(--spacing-base); }
  385. .mb-lg { margin-bottom: var(--spacing-lg); }
  386. /* Flex */
  387. .flex { display: flex; }
  388. .flex-wrap { flex-wrap: wrap; }
  389. .items-center { align-items: center; }
  390. .justify-between { justify-content: space-between; }
  391. .gap-sm { gap: var(--spacing-sm); }
  392. .gap-base { gap: var(--spacing-base); }
  393. /* 浮动 */
  394. .pull-right { float: right; }
  395. .clearfix::after { content: ""; display: table; clear: both; }