| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466 |
- /**
- * Admin 后台管理页面样式规范
- *
- * 设计原则:
- * - 基于 Element UI 的默认风格进行扩展
- * - 统一间距和尺寸标准
- * - 减少内联样式使用,改为 class 复用
- */
- /* ========================
- CSS 自定义属性 (设计令牌)
- ======================== */
- :root {
- /* 主色调 */
- --color-primary: #409EFF;
- --color-primary-light: #66b1ff;
- --color-primary-dark: #337ecc;
-
- /* 成功/警告/危险 */
- --color-success: #67C23A;
- --color-warning: #E6A23C;
- --color-danger: #F56C6C;
- --color-info: #909399;
-
- /* 文字色 */
- --color-text-primary: #303133;
- --color-text-regular: #606266;
- --color-text-secondary: #909399;
- --color-text-placeholder: #C0C4CC;
-
- /* 边框色 */
- --color-border-base: #DCDFE6;
- --color-border-light: #E4E7ED;
- --color-border-lighter: #EBEEF5;
- --color-border-extra-light: #F2F6FC;
-
- /* 背景色 */
- --color-bg-page: #f0f2f5;
- --color-bg-card: #ffffff;
- --color-bg-overlay: rgba(0, 0, 0, 0.5);
-
- /* 字体 */
- --font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
- --font-size-base: 14px;
- --font-size-small: 13px;
- --font-size-mini: 12px;
-
- /* 间距 (8px 基准) */
- --spacing-xs: 4px;
- --spacing-sm: 8px;
- --spacing-md: 12px;
- --spacing-base: 16px;
- --spacing-lg: 20px;
- --spacing-xl: 24px;
- --spacing-xxl: 32px;
-
- /* 圆角 */
- --border-radius-base: 4px;
- --border-radius-small: 2px;
- --border-radius-large: 8px;
-
- /* 阴影 */
- --box-shadow-base: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
- --box-shadow-light: 0 2px 4px 0 rgba(0, 0, 0, 0.08);
-
- /* 宽度标准 */
- --width-search-input: 220px;
- --width-select-sm: 120px;
- --width-select-base: 150px;
- --width-select-lg: 180px;
- --width-select-xl: 200px;
-
- /* 高度标准 */
- --height-table-max: calc(100vh - 280px);
- --height-table-with-filter: calc(100vh - 340px);
- }
- /* ========================
- 全局重置
- ======================== */
- .admin-page {
- padding: var(--spacing-base);
- background: var(--color-bg-page);
- min-height: calc(100vh - 60px);
- }
- /* page-container:所有<el-card>包裹的列表页使用此 class */
- .page-container {
- flex: 1;
- display: flex;
- flex-direction: column;
- min-height: 0;
- padding: 20px;
- }
- .page-container > .el-card {
- flex: 1;
- display: flex;
- flex-direction: column;
- min-height: 0;
- }
- .page-container > .el-card .el-card__body {
- flex: 1;
- display: flex;
- flex-direction: column;
- min-height: 0;
- padding: 20px;
- }
- .page-container > .el-card .el-card__body > .el-form:first-child {
- flex-shrink: 0;
- }
- .page-container > .el-card .el-card__body > .el-pagination {
- flex-shrink: 0;
- margin-top: auto;
- padding-top: 20px;
- text-align: right;
- }
- /* ========================
- 页面头部标题栏
- ======================== */
- .admin-page-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: var(--spacing-base);
- }
- .admin-page-title {
- font-size: 16px;
- font-weight: 600;
- color: var(--color-text-primary);
- }
- .admin-page-actions {
- display: flex;
- align-items: center;
- gap: 8px;
- }
- /* ========================
- 筛选器 / 搜索栏
- ======================== */
- .filter-bar {
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- gap: var(--spacing-sm);
- margin-bottom: var(--spacing-base);
- padding: var(--spacing-base);
- background: var(--color-bg-card);
- border-radius: var(--border-radius-base);
- box-shadow: var(--box-shadow-light);
- }
- .filter-bar .el-select {
- width: var(--width-select-base);
- }
- .filter-bar .el-input {
- width: var(--width-search-input);
- }
- .filter-bar .el-input--small {
- width: var(--width-search-input);
- }
- .filter-bar .el-input--mini {
- width: 160px;
- }
- /* ========================
- 状态标签栏 (ArticleManage 等)
- ======================== */
- .status-tabs {
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- gap: var(--spacing-xs);
- margin-bottom: var(--spacing-md);
- }
- .status-tabs .el-button + .el-button {
- margin-left: 0;
- }
- /* ========================
- 表格容器 (滚动)
- ======================== */
- .table-scroll-wrap {
- overflow: auto;
- max-height: var(--height-table-max);
- border-radius: var(--border-radius-base);
- }
- .table-scroll-wrap-sm {
- overflow: auto;
- max-height: calc(100vh - 300px);
- border-radius: var(--border-radius-base);
- }
- .table-scroll-wrap-lg {
- overflow: auto;
- max-height: var(--height-table-with-filter);
- border-radius: var(--border-radius-base);
- }
- /* ========================
- 卡片
- ======================== */
- .admin-card {
- background: var(--color-bg-card);
- border-radius: var(--border-radius-base);
- box-shadow: var(--box-shadow-light);
- margin-bottom: var(--spacing-base);
- }
- .admin-card .el-card__header {
- padding: var(--spacing-base);
- border-bottom: 1px solid var(--color-border-lighter);
- }
- .admin-card .el-card__body {
- padding: var(--spacing-base);
- }
- /* ========================
- 操作按钮区 (分页上方/下方)
- ======================== */
- .table-actions {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-top: var(--spacing-base);
- }
- .table-actions-right {
- text-align: right;
- margin-top: var(--spacing-base);
- }
- /* ========================
- 对话框表单
- ======================== */
- .admin-form-dialog .el-form-item {
- margin-bottom: var(--spacing-base);
- }
- .admin-form-dialog .el-form-item__label {
- color: var(--color-text-regular);
- }
- /* ========================
- 搜索结果统计
- ======================== */
- .search-result-count {
- font-size: var(--font-size-small);
- color: var(--color-text-secondary);
- margin-bottom: var(--spacing-sm);
- }
- /* ========================
- 空状态
- ======================== */
- .empty-state {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: var(--spacing-xxl) 0;
- color: var(--color-text-placeholder);
- }
- .empty-state i {
- font-size: 48px;
- margin-bottom: var(--spacing-sm);
- }
- /* ========================
- 分页器
- ======================== */
- .pagination-wrap {
- display: flex;
- justify-content: flex-end;
- margin-top: var(--spacing-base);
- padding: var(--spacing-sm) 0;
- }
- /* ========================
- 详情页布局
- ======================== */
- .detail-section {
- margin-bottom: var(--spacing-lg);
- }
- .detail-section-title {
- font-size: 15px;
- font-weight: 600;
- color: var(--color-text-primary);
- margin-bottom: var(--spacing-md);
- padding-bottom: var(--spacing-sm);
- border-bottom: 1px solid var(--color-border-lighter);
- }
- /* ========================
- 编辑页通用样式
- ======================== */
- .edit-form {
- max-width: 800px;
- }
- .edit-form .el-form-item__label {
- font-weight: 500;
- }
- .edit-form-footer {
- margin-top: var(--spacing-xl);
- padding-top: var(--spacing-base);
- border-top: 1px solid var(--color-border-lighter);
- text-align: right;
- }
- /* ========================
- 富文本编辑器容器
- ======================== */
- .rich-editor {
- border: 1px solid var(--color-border-base);
- border-radius: var(--border-radius-base);
- overflow: hidden;
- }
- .rich-editor /deep/ .w-e-toolbar {
- flex-wrap: wrap;
- padding: var(--spacing-sm);
- }
- .rich-editor /deep/ .w-e-text-container {
- min-height: 300px;
- }
- .rich-editor /deep/ .w-e-panel-container {
- z-index: 2000;
- }
- /* ========================
- Element UI 组件覆盖样式
- ======================== */
- /* 表格 */
- .el-table {
- font-size: var(--font-size-small);
- }
- .el-table th {
- background-color: var(--color-bg-page) !important;
- color: var(--color-text-regular);
- font-weight: 600;
- }
- .el-table td {
- padding: 8px 0;
- }
- /* 按钮 */
- .el-button--small {
- padding: 9px 15px;
- }
- /* 卡片 */
- .el-card {
- border-radius: var(--border-radius-base);
- box-shadow: var(--box-shadow-light);
- }
- .el-card__header {
- padding: var(--spacing-base);
- font-weight: 600;
- border-bottom: 1px solid var(--color-border-lighter);
- }
- .el-card__body {
- padding: var(--spacing-base);
- }
- /* 输入框 */
- .el-input--small {
- font-size: var(--font-size-small);
- }
- /* 表单项 */
- .el-form-item--small .el-form-item__label {
- font-size: var(--font-size-small);
- }
- /* 标签 */
- .el-tag {
- border-radius: var(--border-radius-small);
- }
- /* 分页 */
- .el-pagination {
- font-weight: normal;
- }
- /* 对话框 */
- .el-dialog__header {
- padding: var(--spacing-base);
- border-bottom: 1px solid var(--color-border-lighter);
- }
- .el-dialog__body {
- padding: var(--spacing-lg);
- }
- .el-dialog__footer {
- padding: var(--spacing-base);
- border-top: 1px solid var(--color-border-lighter);
- }
- /* ========================
- 工具类
- ======================== */
- /* 文本 */
- .text-muted {
- color: var(--color-text-placeholder);
- }
- .text-secondary {
- color: var(--color-text-secondary);
- }
- .text-primary {
- color: var(--color-text-primary);
- }
- .text-success {
- color: var(--color-success);
- }
- .text-warning {
- color: var(--color-warning);
- }
- .text-danger {
- color: var(--color-danger);
- }
- /* 间距 */
- .mt-sm { margin-top: var(--spacing-sm); }
- .mt-base { margin-top: var(--spacing-base); }
- .mt-lg { margin-top: var(--spacing-lg); }
- .mb-sm { margin-bottom: var(--spacing-sm); }
- .mb-base { margin-bottom: var(--spacing-base); }
- .mb-lg { margin-bottom: var(--spacing-lg); }
- /* Flex */
- .flex { display: flex; }
- .flex-wrap { flex-wrap: wrap; }
- .items-center { align-items: center; }
- .justify-between { justify-content: space-between; }
- .gap-sm { gap: var(--spacing-sm); }
- .gap-base { gap: var(--spacing-base); }
- /* 浮动 */
- .pull-right { float: right; }
- .clearfix::after { content: ""; display: table; clear: both; }
|