457 lines
12 KiB
Plaintext
457 lines
12 KiB
Plaintext
html, body, #app, .layout {
|
||
margin: 0;
|
||
padding: 0;
|
||
height: 100%;
|
||
}
|
||
|
||
/* ===== 顶部导航栏 ===== */
|
||
.layout-header {
|
||
color: #fff;
|
||
background: linear-gradient(90deg, #1d2b45 0%, #2c3e60 100%);
|
||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
position: relative;
|
||
|
||
div.main-title {
|
||
display: inline-block;
|
||
font-size: 20px;
|
||
font-weight: var(--el-font-weight-primary);
|
||
letter-spacing: 1px;
|
||
line-height: 60px;
|
||
}
|
||
.nav-btns-right {
|
||
display: flex;
|
||
}
|
||
}
|
||
|
||
/* ===== 侧边栏 ===== */
|
||
.el-aside {
|
||
background: var(--el-fill-color-light);
|
||
border-right: 1px solid var(--el-border-color-light);
|
||
|
||
.el-menu {
|
||
// CSS 变量覆盖
|
||
--el-menu-bg-color: transparent;
|
||
--el-menu-border-color: transparent;
|
||
--el-menu-hover-bg-color: var(--el-fill-color);
|
||
--el-menu-active-color: var(--el-color-primary);
|
||
}
|
||
|
||
.el-menu-item {
|
||
// 圆角/间距/宽度无对应 CSS 变量,保留直接样式
|
||
border-radius: var(--el-border-radius-base);
|
||
margin: 2px 8px;
|
||
width: calc(100% - 16px);
|
||
|
||
&.is-active {
|
||
// 激活背景色无对应 CSS 变量,保留直接样式
|
||
background-color: var(--el-color-primary-light-9);
|
||
font-weight: var(--el-font-weight-primary);
|
||
}
|
||
}
|
||
|
||
.el-sub-menu__title:hover {
|
||
// Element Plus 子菜单标题 hover 使用 --el-menu-bg-color 而非 --el-menu-hover-bg-color
|
||
// 因此无法通过变量覆盖,保留直接样式
|
||
background-color: var(--el-fill-color);
|
||
}
|
||
}
|
||
|
||
/* ===== 主内容区 ===== */
|
||
.el-main.layout-main {
|
||
--el-main-padding: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
background: var(--el-fill-color);
|
||
|
||
> .layout-tabs {
|
||
margin: 12px 16px 0;
|
||
}
|
||
> .layout-content {
|
||
margin: 12px 16px;
|
||
overflow: auto;
|
||
background: var(--el-bg-color);
|
||
border-radius: 10px;
|
||
border: 1px solid var(--el-border-color-lighter);
|
||
padding: 20px;
|
||
flex-grow: 1;
|
||
flex-basis: 0;
|
||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
|
||
}
|
||
|
||
/* ===== 页面布局(用于带分页的表格页面)===== */
|
||
.page-wrapper {
|
||
display: flex;
|
||
flex-direction: column;
|
||
height: 100%;
|
||
}
|
||
|
||
.table-container {
|
||
// CSS 变量覆盖:表头背景/文字色、行悬停色、边框色、正文色
|
||
--el-table-header-bg-color: var(--el-fill-color-light);
|
||
--el-table-header-text-color: var(--el-text-color-regular);
|
||
--el-table-row-hover-bg-color: var(--el-color-primary-light-9);
|
||
--el-table-border-color: var(--el-border-color-lighter);
|
||
--el-table-text-color: var(--el-text-color-primary);
|
||
|
||
// 固定高度,让表头固定,tbody滚动
|
||
flex: 1;
|
||
border-radius: var(--el-border-radius-base);
|
||
overflow: hidden;
|
||
border-left: 1px solid var(--el-border-color-lighter);
|
||
border-right: 1px solid var(--el-border-color-lighter);
|
||
border-top: 1px solid var(--el-border-color-lighter);
|
||
|
||
&::before {
|
||
display: none;
|
||
}
|
||
|
||
th.el-table__cell {
|
||
font-weight: var(--el-font-weight-primary);
|
||
font-size: var(--el-font-size-small);
|
||
}
|
||
|
||
td.el-table__cell {
|
||
// 行分隔线比表头边框更浅,与 --el-table-border-color 不同,需直接覆盖
|
||
border-bottom-color: var(--el-fill-color);
|
||
font-size: var(--el-font-size-small);
|
||
}
|
||
|
||
.el-button.is-link {
|
||
font-size: 16px;
|
||
padding: 4px 6px;
|
||
}
|
||
}
|
||
/* ===== 分页 ===== */
|
||
.page-container {
|
||
margin-top: 20px;
|
||
display: flex;
|
||
justify-content: center;
|
||
}
|
||
/* ===== 操作栏 ===== */
|
||
.btn-container {
|
||
margin-bottom: 14px;
|
||
display: flex;
|
||
align-items: center;
|
||
|
||
.search-btn {
|
||
margin-left: auto;
|
||
}
|
||
}
|
||
}
|
||
|
||
/* ===== 表单弹窗 ===== */
|
||
body .el-dialog {
|
||
// CSS 变量覆盖:圆角、清除 element-plus 2.x 新增的根元素 padding
|
||
--el-dialog-border-radius: 12px;
|
||
--el-dialog-padding-primary: 0;
|
||
|
||
// overflow:hidden 无对应 CSS 变量,保留直接样式(使圆角裁剪生效)
|
||
overflow: hidden;
|
||
|
||
.el-dialog__header {
|
||
background: var(--el-fill-color-light);
|
||
border-bottom: 1px solid var(--el-border-color-lighter);
|
||
padding: 16px 20px;
|
||
margin: 0;
|
||
|
||
.el-dialog__title {
|
||
font-size: var(--el-font-size-base);
|
||
font-weight: var(--el-font-weight-primary);
|
||
color: var(--el-text-color-primary);
|
||
}
|
||
}
|
||
.el-dialog__body {
|
||
padding: 24px 24px 8px;
|
||
}
|
||
.el-dialog__footer {
|
||
border-top: 1px solid var(--el-border-color-lighter);
|
||
padding: 12px 20px;
|
||
background: var(--el-fill-color-lighter);
|
||
}
|
||
}
|
||
|
||
/* ===== 搜索表单 ===== */
|
||
.el-form--inline {
|
||
margin-bottom: 14px;
|
||
|
||
.el-form-item {
|
||
margin-bottom: 0;
|
||
}
|
||
|
||
.el-select {
|
||
min-width: 160px;
|
||
}
|
||
}
|
||
|
||
/* ===== 其他工具类 ===== */
|
||
.carsouel-img {
|
||
position: relative;
|
||
left: 50%;
|
||
transform: translateX(-50%);
|
||
height: 500px;
|
||
width: auto;
|
||
}
|
||
.main-view {
|
||
position: relative;
|
||
height: 100%;
|
||
}
|
||
.custom-drawer {
|
||
> .el-drawer__header {
|
||
margin-bottom: 0;
|
||
}
|
||
> .el-drawer__body {
|
||
overflow: auto;
|
||
}
|
||
}
|
||
/* ===== Markdown 预览 ===== */
|
||
.article-preview-drawer {
|
||
> .el-drawer__header {
|
||
border-bottom: 1px solid var(--el-border-color-lighter);
|
||
padding: 14px 20px;
|
||
margin-bottom: 0;
|
||
background: var(--el-fill-color-light);
|
||
|
||
.el-drawer__title {
|
||
font-size: var(--el-font-size-base);
|
||
font-weight: var(--el-font-weight-primary);
|
||
color: var(--el-text-color-primary);
|
||
}
|
||
}
|
||
|
||
> .el-drawer__body {
|
||
padding: 24px 32px;
|
||
}
|
||
}
|
||
|
||
.markdown-body {
|
||
font-size: 15px;
|
||
line-height: 1.8;
|
||
color: var(--el-text-color-primary);
|
||
word-break: break-word;
|
||
|
||
// 首个元素去掉顶部外边距
|
||
> :first-child { margin-top: 0 !important; }
|
||
|
||
// ── 标题 ───────────────────────────────────
|
||
h1, h2, h3, h4, h5, h6 {
|
||
font-weight: 600;
|
||
line-height: 1.35;
|
||
margin: 1.4em 0 0.6em;
|
||
color: var(--el-text-color-primary);
|
||
}
|
||
h1 {
|
||
font-size: 1.8em;
|
||
padding-bottom: 0.4em;
|
||
border-bottom: 2px solid var(--el-border-color);
|
||
}
|
||
h2 {
|
||
font-size: 1.45em;
|
||
padding-bottom: 0.3em;
|
||
border-bottom: 1px solid var(--el-border-color-lighter);
|
||
}
|
||
h3 { font-size: 1.2em; }
|
||
h4 { font-size: 1.05em; }
|
||
h5 { font-size: 0.95em; }
|
||
h6 {
|
||
font-size: 0.9em;
|
||
color: var(--el-text-color-secondary);
|
||
}
|
||
|
||
// ── 段落 ───────────────────────────────────
|
||
p { margin: 0.85em 0; }
|
||
|
||
// ── 链接 ───────────────────────────────────
|
||
a {
|
||
color: var(--el-color-primary);
|
||
text-decoration: none;
|
||
border-bottom: 1px solid transparent;
|
||
transition: border-color 0.2s, color 0.2s;
|
||
&:hover {
|
||
color: var(--el-color-primary-light-3);
|
||
border-bottom-color: var(--el-color-primary-light-3);
|
||
}
|
||
}
|
||
|
||
// ── 强调 ───────────────────────────────────
|
||
strong { font-weight: 600; }
|
||
em { font-style: italic; }
|
||
del { color: var(--el-text-color-secondary); text-decoration: line-through; }
|
||
|
||
// ── 内联代码 ───────────────────────────────
|
||
:not(pre) > code {
|
||
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
|
||
font-size: 0.85em;
|
||
padding: 0.18em 0.45em;
|
||
border-radius: 4px;
|
||
background: var(--el-fill-color-dark);
|
||
color: var(--el-color-danger);
|
||
border: 1px solid var(--el-border-color-lighter);
|
||
}
|
||
|
||
// ── 代码块(亮色:浅灰背景;暗色:深背景) ───
|
||
pre {
|
||
background: #f6f8fa;
|
||
border: 1px solid var(--el-border-color-lighter);
|
||
border-radius: 8px;
|
||
padding: 1em 1.2em;
|
||
overflow-x: auto;
|
||
margin: 1em 0;
|
||
code {
|
||
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
|
||
font-size: 0.875em;
|
||
background: none;
|
||
border: none;
|
||
padding: 0;
|
||
color: #24292f;
|
||
line-height: 1.65;
|
||
}
|
||
}
|
||
|
||
// ── 引用块 ─────────────────────────────────
|
||
blockquote {
|
||
margin: 1em 0;
|
||
padding: 0.6em 1.1em;
|
||
border-left: 4px solid var(--el-color-primary-light-5);
|
||
background: var(--el-color-primary-light-9);
|
||
border-radius: 0 6px 6px 0;
|
||
color: var(--el-text-color-secondary);
|
||
> :first-child { margin-top: 0; }
|
||
> :last-child { margin-bottom: 0; }
|
||
}
|
||
|
||
// ── 列表 ───────────────────────────────────
|
||
ul, ol {
|
||
margin: 0.7em 0;
|
||
padding-left: 1.8em;
|
||
}
|
||
li {
|
||
margin: 0.3em 0;
|
||
line-height: 1.75;
|
||
> ul, > ol { margin: 0.2em 0; }
|
||
}
|
||
ul > li { list-style-type: disc; }
|
||
ul > li > ul > li { list-style-type: circle; }
|
||
ol > li { list-style-type: decimal; }
|
||
|
||
// ── 水平线 ─────────────────────────────────
|
||
hr {
|
||
border: none;
|
||
border-top: 1px solid var(--el-border-color);
|
||
margin: 1.6em 0;
|
||
}
|
||
|
||
// ── 图片 ───────────────────────────────────
|
||
img {
|
||
max-width: 100%;
|
||
height: auto;
|
||
border-radius: 6px;
|
||
display: block;
|
||
margin: 1em auto;
|
||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||
}
|
||
|
||
// ── 表格 ───────────────────────────────────
|
||
table {
|
||
border-collapse: collapse;
|
||
width: 100%;
|
||
margin: 1em 0;
|
||
font-size: 0.9em;
|
||
border: 1px solid var(--el-border-color);
|
||
border-radius: 6px;
|
||
overflow: hidden;
|
||
th, td {
|
||
padding: 0.6em 1em;
|
||
border: 1px solid var(--el-border-color-lighter);
|
||
text-align: left;
|
||
vertical-align: top;
|
||
}
|
||
th {
|
||
background: var(--el-fill-color-light);
|
||
font-weight: 600;
|
||
color: var(--el-text-color-regular);
|
||
}
|
||
tr:nth-child(even) td { background: var(--el-fill-color-lighter); }
|
||
tr:hover td { background: var(--el-color-primary-light-9); }
|
||
}
|
||
}
|
||
|
||
// 暗色模式:代码块使用深色背景
|
||
html.dark .markdown-body {
|
||
pre {
|
||
background: #161b22;
|
||
border-color: rgba(255, 255, 255, 0.08);
|
||
code { color: #e6edf3; }
|
||
}
|
||
|
||
img { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4); }
|
||
}
|
||
|
||
/* ========================================== */
|
||
|
||
.el-tabs--card.nav-tabs {
|
||
> .el-tabs__header {
|
||
margin-bottom: 0;
|
||
border-bottom: none;
|
||
background: var(--el-bg-color);
|
||
padding: 0 4px;
|
||
border-radius: 8px 8px 0 0;
|
||
|
||
.el-tabs__nav-wrap {
|
||
margin-bottom: 0;
|
||
}
|
||
|
||
.el-tabs__nav {
|
||
border: none;
|
||
}
|
||
|
||
.el-tabs__item {
|
||
height: 36px;
|
||
line-height: 36px;
|
||
padding: 0 16px;
|
||
font-size: var(--el-font-size-small);
|
||
color: var(--el-text-color-secondary);
|
||
border: none;
|
||
border-radius: 6px 6px 0 0;
|
||
margin-right: 2px;
|
||
transition: color 0.2s, background 0.2s;
|
||
position: relative;
|
||
|
||
&:hover {
|
||
color: var(--el-color-primary);
|
||
background: var(--el-color-primary-light-9);
|
||
}
|
||
|
||
&.is-active {
|
||
color: var(--el-color-primary);
|
||
font-weight: var(--el-font-weight-primary);
|
||
background: var(--el-fill-color);
|
||
|
||
&::after {
|
||
content: '';
|
||
position: absolute;
|
||
bottom: 0;
|
||
left: 0;
|
||
right: 0;
|
||
height: 2px;
|
||
background: var(--el-color-primary);
|
||
border-radius: 2px 2px 0 0;
|
||
}
|
||
}
|
||
|
||
.is-icon-close {
|
||
font-size: 11px;
|
||
margin-left: 4px;
|
||
border-radius: 50%;
|
||
transition: background 0.2s;
|
||
|
||
&:hover {
|
||
background: var(--el-color-danger-light-7);
|
||
color: var(--el-color-danger);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
} |