Files
zkxw/docs/mockups/ui-richness-shared.css
2026-06-14 09:14:11 +08:00

863 lines
19 KiB
CSS
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* UI 丰富度对比 Demo · 共享样式(Fresh Mint Token) */
:root {
--primary: #10b981;
--primary-dark: #059669;
--primary-bg: #ecfdf5;
--text: #1e293b;
--text-muted: #64748b;
--border: #d9e8e2;
--bg-page: #fefefe;
--surface: #ffffff;
--table-head: #f8fafc;
--row-alt: #fafafa;
--row-hover: #f1f5f9;
--shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
--radius: 10px;
--content-padding: 24px;
--warn: #d97706;
--warn-bg: #fffbeb;
--danger: #dc2626;
--danger-bg: #fef2f2;
}
* { box-sizing: border-box; }
body {
margin: 0;
min-height: 100vh;
font-family: Inter, -apple-system, sans-serif;
font-size: 14px;
line-height: 1.5;
color: var(--text);
background: var(--bg-page);
}
/* 顶部说明条(每个 demo 页) */
.demo-banner {
position: sticky;
top: 0;
z-index: 100;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 10px 20px;
background: #0f172a;
color: #e2e8f0;
font-size: 13px;
}
.demo-banner strong { color: #6ee7b7; font-weight: 600; }
.demo-banner a {
color: #a7f3d0;
text-decoration: none;
font-weight: 600;
}
.demo-banner a:hover { text-decoration: underline; }
.demo-banner .level-tag {
display: inline-flex;
align-items: center;
padding: 2px 10px;
border-radius: 999px;
font-size: 11px;
font-weight: 700;
letter-spacing: 0.02em;
}
.level-L1 { background: #334155; color: #cbd5e1; }
.level-L2 { background: #065f46; color: #a7f3d0; }
.level-L3 { background: #047857; color: #ecfdf5; }
.page-wrap {
max-width: 1280px;
margin: 0 auto;
padding: var(--content-padding);
}
.page-head { margin-bottom: 16px; }
.page-head h1 {
margin: 0 0 4px;
font-size: 20px;
font-weight: 700;
letter-spacing: -0.02em;
}
.page-desc {
margin: 0;
color: var(--text-muted);
font-size: 13px;
line-height: 1.45;
max-width: 640px;
}
/* 标题竖条(规范 title-bar-heading) */
.title-bar-heading {
margin: 0;
font-size: 14px;
font-weight: 600;
display: flex;
align-items: center;
gap: 8px;
}
.title-bar-heading::before {
content: "";
width: 3px;
height: 16px;
border-radius: 2px;
background: var(--primary);
flex-shrink: 0;
}
.panel {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
box-shadow: var(--shadow);
overflow: hidden;
}
.panel-top {
padding: 10px 16px;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
}
.panel-top h2 {
margin: 0;
font-size: 14px;
font-weight: 600;
display: flex;
align-items: center;
gap: 8px;
}
.panel-ic {
width: 18px;
height: 18px;
color: var(--primary-dark);
flex-shrink: 0;
}
.filter-block {
padding: 12px 16px 10px;
border-bottom: 1px solid var(--border);
}
.filter-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px 14px;
margin-bottom: 10px;
}
@media (max-width: 900px) {
.filter-grid { grid-template-columns: repeat(2, 1fr); }
}
.filter-field label {
display: block;
font-size: 11px;
font-weight: 500;
color: var(--text-muted);
margin-bottom: 4px;
}
.input, .select {
width: 100%;
height: 36px;
padding: 0 12px;
border: 1px solid var(--border);
border-radius: 8px;
font-size: 14px;
font-family: inherit;
color: var(--text);
background: var(--surface);
}
.input:focus, .select:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.filter-actions-row {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 10px;
}
.filter-hint {
margin: 0;
font-size: 11px;
color: var(--text-muted);
}
.filter-actions-end { display: flex; gap: 8px; }
.list-toolbar {
padding: 10px 16px;
border-bottom: 1px solid var(--border);
background: var(--table-head);
}
.list-toolbar-row {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
}
.sel-num { color: var(--primary-dark); font-weight: 700; }
.btn {
height: 36px;
padding: 0 14px;
border-radius: 8px;
font-size: 14px;
font-weight: 600;
font-family: inherit;
cursor: pointer;
border: 1px solid var(--border);
background: var(--surface);
color: var(--text);
display: inline-flex;
align-items: center;
gap: 6px;
}
.btn-main {
background: var(--primary);
border-color: var(--primary);
color: #fff;
}
.btn-ghost { background: var(--surface); }
.btn-op {
height: 28px;
padding: 0 10px;
font-size: 12px;
border-radius: 6px;
}
.btn-op.primary {
background: var(--primary-bg);
border-color: rgba(16, 185, 129, 0.3);
color: var(--primary-dark);
}
.ic { width: 16px; height: 16px; flex-shrink: 0; }
.list-body { padding: 0; }
.data-table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
}
.data-table th {
padding: 10px 12px;
text-align: center;
font-weight: 600;
font-size: 12px;
color: var(--text-muted);
background: var(--table-head);
border-bottom: 1px solid var(--border);
}
.data-table td {
padding: 10px 12px;
text-align: center;
border-bottom: 1px solid var(--border);
}
.data-table tbody tr:nth-child(even) { background: var(--row-alt); }
.data-table tbody tr:hover { background: var(--row-hover); }
.data-table .cell-left { text-align: left; }
.list-pager-bar {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 8px;
padding: 10px 16px;
border-top: 1px solid var(--border);
font-size: 13px;
color: var(--text-muted);
}
.tag {
display: inline-flex;
align-items: center;
padding: 2px 8px;
border-radius: 999px;
font-size: 12px;
font-weight: 600;
line-height: 1.4;
}
.tag.success { background: var(--primary-bg); color: var(--primary-dark); }
.tag.warning { background: var(--warn-bg); color: var(--warn); }
.tag.danger { background: var(--danger-bg); color: var(--danger); }
.tag.muted { background: var(--table-head); color: var(--text-muted); }
.tag.info { background: #eff6ff; color: #2563eb; }
/* 统计卡 */
.stats {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 12px;
margin-bottom: 16px;
}
.stat {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 12px 14px;
box-shadow: var(--shadow);
display: flex;
flex-direction: column;
gap: 8px;
min-height: 108px;
}
.stat-hd { display: flex; }
.stat-ic {
width: 44px;
height: 44px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
background: var(--primary-bg);
color: var(--primary-dark);
border: 1px solid rgba(16, 185, 129, 0.12);
}
.stat-ic svg { width: 24px; height: 24px; }
.stat-main {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 10px;
flex: 1;
}
.stat .k { font-size: 14px; font-weight: 600; margin: 0; }
.stat-side { text-align: right; margin-left: auto; }
.stat .v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat .hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.stat.warn .stat-ic { background: var(--warn-bg); border-color: rgba(217, 119, 6, 0.2); color: var(--warn); }
.stat.warn .v, .stat.warn .hint { color: var(--warn); }
.alert-bar {
display: flex;
align-items: flex-start;
gap: 10px;
padding: 10px 14px;
margin-bottom: 16px;
border-radius: var(--radius);
border: 1px solid #fde68a;
background: var(--warn-bg);
font-size: 13px;
color: #92400e;
}
.alert-bar svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: var(--warn); }
/* 快捷入口 */
.quick-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
gap: 12px;
padding: 20px 24px 24px;
}
.quick-card {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
padding: 16px 12px;
border: 1px solid var(--border);
border-radius: var(--radius);
background: var(--surface);
cursor: pointer;
transition: border-color 0.15s, background 0.15s;
text-decoration: none;
color: var(--text);
}
.quick-card:hover {
border-color: var(--primary);
background: var(--primary-bg);
}
.quick-card-ic {
width: 40px;
height: 40px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
background: var(--primary-bg);
color: var(--primary-dark);
}
.quick-card-ic svg { width: 22px; height: 22px; }
.quick-card span { font-size: 13px; font-weight: 600; }
/* 图表占位 */
.chart-panel { padding: 16px; }
.chart-panel h3 {
margin: 0 0 12px;
font-size: 14px;
font-weight: 600;
}
.chart-bars {
display: flex;
align-items: flex-end;
gap: 6px;
height: 120px;
padding-top: 8px;
}
.chart-bar {
flex: 1;
min-width: 0;
border-radius: 4px 4px 0 0;
background: linear-gradient(180deg, var(--primary) 0%, rgba(16, 185, 129, 0.35) 100%);
opacity: 0.85;
}
.trend-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
margin-bottom: 16px;
}
@media (max-width: 900px) {
.trend-grid { grid-template-columns: 1fr; }
}
/* 复合列 */
.cell-composite {
display: flex;
align-items: center;
gap: 10px;
text-align: left;
}
.avatar {
width: 32px;
height: 32px;
border-radius: 50%;
background: var(--primary-bg);
color: var(--primary-dark);
font-size: 13px;
font-weight: 700;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.thumb {
width: 40px;
height: 40px;
border-radius: 8px;
object-fit: cover;
flex-shrink: 0;
background: var(--row-alt);
}
.cell-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.progress-wrap { min-width: 100px; }
.progress-bar {
height: 6px;
border-radius: 999px;
background: var(--row-hover);
overflow: hidden;
}
.progress-fill {
height: 100%;
border-radius: 999px;
background: var(--primary);
}
.progress-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
/* 详情 Hero */
.view-hero {
display: flex;
flex-wrap: wrap;
gap: 16px;
padding: 16px;
margin-bottom: 16px;
border-radius: var(--radius);
border: 1px solid var(--border);
background: linear-gradient(135deg, var(--primary-bg) 0%, var(--surface) 55%);
}
.view-hero-img {
width: 72px;
height: 72px;
border-radius: 10px;
object-fit: cover;
border: 1px solid var(--border);
}
.view-hero-main h2 { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.view-hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.view-hero-meta { margin: 0; font-size: 13px; color: var(--text-muted); }
.detail-section {
margin-bottom: 12px;
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
}
.detail-section-hd {
padding: 10px 14px;
background: var(--table-head);
border-bottom: 1px solid var(--border);
font-size: 13px;
font-weight: 600;
}
.detail-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 0;
}
.detail-item {
padding: 10px 14px;
border-bottom: 1px solid var(--border);
border-right: 1px solid var(--border);
}
.detail-item:nth-child(2n) { border-right: none; }
.detail-item .lbl { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.detail-item .val { font-size: 14px; font-weight: 500; }
.dim-note {
margin: 16px 0 0;
padding: 12px 14px;
border-radius: var(--radius);
border: 1px dashed var(--border);
background: var(--table-head);
font-size: 12px;
color: var(--text-muted);
line-height: 1.6;
}
.dim-note strong { color: var(--text); }
.level-PAT {
background: #6366f1;
color: #eef2ff;
}
/* 空状态 */
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 48px 24px;
text-align: center;
}
.empty-ic {
width: 72px;
height: 72px;
border-radius: 16px;
display: flex;
align-items: center;
justify-content: center;
background: var(--primary-bg);
color: var(--primary-dark);
margin-bottom: 16px;
border: 1px dashed rgba(16, 185, 129, 0.35);
}
.empty-ic svg { width: 36px; height: 36px; }
.empty-state h3 { margin: 0 0 8px; font-size: 16px; }
.empty-state p { margin: 0 0 16px; max-width: 360px; color: var(--text-muted); font-size: 13px; }
/* 卡片网格列表 */
.card-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
gap: 14px;
padding: 16px;
}
.entity-card {
border: 1px solid var(--border);
border-radius: var(--radius);
background: var(--surface);
overflow: hidden;
transition: border-color 0.15s, box-shadow 0.15s;
}
.entity-card:hover {
border-color: rgba(16, 185, 129, 0.45);
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08);
}
.entity-card-cover {
height: 120px;
background: linear-gradient(135deg, var(--primary-bg), #f8fafc);
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.entity-card-cover img {
width: 100%;
height: 100%;
object-fit: cover;
}
.entity-card-body { padding: 14px; }
.entity-card-title { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.entity-card-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.entity-card-ft {
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 10px;
border-top: 1px solid var(--border);
}
/* 时间线 / 动态 */
.timeline { padding: 16px 20px; }
.timeline-item {
display: flex;
gap: 14px;
padding-bottom: 18px;
position: relative;
}
.timeline-item:not(:last-child)::before {
content: "";
position: absolute;
left: 15px;
top: 32px;
bottom: 0;
width: 2px;
background: var(--border);
}
.timeline-dot {
width: 32px;
height: 32px;
border-radius: 50%;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
background: var(--primary-bg);
color: var(--primary-dark);
border: 2px solid var(--surface);
box-shadow: 0 0 0 1px var(--border);
z-index: 1;
}
.timeline-dot svg { width: 14px; height: 14px; }
.timeline-dot.warn { background: var(--warn-bg); color: var(--warn); }
.timeline-body { flex: 1; min-width: 0; }
.timeline-body strong { display: block; font-size: 13px; margin-bottom: 4px; }
.timeline-body p { margin: 0; font-size: 12px; color: var(--text-muted); }
.timeline-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
/* 看板 */
.kanban {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 12px;
padding: 16px;
overflow-x: auto;
}
@media (max-width: 1100px) {
.kanban { grid-template-columns: repeat(2, 1fr); }
}
.kanban-col {
min-width: 0;
background: var(--table-head);
border: 1px solid var(--border);
border-radius: var(--radius);
display: flex;
flex-direction: column;
max-height: 480px;
}
.kanban-col-hd {
padding: 10px 12px;
border-bottom: 1px solid var(--border);
font-size: 13px;
font-weight: 600;
display: flex;
align-items: center;
justify-content: space-between;
}
.kanban-count {
font-size: 11px;
font-weight: 700;
padding: 2px 8px;
border-radius: 999px;
background: var(--surface);
color: var(--text-muted);
}
.kanban-list {
padding: 10px;
overflow-y: auto;
flex: 1;
display: flex;
flex-direction: column;
gap: 8px;
}
.kanban-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 8px;
padding: 10px 12px;
cursor: pointer;
transition: border-color 0.15s;
}
.kanban-card:hover { border-color: var(--primary); }
.kanban-card-id { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.kanban-card-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.kanban-card-ft { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* 分区表单 */
.form-sections { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.form-section-card {
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
}
.form-section-hd {
padding: 10px 14px;
background: var(--table-head);
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
gap: 8px;
font-size: 13px;
font-weight: 600;
}
.form-section-hd svg { width: 16px; height: 16px; color: var(--primary-dark); }
.form-section-bd {
padding: 14px;
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 12px 16px;
}
@media (max-width: 640px) {
.form-section-bd { grid-template-columns: 1fr; }
}
.form-field label {
display: block;
font-size: 11px;
color: var(--text-muted);
margin-bottom: 4px;
}
.form-field.full { grid-column: 1 / -1; }
/* 媒体画廊 */
.media-gallery {
display: grid;
grid-template-columns: 2fr 1fr;
gap: 12px;
padding: 16px;
}
@media (max-width: 720px) {
.media-gallery { grid-template-columns: 1fr; }
}
.media-main {
aspect-ratio: 4/3;
border-radius: var(--radius);
overflow: hidden;
border: 1px solid var(--border);
background: var(--row-alt);
}
.media-main img { width: 100%; height: 100%; object-fit: cover; }
.media-thumbs {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
}
.media-thumb {
aspect-ratio: 1;
border-radius: 8px;
overflow: hidden;
border: 2px solid transparent;
cursor: pointer;
opacity: 0.75;
}
.media-thumb.is-active { border-color: var(--primary); opacity: 1; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
/* 左右分栏 */
.split-layout {
display: grid;
grid-template-columns: 280px 1fr;
gap: 12px;
padding: 16px;
min-height: 420px;
}
@media (max-width: 900px) {
.split-layout { grid-template-columns: 1fr; }
}
.split-tree {
border: 1px solid var(--border);
border-radius: var(--radius);
background: var(--table-head);
overflow: hidden;
}
.split-tree-hd {
padding: 10px 12px;
border-bottom: 1px solid var(--border);
font-size: 13px;
font-weight: 600;
}
.tree-node {
padding: 8px 12px 8px 20px;
font-size: 13px;
cursor: pointer;
border-left: 3px solid transparent;
}
.tree-node:hover { background: var(--row-hover); }
.tree-node.is-active {
background: var(--primary-bg);
border-left-color: var(--primary);
color: var(--primary-dark);
font-weight: 600;
}
.tree-node.child { padding-left: 36px; font-size: 12px; }
.split-detail { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
/* 步骤条 */
.steps {
display: flex;
align-items: flex-start;
gap: 0;
padding: 16px 20px;
border-bottom: 1px solid var(--border);
overflow-x: auto;
}
.step {
flex: 1;
min-width: 120px;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
position: relative;
}
.step:not(:last-child)::after {
content: "";
position: absolute;
top: 14px;
left: calc(50% + 18px);
right: calc(-50% + 18px);
height: 2px;
background: var(--border);
}
.step.done:not(:last-child)::after { background: var(--primary); }
.step-ic {
width: 28px;
height: 28px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
background: var(--row-hover);
color: var(--text-muted);
font-size: 12px;
font-weight: 700;
margin-bottom: 8px;
z-index: 1;
}
.step.done .step-ic { background: var(--primary); color: #fff; }
.step.active .step-ic {
background: var(--primary-bg);
color: var(--primary-dark);
box-shadow: 0 0 0 2px var(--primary);
}
.step-label { font-size: 12px; font-weight: 600; }
.step-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
/* 并排对比 */
.compare-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
margin-bottom: 16px;
}
@media (max-width: 900px) {
.compare-row { grid-template-columns: 1fr; }
}
.compare-col h3 {
margin: 0 0 10px;
font-size: 13px;
font-weight: 600;
color: var(--text-muted);
}
.compare-col.plain h3 { color: #94a3b8; }
.compare-col.rich h3 { color: var(--primary-dark); }