桌面端下载器调优:任务列表信息层级与操作区重排

- 统一 theme.css 视觉变量与卡片、状态标签样式
- DashBoard 与 Side 的任务行重排:状态标签与进度对齐,排序/显示条件更明确
- 新增 AppIcon 图标组件,store 同步空名短标题修复
This commit is contained in:
root
2026-09-20 18:41:09 +08:00
parent c115b6529d
commit e836becda6
6 changed files with 969 additions and 311 deletions
+534 -76
View File
@@ -1,55 +1,100 @@
/* ========== CSS Custom Properties ========== */
/* ========== Design Tokens ========== */
:root {
--bg-body: #f0f2f5;
/* Neutrals: warm-tinted grey, keeps the UI quiet on long sessions. */
--bg-body: #f5f5f4;
--bg-surface: #ffffff;
--bg-card: #ffffff;
--bg-hover: #f5f7fa;
--bg-hover: #f2f2f0;
--bg-sunken: #fafaf9;
--text-primary: #1d2129;
--text-secondary: #86909c;
--text-disabled: #c9cdd4;
--text-primary: #1f2328;
--text-secondary: #6b7280;
--text-disabled: #c2c6cd;
--border-color: #e5e6eb;
--border-color: #e4e4e2;
--border-strong: #d5d6d3;
--border-radius: 8px;
--border-radius-sm: 4px;
--border-radius-sm: 6px;
--shadow-card: 0 1px 4px rgba(0, 0, 0, 0.08);
--shadow-elevated: 0 4px 16px rgba(0, 0, 0, 0.12);
/* Accent: one blue, used for primary actions and progress only. */
--accent: #2563eb;
--accent-hover: #1d4ed8;
--accent-soft: #eff4ff;
--transition-fast: 0.2s ease;
--transition-normal: 0.3s ease;
/* Status colours keep state readable without shouting. */
--status-success: #15803d;
--status-success-soft: #eaf7ee;
--status-warning: #b45309;
--status-warning-soft: #fdf3e3;
--status-info: #1d4ed8;
--status-info-soft: #eaf1fe;
--status-danger: #b42318;
--status-danger-soft: #fdeceb;
--shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
--shadow-elevated: 0 8px 24px rgba(16, 24, 40, 0.12);
--transition-fast: 0.15s ease;
--transition-normal: 0.25s ease;
}
html.dark {
--bg-body: #1a1a2e;
--bg-surface: #16213e;
--bg-card: #1a1a2e;
--bg-hover: #1f2b47;
--bg-body: #12141a;
--bg-surface: #191c23;
--bg-card: #191c23;
--bg-hover: #22262f;
--bg-sunken: #15181e;
--text-primary: #e5e6eb;
--text-secondary: #8b95a5;
--text-disabled: #4e5969;
--text-primary: #e8eaee;
--text-secondary: #9aa3b2;
--text-disabled: #565d69;
--border-color: #2c3e50;
--shadow-card: 0 1px 4px rgba(0, 0, 0, 0.3);
--shadow-elevated: 0 4px 16px rgba(0, 0, 0, 0.4);
--border-color: #2a2f3a;
--border-strong: #363c49;
--accent: #3b82f6;
--accent-hover: #60a5fa;
--accent-soft: #1c2534;
--status-success: #4ade80;
--status-success-soft: #16281d;
--status-warning: #fbbf24;
--status-warning-soft: #2a2113;
--status-info: #60a5fa;
--status-info-soft: #172234;
--status-danger: #f87171;
--status-danger-soft: #2b1a1a;
--shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
--shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.5);
}
/* ========== Global Base ========== */
* {
box-sizing: border-box;
}
html,
body,
#app {
height: 100%;
}
body {
margin: 0;
padding: 0;
background-color: var(--bg-body);
color: var(--text-primary);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
font-size: 16px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
"PingFang SC", "Microsoft YaHei", Arial, sans-serif;
font-size: 14px;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
transition: background-color var(--transition-normal), color var(--transition-normal);
}
#app {
min-height: 100vh;
background-color: var(--bg-body);
transition: background-color var(--transition-normal);
min-height: 100%;
}
/* ========== Auth Screen ========== */
@@ -60,116 +105,529 @@ body {
display: flex;
justify-content: center;
align-items: center;
padding: 24px;
background: var(--bg-body);
}
.auth-card {
background: var(--bg-surface);
border-radius: 16px;
border: 1px solid var(--border-color);
border-radius: 12px;
box-shadow: var(--shadow-elevated);
padding: 56px 48px 44px;
width: 440px;
max-width: 90vw;
text-align: center;
padding: 40px 36px 32px;
width: 400px;
max-width: 100%;
}
.auth-card h1 {
margin: 0 0 8px;
font-size: 32px;
.auth-brand {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 24px;
}
.auth-brand .auth-mark {
display: inline-flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: 8px;
background: var(--accent);
color: #fff;
font-size: 15px;
font-weight: 700;
flex: none;
}
.auth-brand .auth-name {
font-size: 17px;
font-weight: 600;
color: var(--text-primary);
}
.auth-card h1 {
margin: 0 0 6px;
font-size: 20px;
font-weight: 600;
color: var(--text-primary);
text-align: left;
}
.auth-card .auth-subtitle {
margin: 0 0 36px;
font-size: 15px;
margin: 0 0 24px;
font-size: 13px;
color: var(--text-secondary);
text-align: left;
}
.auth-card .auth-form {
display: flex;
flex-direction: column;
gap: 18px;
gap: 14px;
}
.auth-card .auth-form .el-checkbox {
height: auto;
}
.auth-card .auth-btn {
width: 100%;
font-size: 15px;
padding: 12px 0;
margin-top: 4px;
}
/* ========== Dashboard Grid ========== */
.dashboard {
padding: 24px;
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 16px;
height: 100%;
/* ========== Page Shell ========== */
.app-layout {
height: 100vh;
overflow: hidden;
box-sizing: border-box;
}
.side-area {
background: var(--bg-surface);
border-right: 1px solid var(--border-color);
display: flex;
flex-direction: column;
overflow: hidden;
}
.main-area {
padding: 0;
overflow-y: auto;
overflow-x: hidden;
background-color: var(--bg-body);
}
.section-title {
margin: 0;
font-size: 12px;
font-weight: 600;
color: var(--text-secondary);
letter-spacing: 0.04em;
text-transform: uppercase;
}
/* ========== Task List (left column) ========== */
.scroll-panel {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
padding: 16px 16px 0;
overflow: hidden;
}
.panel-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding-bottom: 12px;
flex: none;
}
.panel-head .head-meta {
font-size: 12px;
color: var(--text-secondary);
white-space: nowrap;
}
.panel-head .panel-head-spacer {
flex: 1;
min-width: 8px;
}
.table-scroll {
flex: 1;
min-height: 0;
}
.task-table {
width: 100%;
}
.task-table .el-table__cell {
padding: 10px 0;
}
.task-table .el-table__body-wrapper,
.task-table .el-table__header-wrapper {
overflow-x: hidden;
}
.task-table .cell {
padding-left: 10px;
padding-right: 10px;
}
.task-name {
font-size: 14px;
color: var(--text-primary);
line-height: 1.45;
word-break: break-word;
/* Two-line clamp keeps every row the same height for easy scanning. */
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.task-size {
display: block;
margin-top: 2px;
font-size: 12px;
color: var(--text-secondary);
}
.row-actions {
display: flex;
flex-wrap: wrap;
gap: 6px;
align-items: center;
}
.status-pill {
display: inline-flex;
align-items: center;
height: 22px;
padding: 0 8px;
border-radius: 999px;
font-size: 12px;
font-weight: 500;
white-space: nowrap;
}
.status-pill.is-done {
color: var(--status-success);
background: var(--status-success-soft);
}
.status-pill.is-running {
color: var(--status-info);
background: var(--status-info-soft);
}
.status-pill.is-waiting {
color: var(--status-warning);
background: var(--status-warning-soft);
}
.state-cell {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 5px;
}
.state-cell .el-progress {
width: 100%;
}
.state-cell .progress-value {
font-size: 12px;
color: var(--text-secondary);
font-variant-numeric: tabular-nums;
}
.detail-info {
display: grid;
grid-template-columns: 84px 1fr;
gap: 4px 12px;
padding: 10px 12px 12px 44px;
font-size: 13px;
line-height: 1.7;
}
.detail-info dt {
color: var(--text-secondary);
}
.detail-info dd {
margin: 0;
color: var(--text-primary);
word-break: break-all;
}
.detail-actions {
grid-column: 1 / -1;
padding-top: 8px;
}
/* ========== Toolbar under the list ========== */
.list-toolbar {
flex: none;
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
padding: 12px 0 16px;
margin-top: 12px;
border-top: 1px solid var(--border-color);
}
.list-toolbar .toolbar-spacer {
flex: 1;
min-width: 8px;
}
.pager {
display: inline-flex;
align-items: center;
gap: 4px;
}
.pager .el-button + .el-button {
margin-left: 0;
}
.pager-readout {
display: inline-flex;
align-items: center;
gap: 6px;
margin: 0 6px;
font-size: 13px;
color: var(--text-secondary);
font-variant-numeric: tabular-nums;
}
.pager-readout .page-total {
white-space: nowrap;
}
button.page-current {
min-width: 34px;
height: 24px;
padding: 0 6px;
border: 1px solid var(--border-color);
border-radius: var(--border-radius-sm);
background: var(--bg-surface);
color: var(--text-primary);
font-size: 13px;
font-weight: 600;
font-family: inherit;
font-variant-numeric: tabular-nums;
cursor: pointer;
transition: border-color var(--transition-fast), color var(--transition-fast);
}
button.page-current:hover {
border-color: var(--accent);
color: var(--accent);
}
.page-input {
width: 56px;
}
/* Icon-only row actions keep the operation column narrow. */
.row-actions .el-button.is-circle,
.row-actions .el-button {
width: 32px;
height: 32px;
padding: 0;
}
.row-actions .el-button + .el-button {
margin-left: 0;
}
.row-actions .el-button.is-collected {
color: var(--status-warning);
border-color: var(--status-warning);
background: var(--status-warning-soft);
}
/* ========== Main column ========== */
.dashboard {
display: flex;
flex-direction: column;
gap: 16px;
width: 100%;
max-width: 1100px;
margin: 0 auto;
padding: 20px;
}
.dashboard-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 16px;
align-items: start;
}
.control-card {
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
box-shadow: var(--shadow-card);
padding: 24px;
transition: box-shadow var(--transition-fast);
align-self: start;
padding: 16px;
}
.control-card:hover {
box-shadow: var(--shadow-elevated);
}
.card-wide {
grid-column: 1 / -1;
}
.control-card h3 {
margin: 0 0 16px;
font-size: 13px;
font-weight: 600;
color: var(--text-secondary);
text-transform: uppercase;
letter-spacing: 0.5px;
.control-card .card-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 12px;
}
.control-card .card-row {
display: flex;
flex-wrap: wrap;
gap: 12px;
gap: 8px;
align-items: center;
}
.control-card .usage-text {
font-size: 15px;
.usage-line {
display: flex;
flex-wrap: wrap;
align-items: baseline;
gap: 4px 14px;
}
.usage-line .usage-value {
font-size: 22px;
font-weight: 600;
color: var(--text-primary);
line-height: 1.6;
font-variant-numeric: tabular-nums;
}
.control-card .thumbnail-body {
text-align: center;
.usage-line .usage-note {
font-size: 12px;
color: var(--text-secondary);
}
.control-card .gallery-name {
margin: 0 0 12px;
font-size: 14px;
.setting-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
font-size: 13px;
color: var(--text-primary);
}
.thumbnail-body {
display: flex;
flex-direction: column;
gap: 10px;
}
.thumbnail-body .gallery-name {
margin: 0;
font-size: 13px;
color: var(--text-secondary);
word-break: break-all;
}
/* ========== Element Plus Overrides ========== */
/* increase default button/input text size */
.thumbnail-frame {
background: var(--bg-sunken);
border-radius: var(--border-radius-sm);
overflow: hidden;
}
/* ========== Dialogs ========== */
.detail-layout {
display: grid;
grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
gap: 20px;
align-items: start;
}
.detail-thumb {
width: 100%;
height: 200px;
border-radius: var(--border-radius-sm);
background: var(--bg-sunken);
}
.detail-list {
display: grid;
grid-template-columns: 72px minmax(0, 1fr);
gap: 6px 12px;
margin: 0;
font-size: 13px;
line-height: 1.6;
}
.detail-list dt {
color: var(--text-secondary);
}
.detail-list dd {
margin: 0;
color: var(--text-primary);
word-break: break-word;
}
.mono-value {
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 13px;
word-break: break-all;
}
.config-form .section-title {
margin: 20px 0 12px;
}
.config-form .section-title:first-child {
margin-top: 0;
}
.config-form .el-form-item {
margin-bottom: 14px;
}
.field-hint {
margin-left: 10px;
font-size: 12px;
color: var(--text-secondary);
}
/* ========== Element Plus harmonisation ========== */
.el-button {
font-weight: 500;
}
.el-button--small {
font-size: 13px;
}
.el-button--primary {
--el-button-bg-color: var(--accent);
--el-button-border-color: var(--accent);
--el-button-hover-bg-color: var(--accent-hover);
--el-button-hover-border-color: var(--accent-hover);
}
.el-select {
font-size: 13px;
}
.el-input__inner {
font-size: 14px;
}
.el-table {
font-size: 14px;
--el-table-border-color: var(--border-color);
--el-table-header-bg-color: var(--bg-surface);
--el-table-row-hover-bg-color: var(--bg-hover);
}
.el-table th.el-table__cell {
background-color: var(--bg-surface);
font-size: 12px;
font-weight: 600;
color: var(--text-secondary);
text-transform: uppercase;
letter-spacing: 0.03em;
}
.el-dialog {
border-radius: 12px;
}
.el-dialog__title {
font-size: 16px;
font-weight: 600;
}