Files
onion-dmp/public/style.css
2026-04-08 14:52:09 +08:00

831 lines
20 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.
/* ═══════════════════════════════════════════════
DMP · 客户大数据标签系统
Design: Dark, data-dense, reference-image style
═══════════════════════════════════════════════ */
:root {
--bg0: #0d0d17;
--bg1: #111120;
--bg2: #161628;
--bg3: #1e1e36;
--bg4: #252542;
--border: rgba(255,255,255,0.07);
--border2: rgba(255,255,255,0.12);
--text0: #f0f0ff;
--text1: #b0b0d0;
--text2: #6868a0;
--text3: #444460;
--acc: #6366f1;
--acc2: #8b5cf6;
--grn: #22c55e;
--red: #ef4444;
--ylw: #f59e0b;
--col-w: 206px;
--row-h: 88px;
--radius: 6px;
--topbar-h: 56px;
--selbar-h: 40px;
--font: 'Inter', sans-serif;
--mono: 'JetBrains Mono', monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
height: 100%;
background: var(--bg0);
color: var(--text0);
font-family: var(--font);
font-size: 13px;
line-height: 1.5;
overflow: hidden;
-webkit-font-smoothing: antialiased;
display: flex;
flex-direction: column;
}
/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 99px; }
/* ════════════════════════════════
TOP BAR
════════════════════════════════ */
.topbar {
height: var(--topbar-h);
background: var(--bg1);
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
padding: 0 20px;
gap: 16px;
position: sticky;
top: 0;
z-index: 100;
backdrop-filter: blur(12px);
}
.topbar-left, .topbar-right {
display: flex;
align-items: center;
gap: 10px;
flex-shrink: 0;
}
.topbar-center {
flex: 1;
display: flex;
justify-content: center;
}
/* Brand */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
font-size: 22px;
background: linear-gradient(135deg, var(--acc), var(--acc2));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.3px; }
.brand-sub { font-size: 9px; color: var(--text2); letter-spacing: 2px; font-weight: 500; margin-top: -1px; }
/* Result Counter — two metric blocks side by side */
.result-counter {
display: flex;
align-items: stretch;
gap: 0;
background: var(--bg2);
border: 1px solid var(--border2);
border-radius: 10px;
overflow: hidden;
transition: border-color 0.2s, box-shadow 0.2s;
}
.result-counter.has-result {
border-color: rgba(99,102,241,0.4);
box-shadow: 0 0 24px rgba(99,102,241,0.10);
}
/* Each metric block */
.rc-metric {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 8px 28px;
gap: 1px;
min-width: 148px;
}
.rc-metric-label {
font-size: 9px;
font-weight: 700;
letter-spacing: 1.4px;
text-transform: uppercase;
color: var(--text3);
margin-bottom: 2px;
}
/* Vertical divider */
.rc-divider {
width: 1px;
background: var(--border);
margin: 10px 0;
flex-shrink: 0;
}
.rc-main { display: flex; align-items: baseline; gap: 3px; }
.rc-num {
font-size: 24px;
font-weight: 800;
font-family: var(--mono);
background: linear-gradient(135deg, #c7d2fe, #a5b4fc);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
letter-spacing: -1px;
transition: all 0.3s;
}
/* Rate number uses warm amber gradient to distinguish */
.rc-num-rate {
background: linear-gradient(135deg, #fde68a, #f97316);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.rc-unit { font-size: 12px; color: var(--text2); }
.rc-sub { font-size: 10px; color: var(--text3); font-family: var(--mono); margin-top: 1px; }
/* Delta row (inside 预估转化 block) */
.rc-delta {
display: flex;
align-items: center;
font-family: var(--mono);
margin-top: 1px;
}
.delta-label { color: var(--text3); }
.delta-sep { color: var(--text3); }
.delta-up { color: var(--grn); font-weight: 700; }
.delta-down { color: var(--red); font-weight: 700; }
/* Logic Toggle */
.logic-group { display: flex; background: var(--bg2); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.logic-btn {
padding: 5px 14px;
background: transparent;
border: none;
color: var(--text2);
font-size: 12px;
font-weight: 600;
cursor: pointer;
font-family: var(--font);
transition: all 0.15s;
}
.logic-btn.active { background: var(--acc); color: white; }
.logic-btn:not(.active):hover { color: var(--text0); }
/* Action Buttons */
.action-btn {
height: 32px;
padding: 0 14px;
border-radius: 6px;
border: none;
font-size: 12px;
font-weight: 600;
cursor: pointer;
font-family: var(--font);
display: flex;
align-items: center;
gap: 5px;
transition: all 0.15s;
white-space: nowrap;
}
.action-btn.primary {
background: linear-gradient(135deg, var(--acc), var(--acc2));
color: white;
}
.action-btn.primary:hover:not(:disabled) {
transform: translateY(-1px);
box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}
.action-btn.primary:disabled {
opacity: 0.4;
cursor: not-allowed;
transform: none;
}
.action-btn.ghost {
background: var(--bg3);
color: var(--text1);
border: 1px solid var(--border);
}
.action-btn.ghost:hover { border-color: var(--border2); color: var(--text0); }
.btn-icon { font-size: 14px; }
/* ════════════════════════════════
SELECTED BAR
════════════════════════════════ */
.selected-bar {
height: var(--selbar-h);
background: var(--bg1);
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
padding: 0 20px;
gap: 10px;
overflow-x: auto;
flex-shrink: 0;
}
.sel-label { font-size: 11px; color: var(--text2); font-weight: 600; letter-spacing: 0.5px; flex-shrink: 0; }
.sel-tags { display: flex; gap: 6px; flex-wrap: nowrap; }
.sel-tag {
display: inline-flex;
align-items: center;
gap: 5px;
height: 24px;
padding: 0 10px;
border-radius: 5px;
font-size: 11px;
font-weight: 600;
cursor: pointer;
transition: all 0.15s;
flex-shrink: 0;
white-space: nowrap;
}
.sel-tag.include { background: rgba(99,102,241,0.15); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.3); }
.sel-tag.exclude { background: rgba(239,68,68,0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.sel-tag:hover { filter: brightness(1.2); }
.sel-tag .remove { opacity: 0.6; font-size: 12px; }
.sel-tag:hover .remove { opacity: 1; }
.sel-clear {
margin-left: auto;
background: none;
border: none;
color: var(--text3);
font-size: 11px;
cursor: pointer;
flex-shrink: 0;
font-family: var(--font);
}
.sel-clear:hover { color: var(--text1); }
/* ════════════════════════════════
MAIN LAYOUT
════════════════════════════════ */
.main-layout {
display: flex;
flex: 1;
overflow: hidden;
height: calc(100vh - var(--topbar-h));
}
/* ════════════════════════════════
TAG BOARD
════════════════════════════════ */
.board {
flex: 1;
overflow-x: auto;
overflow-y: auto;
padding: 16px;
display: flex;
gap: 12px;
align-items: flex-start;
}
.board-loading {
display: flex;
align-items: center;
gap: 12px;
color: var(--text2);
margin: auto;
}
/* Column */
.col {
flex-shrink: 0;
width: var(--col-w);
display: flex;
flex-direction: column;
gap: 6px;
}
/* Column Header */
.col-header {
padding: 8px 10px 8px 12px;
display: flex;
align-items: center;
gap: 6px;
border-radius: var(--radius);
background: var(--bg2);
border: 1px solid var(--border);
margin-bottom: 2px;
position: sticky;
top: 0;
z-index: 5;
}
.col-header-dot {
width: 8px;
height: 8px;
border-radius: 50%;
flex-shrink: 0;
}
.col-header-name {
font-size: 12px;
font-weight: 700;
flex: 1;
letter-spacing: 0.2px;
}
.col-header-count {
font-size: 10px;
color: var(--text2);
font-family: var(--mono);
}
/* Tag Card */
.tag-card {
background: var(--bg2);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 10px 12px;
cursor: pointer;
transition: all 0.15s;
position: relative;
overflow: hidden;
min-height: var(--row-h);
display: flex;
flex-direction: column;
justify-content: space-between;
user-select: none;
}
/* Hover state */
.tag-card:hover {
border-color: var(--border2);
background: var(--bg3);
}
/* Include selected */
.tag-card.selected-include {
border-color: rgba(99,102,241,0.5) !important;
background: rgba(99,102,241,0.08) !important;
box-shadow: inset 0 0 0 1px rgba(99,102,241,0.25);
}
.tag-card.selected-include::before {
content: '';
position: absolute;
left: 0; top: 0; bottom: 0;
width: 3px;
background: var(--acc);
border-radius: 3px 0 0 3px;
}
/* Exclude selected */
.tag-card.selected-exclude {
border-color: rgba(239,68,68,0.4) !important;
background: rgba(239,68,68,0.06) !important;
box-shadow: inset 0 0 0 1px rgba(239,68,68,0.2);
}
.tag-card.selected-exclude::before {
content: '';
position: absolute;
left: 0; top: 0; bottom: 0;
width: 3px;
background: var(--red);
border-radius: 3px 0 0 3px;
}
/* Card content */
.tc-name {
font-size: 12px;
font-weight: 600;
color: var(--text0);
line-height: 1.35;
margin-bottom: 4px;
}
.tc-desc {
font-size: 10px;
color: var(--text2);
line-height: 1.4;
flex: 1;
}
/* Card content wrapper */
.tc-head {
display: flex;
flex-direction: column;
flex: 1;
}
/* ── Lift Badge (Top Right) ── */
.tc-lift-badge {
position: absolute;
top: 8px;
right: 10px;
font-size: 10px;
font-family: var(--mono);
font-weight: 700;
padding: 1px 4px;
border-radius: 4px;
opacity: 0;
background: var(--bg3);
transition: opacity 0.2s;
pointer-events: none;
}
.tc-lift-badge.lift-up { color: #4ade80; background: rgba(74,222,128,0.1); }
.tc-lift-badge.lift-down { color: #f87171; background: rgba(248,113,113,0.1); }
.tag-card.in-preview .tc-lift-badge { opacity: 1; }
/* ── Default Stats ── */
.tc-default-stats {
display: flex;
align-items: baseline;
gap: 6px;
margin-top: 8px;
transition: opacity 0.2s;
}
.tc-coverage {
font-size: 14px;
font-weight: 700;
font-family: var(--mono);
color: var(--text1);
}
.tc-cov-rate {
font-size: 11px;
color: var(--text2);
}
.tag-card.in-preview .tc-default-stats {
opacity: 0;
position: absolute;
pointer-events: none;
}
/* ── Preview Stats (Intersection + Condition Rate) ── */
.tc-preview-stats {
display: flex;
flex-direction: column;
gap: 2px;
margin-top: 8px;
opacity: 0;
position: absolute;
pointer-events: none;
transition: opacity 0.2s;
}
.tag-card.in-preview .tc-preview-stats {
opacity: 1;
position: relative;
}
/* 预览大数字(交集人数) */
.tc-int-count {
font-size: 14px;
font-weight: 800;
font-family: var(--mono);
}
.tc-int-count.int-up { color: #c7d2fe; }
.tc-int-count.int-down { color: #e2e8f0; } /* 稍微暗一点 */
/* 预览中字(条件概率 P(B|A) */
.tc-cond-rate {
font-size: 12px;
font-weight: 700;
font-family: var(--mono);
}
.tc-cond-rate.cond-up { color: #4ade80; }
.tc-cond-rate.cond-down { color: #f87171; }
/* 基准比对小字(原覆盖人数/费率) */
.tc-base-mini {
font-size: 9px;
color: var(--text3);
font-family: var(--mono);
margin-bottom: 2px;
}
.tc-base-sep { opacity: 0.5; }
/* Progress bar on card */
.tc-progress {
position: absolute;
bottom: 0; left: 0; right: 0;
height: 2px;
background: var(--border);
overflow: hidden;
}
.tc-progress-fill {
height: 100%;
border-radius: 2px;
transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
/* Right-click context menu */
.context-menu {
position: fixed;
background: var(--bg3);
border: 1px solid var(--border2);
border-radius: 8px;
padding: 6px;
z-index: 999;
box-shadow: 0 8px 32px rgba(0,0,0,0.5);
min-width: 140px;
display: none;
}
.cm-item {
padding: 7px 12px;
border-radius: 5px;
font-size: 12px;
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
color: var(--text1);
transition: background 0.1s;
}
.cm-item:hover { background: var(--bg4); color: var(--text0); }
.cm-item.danger:hover { background: rgba(239,68,68,0.15); color: #fca5a5; }
.cm-item span { font-size: 13px; }
/* ════════════════════════════════
RIGHT PANEL
════════════════════════════════ */
.right-panel {
width: 340px;
flex-shrink: 0;
background: var(--bg1);
border-left: 1px solid var(--border);
display: flex;
flex-direction: column;
overflow: hidden;
animation: slideIn 0.25s ease;
}
@keyframes slideIn {
from { transform: translateX(20px); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}
.rp-header {
padding: 12px 16px;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: space-between;
}
.rp-title { font-size: 13px; font-weight: 700; }
.rp-close {
background: none;
border: none;
color: var(--text2);
cursor: pointer;
font-size: 14px;
padding: 2px 6px;
border-radius: 4px;
}
.rp-close:hover { background: var(--bg3); color: var(--text0); }
.rp-body { flex: 1; overflow-y: auto; padding: 12px; }
/* User sample table */
.sample-table {
width: 100%;
border-collapse: collapse;
font-size: 11px;
}
.sample-table th {
color: var(--text2);
font-weight: 600;
text-align: left;
padding: 4px 8px;
border-bottom: 1px solid var(--border);
white-space: nowrap;
}
.sample-table td {
padding: 6px 8px;
border-bottom: 1px solid var(--border);
color: var(--text1);
font-family: var(--mono);
font-size: 10px;
}
.sample-table tr:hover td { background: var(--bg2); }
.sample-table tr:last-child td { border-bottom: none; }
/* ════════════════════════════════
OVERLAY & SPINNER
════════════════════════════════ */
.compute-overlay {
position: fixed;
inset: 0;
background: rgba(0,0,0,0.4);
backdrop-filter: blur(2px);
z-index: 500;
display: flex;
align-items: center;
justify-content: center;
}
.co-inner {
background: var(--bg3);
border: 1px solid var(--border2);
border-radius: 12px;
padding: 24px 40px;
display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
font-size: 13px;
color: var(--text1);
}
.spinner, .spinner-lg {
border-radius: 50%;
animation: spin 0.7s linear infinite;
}
.spinner {
width: 20px; height: 20px;
border: 2px solid var(--border);
border-top-color: var(--acc);
}
.spinner-lg {
width: 32px; height: 32px;
border: 3px solid var(--bg4);
border-top-color: var(--acc);
}
@keyframes spin { to { transform: rotate(360deg); } }
/* ════════════════════════════════
MODAL
════════════════════════════════ */
.modal-mask {
position: fixed;
inset: 0;
background: rgba(0,0,0,0.6);
backdrop-filter: blur(4px);
z-index: 1000;
display: flex;
align-items: center;
justify-content: center;
padding: 24px;
animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
background: var(--bg2);
border: 1px solid var(--border2);
border-radius: 12px;
width: 100%;
max-width: 720px;
max-height: 85vh;
display: flex;
flex-direction: column;
animation: slideUp 0.25s ease;
}
@keyframes slideUp {
from { transform: translateY(16px); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}
.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 20px;
border-bottom: 1px solid var(--border);
font-weight: 700;
font-size: 14px;
}
.modal-header button {
background: none;
border: none;
color: var(--text2);
font-size: 16px;
cursor: pointer;
width: 28px;
height: 28px;
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
}
.modal-header button:hover { background: var(--bg3); color: var(--text0); }
.modal-body {
flex: 1;
overflow-y: auto;
padding: 20px;
}
/* Import docs */
.api-block {
background: var(--bg1);
border: 1px solid var(--border);
border-radius: 8px;
margin-bottom: 16px;
overflow: hidden;
}
.api-block-header {
padding: 10px 14px;
display: flex;
align-items: center;
gap: 10px;
background: var(--bg0);
border-bottom: 1px solid var(--border);
}
.api-method {
font-size: 10px;
font-weight: 700;
padding: 2px 8px;
border-radius: 4px;
font-family: var(--mono);
}
.api-method.POST { background: rgba(99,102,241,0.2); color: #a5b4fc; }
.api-method.GET { background: rgba(34,197,94,0.2); color: #86efac; }
.api-method.DELETE { background: rgba(239,68,68,0.2); color: #fca5a5; }
.api-path { font-size: 12px; font-family: var(--mono); color: var(--text1); }
.api-desc { font-size: 11px; color: var(--text2); margin-left: auto; }
.api-body { padding: 14px; }
pre {
background: var(--bg0);
border: 1px solid var(--border);
border-radius: 6px;
padding: 12px;
font-family: var(--mono);
font-size: 11px;
color: #a5b4fc;
overflow-x: auto;
line-height: 1.6;
}
.api-note {
font-size: 11px;
color: var(--text2);
margin-top: 8px;
line-height: 1.6;
}
.api-note strong { color: var(--text1); }
/* Breakdown bar in right panel */
.breakdown-item {
margin-bottom: 10px;
}
.bd-label {
display: flex;
justify-content: space-between;
font-size: 11px;
margin-bottom: 3px;
color: var(--text1);
}
.bd-rate { font-family: var(--mono); color: var(--acc); font-weight: 600; }
.bd-bar { height: 4px; background: var(--bg4); border-radius: 2px; overflow: hidden; }
.bd-fill { height: 100%; border-radius: 2px; transition: width 0.4s ease; }
/* Number animation */
@keyframes numPop {
0% { transform: scale(0.9); }
60% { transform: scale(1.04); }
100% { transform: scale(1); }
}
.num-pop { animation: numPop 0.3s ease; }
/* Scan line effect on selected cards */
@keyframes scan {
from { transform: translateY(-100%); }
to { transform: translateY(100%); }
}
.tag-card.selected-include .tc-progress-fill {
background: var(--acc);
}
.tag-card.selected-exclude .tc-progress-fill {
background: var(--red);
}
/* ════════════════════════════════
BOTTOM BAR
════════════════════════════════ */
.bottom-bar {
flex-shrink: 0;
height: 60px;
background: var(--bg1);
border-top: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}
.bottom-bar .result-counter {
height: 100%;
border: none;
background: transparent;
gap: 20px;
}
.bottom-bar .rc-metric {
flex-direction: row;
padding: 0 10px;
gap: 15px;
}
.bottom-bar .rc-metric-label {
margin-bottom: 0;
font-size: 11px;
}
.bottom-bar .rc-divider {
margin: 15px 0;
}
.bottom-bar .rc-delta {
margin-left: 10px;
}