20260819213933

This commit is contained in:
oneao committed 2026-08-19 21:39:33 +08:00
1 parent a0a4273f4c
commit 8e75c7989a
27 files changed
+3852 -2434

No files matched your search

-521
View File
@@ -1,528 +1,7 @@
@import "tailwindcss";
/* ===== Design Tokens ===== */
@theme {
/* 统一品牌主色(与 JSX 中的 blue-600 保持一致,消除 blue-500/blue-600 混用) */
--color-primary: #2563eb; /* blue-600 */
--color-primary-hover: #1d4ed8; /* blue-700 */
--color-accent: #2563eb;
}
/* ===== Base ===== */
html,
body,
#root {
height: 100%;
}
body {
margin: 0;
background: #f8fafc;
color: #334155;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
"Hiragino Sans GB", "Microsoft YaHei", sans-serif;
-webkit-font-smoothing: antialiased;
}
/* ===== Card ===== */
.card {
background: #fff;
border: 1px solid #f1f5f9;
border-radius: 12px;
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
/* ===== Segmented control(复用组件,三处切换统一) ===== */
.seg {
display: flex;
gap: 3px;
padding: 3px;
background: #f1f5f9; /* slate-100 */
border-radius: 6px;
}
.seg-btn {
flex: 1;
padding: 6px 10px;
font-size: 11px;
font-weight: 500;
line-height: 1;
border: none;
border-radius: 4px;
background: transparent;
color: #64748b; /* slate-500 */
cursor: pointer;
transition: all 0.15s;
}
.seg-btn:hover {
color: #334155; /* slate-700 */
}
.seg-btn.active {
background: #fff;
color: var(--color-primary);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
/* ===== Buttons ===== */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 4px;
border: 1px solid transparent;
border-radius: 6px;
font-size: 12px;
font-weight: 500;
line-height: 1;
padding: 6px 12px;
cursor: pointer;
white-space: nowrap;
transition: all 0.15s;
}
.btn-primary {
background: var(--color-primary);
color: #fff;
}
.btn-primary:hover {
background: var(--color-primary-hover);
}
.btn-outline {
border-color: #e2e8f0; /* slate-200 */
background: #fff;
color: #475569; /* slate-600 */
}
.btn-outline:hover {
border-color: #cbd5e1;
background: #f8fafc;
}
.btn-ghost {
background: transparent;
color: #64748b;
}
.btn-ghost:hover {
background: #f1f5f9;
color: #334155;
}
/* ===== Inputs ===== */
.input,
.input-sm,
.select-sm {
width: 100%;
border: 1px solid #e2e8f0;
border-radius: 6px;
padding: 7px 10px;
font-size: 13px;
color: #334155;
background: #fff;
outline: none;
transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus,
.input-sm:focus,
.select-sm:focus {
border-color: var(--color-primary);
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.input-sm {
padding: 5px 8px;
font-size: 12px;
}
/* ===== Toggle switch(div 实现,旋钮用 ::after;.on 表示开启) ===== */
.toggle {
position: relative;
display: inline-block;
flex-shrink: 0;
width: 40px;
height: 22px;
margin: 0;
padding: 0;
border: none;
border-radius: 9999px;
background: #cbd5e1; /* slate-300 */
cursor: default;
pointer-events: none;
transition: background 0.2s;
}
.toggle::after {
content: "";
position: absolute;
top: 2px;
left: 2px;
width: 18px;
height: 18px;
background: #fff;
border-radius: 9999px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
transition: transform 0.2s;
}
.toggle.on {
background: var(--color-primary);
}
.toggle.on::after {
transform: translateX(18px);
}
/* ===== Thin scrollbar ===== */
.thin-scroll::-webkit-scrollbar {
width: 6px;
height: 6px;
}
.thin-scroll::-webkit-scrollbar-thumb {
background: #e2e8f0;
border-radius: 3px;
}
.thin-scroll::-webkit-scrollbar-track {
background: transparent;
}
/* ===== Drawer(桌面端右侧抽屉) ===== */
.drawer-mask {
position: fixed;
inset: 0;
z-index: 50;
background: rgba(15, 23, 42, 0.45);
opacity: 0;
visibility: hidden;
transition: opacity 0.25s, visibility 0.25s;
}
.drawer-mask.open {
opacity: 1;
visibility: visible;
}
.drawer {
position: absolute;
top: 0;
right: 0;
height: 100%;
width: 420px;
max-width: 92vw;
margin: 0;
padding: 20px;
background: #fff;
border-radius: 0;
box-shadow: -8px 0 24px rgba(15, 23, 42, 0.12);
display: flex;
flex-direction: column;
transform: translateX(100%);
transition: transform 0.25s;
}
.drawer-mask.open .drawer {
transform: translateX(0);
}
.drawer-head {
display: flex;
align-items: flex-start;
justify-content: space-between;
margin-bottom: 6px;
}
.drawer-close {
border: none;
background: transparent;
font-size: 22px;
line-height: 1;
color: #94a3b8;
cursor: pointer;
}
.drawer-body {
max-height: 60vh;
padding: 12px 0;
overflow: auto;
}
.drawer-foot {
display: flex;
justify-content: flex-end;
gap: 8px;
padding-top: 12px;
border-top: 1px solid #f1f5f9;
}
.form-row {
margin-bottom: 14px;
}
.form-row label {
display: block;
margin-bottom: 5px;
font-size: 11px;
color: #94a3b8;
}
/* ===== Field list & preview overlays ===== */
.field-row {
border-left: 3px solid transparent;
cursor: pointer;
transition: background 0.1s, border-color 0.1s;
}
.field-row:hover {
background: #f8fafc;
}
.field-row.active {
background: #eff6ff; /* blue-50 */
border-left-color: var(--color-primary);
}
.drag-handle {
cursor: grab;
opacity: 0;
flex-shrink: 0;
transition: opacity 0.1s;
}
.field-row:hover .drag-handle,
.field-row.active .drag-handle {
opacity: 1;
}
.drag-handle:active {
cursor: grabbing;
}
.preview-field {
position: relative;
border-radius: 8px;
transition: all 0.15s;
}
.preview-field.highlight {
background: #eff6ff;
}
.preview-field.highlight::before {
content: "";
position: absolute;
left: -8px;
top: 0;
bottom: 0;
width: 3px;
border-radius: 2px;
background: var(--color-primary);
}
.group-block {
border: 1px dashed #e2e8f0;
border-radius: 8px;
margin-bottom: 12px;
transition: border-color 0.15s, background 0.15s;
}
.group-block:hover {
border-color: #cbd5e1;
}
.group-block.highlight-group {
border-color: var(--color-primary);
background: #fafbff;
}
.col-resize-handle {
position: absolute;
right: 0;
top: 0;
bottom: 0;
width: 5px;
cursor: col-resize;
z-index: 10;
}
.col-resize-handle:hover,
.col-resize-handle.active {
background: var(--color-primary);
}
/* ===== Field config table(右侧字段配置) ===== */
.field-config {
padding: 4px 4px 8px;
}
.fc-head {
display: flex;
align-items: center;
justify-content: space-between;
padding: 4px 8px 12px;
}
.fc-head h3 {
font-size: 14px;
font-weight: 600;
color: #334155;
margin: 0;
}
.fc-head .muted {
color: #94a3b8;
font-weight: 400;
font-size: 12px;
}
.table-scroll {
overflow: auto;
max-height: 100%;
}
.field-table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
}
.field-table th {
position: sticky;
top: 0;
background: #fff;
z-index: 2;
text-align: center;
font-weight: 500;
color: #94a3b8;
padding: 8px 6px;
border-bottom: 1px solid #f1f5f9;
white-space: nowrap;
}
.field-table td {
padding: 6px 6px;
border-bottom: 1px solid #f8fafc;
vertical-align: middle;
}
.field-table tr.active > td {
background: #eff6ff;
}
.field-table select,
.field-table .cell-input {
border: 1px solid #e2e8f0;
border-radius: 6px;
padding: 4px 6px;
font-size: 12px;
width: 100%;
background: #fff;
color: #334155;
outline: none;
}
.cell-input:focus {
border-color: var(--color-primary);
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.cell-input.code {
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
color: #64748b;
}
.cell-group {
display: inline-block;
padding: 2px 8px;
border-radius: 9999px;
background: #f1f5f9;
color: #64748b;
font-size: 11px;
}
.move-btns {
display: inline-flex;
flex-direction: column;
gap: 2px;
}
.move-btns button {
border: none;
background: transparent;
color: #94a3b8;
cursor: pointer;
font-size: 11px;
line-height: 1;
padding: 0 2px;
}
.move-btns button:hover {
color: var(--color-primary);
}
.group-row > td {
background: #f8fafc;
padding: 8px 10px;
border-bottom: 1px solid #f1f5f9;
}
.group-name {
font-weight: 600;
color: #475569;
font-size: 13px;
}
.group-edit {
margin-left: 6px;
border: none;
background: transparent;
color: #94a3b8;
cursor: pointer;
}
.group-edit:hover {
color: var(--color-primary);
}
.group-count {
margin-left: 8px;
font-size: 11px;
color: #94a3b8;
}
.group-input {
border: 1px solid var(--color-primary);
border-radius: 6px;
padding: 4px 8px;
font-size: 13px;
width: 220px;
outline: none;
}
.add-row {
width: 100%;
text-align: center;
border: 1px dashed #e2e8f0;
background: transparent;
color: #94a3b8;
padding: 8px;
border-radius: 8px;
cursor: pointer;
font-size: 12px;
}
.add-row:hover {
border-color: var(--color-primary);
color: var(--color-primary);
}
.detail-row > td {
background: #fafbff;
padding: 12px;
border-bottom: 1px solid #f1f5f9;
}
.detail-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
gap: 10px;
}
.detail-grid label {
display: block;
font-size: 11px;
color: #94a3b8;
margin-bottom: 4px;
}
.detail-grid input,
.detail-grid select {
width: 100%;
border: 1px solid #e2e8f0;
border-radius: 6px;
padding: 6px 8px;
font-size: 12px;
color: #334155;
outline: none;
}
.detail-grid input:focus,
.detail-grid select:focus {
border-color: var(--color-primary);
}
.ds-btn {
width: 100%;
border: 1px solid #e2e8f0;
background: #fff;
border-radius: 6px;
padding: 6px 8px;
font-size: 12px;
color: #475569;
cursor: pointer;
}
.ds-btn:hover {
border-color: var(--color-primary);
color: var(--color-primary);
}
.icon-btn {
border: none;
background: transparent;
color: #cbd5e1;
cursor: pointer;
font-size: 13px;
}
.icon-btn:hover {
color: #ef4444;
}
.link-danger {
border: none;
background: transparent;
color: #ef4444;
cursor: pointer;
font-size: 12px;
}
.link-muted {
border: none;
background: transparent;
color: #94a3b8;
cursor: pointer;
font-size: 12px;
}