aps-agent/aps-frontend/css/common.css

653 lines
14 KiB
CSS
Raw Normal View History

2026-07-21 11:05:57 +08:00
:root {
--bg-body: #e8eaed;
--bg-sidebar: #1f2937;
--bg-card: #ffffff;
--bg-hover: #f3f4f6;
--text-main: #1f2937;
--text-muted: #6b7280;
--border: #d1d5db;
--border-strong: #9ca3af;
--primary: #f97316;
--primary-dark: #ea580c;
--primary-light: #ffedd5;
--secondary: #4b5563;
--success: #16a34a;
--warning: #eab308;
--danger: #dc2626;
--info: #0ea5e9;
--steel: #64748b;
--header-height: 56px;
--topnav-height: 44px;
--sidebar-width: 220px;
}
* { box-sizing: border-box; }
html, body {
margin: 0;
padding: 0;
height: 100%;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
background: var(--bg-body);
color: var(--text-main);
font-size: 14px;
}
#app {
display: flex;
flex-direction: column;
height: 100vh;
overflow: hidden;
}
/* Header */
.header {
height: var(--header-height);
background: var(--bg-sidebar);
color: #fff;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
flex-shrink: 0;
box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.header .brand {
display: flex;
align-items: center;
gap: 12px;
font-size: 18px;
font-weight: 700;
letter-spacing: 0.5px;
}
.header .brand .logo {
width: 32px;
height: 32px;
background: var(--primary);
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
font-weight: 900;
color: #fff;
}
.header .userbar {
display: flex;
align-items: center;
gap: 16px;
color: #d1d5db;
}
/* Body */
.body {
display: flex;
flex-direction: column;
flex: 1;
overflow: hidden;
}
/* Top navigation with dropdown groups (replaces left sidebar) */
.sidebar {
position: relative;
height: var(--topnav-height);
background: var(--bg-sidebar);
color: #d1d5db;
display: flex;
flex-direction: column;
flex-shrink: 0;
border-bottom: 1px solid rgba(255,255,255,0.06);
z-index: 100;
overflow: visible;
}
.nav-scroll {
display: flex;
align-items: center;
flex: 1;
height: 100%;
overflow-x: auto;
overflow-y: hidden;
padding: 0 12px;
}
.nav-scroll::-webkit-scrollbar { height: 4px; }
.nav-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.sidebar .nav-group {
display: inline-flex;
align-items: center;
height: 100%;
padding: 0 14px;
cursor: pointer;
transition: background .15s, color .15s;
border-bottom: 2px solid transparent;
user-select: none;
white-space: nowrap;
}
.sidebar .nav-group:hover,
.sidebar .nav-group.open {
background: rgba(255,255,255,0.06);
color: #fff;
}
.sidebar .nav-group.active {
color: var(--primary-light);
border-bottom-color: var(--primary);
}
.sidebar .nav-title {
display: inline-flex;
align-items: center;
gap: 5px;
font-size: 13px;
font-weight: 600;
letter-spacing: 0.3px;
}
.sidebar .nav-title .caret {
width: 12px;
height: 12px;
opacity: .7;
transition: transform .15s;
}
.sidebar .nav-group.open .nav-title .caret {
transform: rotate(180deg);
}
.nav-dropdown-panel {
display: none;
position: absolute;
top: var(--topnav-height);
left: 0;
right: 0;
background: #fff;
border-bottom: 1px solid var(--border);
box-shadow: 0 8px 24px rgba(0,0,0,0.12);
padding: 14px 20px;
z-index: 200;
max-height: calc(100vh - var(--header-height) - var(--topnav-height) - 20px);
overflow-y: auto;
}
.nav-dropdown-panel.open { display: block; }
.nav-dropdown-title {
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.6px;
color: var(--text-muted);
margin-bottom: 10px;
}
.nav-dropdown-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
gap: 8px;
}
.sidebar .nav-item {
display: flex;
align-items: center;
gap: 8px;
padding: 9px 10px;
border-radius: 6px;
cursor: pointer;
transition: background .15s, color .15s;
text-decoration: none;
color: var(--text-main);
background: var(--bg-card);
border: 1px solid var(--border);
font-size: 13px;
}
.sidebar .nav-item:hover {
background: var(--bg-hover);
border-color: var(--border-strong);
}
.sidebar .nav-item.active {
background: var(--primary-light);
color: var(--primary-dark);
border-color: var(--primary);
}
.sidebar .nav-item svg {
width: 16px;
height: 16px;
opacity: .9;
flex-shrink: 0;
}
/* Main */
.main {
flex: 1;
overflow-y: auto;
padding: 20px;
}
.page-title {
font-size: 22px;
font-weight: 700;
margin-bottom: 16px;
color: var(--text-main);
}
.page-desc {
color: var(--text-muted);
margin-top: -12px;
margin-bottom: 16px;
}
/* Cards */
.card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 8px;
box-shadow: 0 1px 3px rgba(0,0,0,0.06);
margin-bottom: 16px;
overflow: hidden;
}
.card-header {
padding: 14px 18px;
border-bottom: 1px solid var(--border);
background: #fafafa;
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 600;
}
.card-body {
padding: 18px;
}
.card-footer {
padding: 12px 18px;
border-top: 1px solid var(--border);
background: #fafafa;
}
/* Grid */
.row {
display: flex;
flex-wrap: wrap;
gap: 16px;
margin-bottom: 16px;
}
.col-3 { flex: 1 1 calc(25% - 12px); min-width: 220px; }
.col-4 { flex: 1 1 calc(33.333% - 11px); min-width: 260px; }
.col-6 { flex: 1 1 calc(50% - 8px); min-width: 300px; }
.col-8 { flex: 1 1 calc(66.666% - 6px); min-width: 420px; }
.col-9 { flex: 1 1 calc(75% - 4px); min-width: 500px; }
/* KPI */
.kpi-card {
display: flex;
align-items: center;
gap: 16px;
padding: 18px;
}
.kpi-icon {
width: 48px;
height: 48px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
background: var(--primary-light);
color: var(--primary-dark);
}
.kpi-icon svg { width: 24px; height: 24px; }
.kpi-value {
font-size: 26px;
font-weight: 800;
line-height: 1;
}
.kpi-label {
color: var(--text-muted);
font-size: 13px;
margin-top: 4px;
}
.kpi-delta {
font-size: 12px;
margin-top: 6px;
}
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--danger); }
/* Buttons */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
padding: 8px 14px;
border-radius: 4px;
border: 1px solid transparent;
cursor: pointer;
font-size: 13px;
font-weight: 600;
background: #fff;
color: var(--text-main);
border-color: var(--border-strong);
transition: all .15s;
}
.btn:hover { background: var(--bg-hover); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary-dark); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: #fff; border-color: #374151; }
.btn-secondary:hover { background: #374151; }
.btn-success { background: var(--success); color: #fff; border-color: #15803d; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: #fff; border-color: #b91c1c; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--warning); color: #1f2937; border-color: #ca8a04; }
.btn-warning:hover { background: #ca8a04; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
/* Tables */
.table-wrap { overflow-x: auto; }
table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
}
th, td {
padding: 10px 12px;
text-align: left;
border-bottom: 1px solid var(--border);
}
th {
background: #f9fafb;
font-weight: 600;
color: var(--text-muted);
white-space: nowrap;
}
tr:hover td { background: #f9fafb; }
td.actions { white-space: nowrap; }
/* Badges */
.badge {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 3px 8px;
border-radius: 12px;
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: .3px;
}
.badge-default { background: #e5e7eb; color: #374151; }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: #dcfce7; color: var(--success); }
.badge-warning { background: #fef9c3; color: #a16207; }
.badge-danger { background: #fee2e2; color: var(--danger); }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* Forms */
.form-row {
display: flex;
gap: 16px;
margin-bottom: 14px;
}
.form-group {
flex: 1;
display: flex;
flex-direction: column;
gap: 6px;
}
.form-group label {
font-weight: 600;
font-size: 12px;
color: var(--text-muted);
}
.form-group input,
.form-group select,
.form-group textarea {
padding: 8px 10px;
border: 1px solid var(--border);
border-radius: 4px;
font-size: 13px;
background: #fff;
color: var(--text-main);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
}
.form-group .hint {
font-size: 11px;
color: var(--text-muted);
}
/* Toolbar */
.toolbar {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 10px;
margin-bottom: 16px;
}
.search-box {
position: relative;
}
.search-box input {
padding: 7px 10px 7px 32px;
border: 1px solid var(--border);
border-radius: 4px;
font-size: 13px;
min-width: 220px;
}
.search-box svg {
position: absolute;
left: 9px;
top: 50%;
transform: translateY(-50%);
width: 16px;
height: 16px;
color: var(--text-muted);
}
/* Modal */
.modal-overlay {
position: fixed;
inset: 0;
background: rgba(17,24,39,0.55);
display: none;
align-items: center;
justify-content: center;
z-index: 1000;
padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
background: #fff;
border-radius: 8px;
width: 100%;
max-width: 640px;
max-height: 90vh;
display: flex;
flex-direction: column;
box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.modal.modal-lg { max-width: 900px; }
.modal-header {
padding: 14px 18px;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 700;
font-size: 16px;
}
.modal-close {
background: none;
border: none;
cursor: pointer;
color: var(--text-muted);
}
.modal-body { padding: 18px; overflow-y: auto; }
.modal-footer {
padding: 12px 18px;
border-top: 1px solid var(--border);
display: flex;
justify-content: flex-end;
gap: 10px;
}
/* Toast */
#toastContainer {
position: fixed;
top: 16px;
right: 16px;
z-index: 1100;
display: flex;
flex-direction: column;
gap: 8px;
}
.toast {
background: #fff;
border-left: 4px solid var(--primary);
box-shadow: 0 4px 12px rgba(0,0,0,0.12);
padding: 12px 16px;
border-radius: 4px;
min-width: 260px;
animation: toastIn .25s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--info); }
.toast-title { font-weight: 700; margin-bottom: 2px; }
.toast-msg { color: var(--text-muted); font-size: 13px; }
@keyframes toastIn {
from { transform: translateX(100%); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}
/* Tabs */
.tabs {
display: flex;
border-bottom: 1px solid var(--border);
margin-bottom: 16px;
gap: 4px;
}
.tab {
padding: 10px 16px;
cursor: pointer;
border-bottom: 2px solid transparent;
color: var(--text-muted);
font-weight: 600;
}
.tab:hover { color: var(--text-main); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
/* Progress */
.progress {
height: 8px;
background: #e5e7eb;
border-radius: 4px;
overflow: hidden;
}
.progress-bar {
height: 100%;
background: var(--primary);
transition: width .3s;
}
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }
/* Timeline / Calendar */
.gantt-wrap {
position: relative;
overflow-x: auto;
border: 1px solid var(--border);
border-radius: 6px;
background: #fff;
}
.gantt-row {
display: flex;
border-bottom: 1px solid #f3f4f6;
min-height: 44px;
align-items: center;
}
.gantt-label {
width: 160px;
flex-shrink: 0;
padding: 0 12px;
font-weight: 600;
border-right: 1px solid var(--border);
background: #fafafa;
height: 100%;
display: flex;
align-items: center;
}
.gantt-track {
flex: 1;
position: relative;
height: 44px;
}
.gantt-grid {
position: absolute;
inset: 0;
display: flex;
}
.gantt-grid .slot {
flex: 1;
border-right: 1px dashed #e5e7eb;
}
.gantt-bar {
position: absolute;
top: 8px;
height: 28px;
border-radius: 4px;
background: var(--primary);
color: #fff;
font-size: 11px;
padding: 0 8px;
display: flex;
align-items: center;
cursor: grab;
box-shadow: 0 1px 3px rgba(0,0,0,0.15);
white-space: nowrap;
overflow: hidden;
user-select: none;
}
.gantt-bar:active { cursor: grabbing; }
.gantt-bar.conflict { background: var(--danger); }
.gantt-bar.frozen { background: var(--steel); }
.gantt-bar.completed { background: var(--success); }
/* Utility */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: #a16207; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.empty-state {
padding: 40px 20px;
text-align: center;
color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: .5; }
/* Pagination */
.pagination {
display: flex;
align-items: center;
gap: 6px;
}
.page-btn {
padding: 5px 10px;
border: 1px solid var(--border);
background: #fff;
border-radius: 4px;
cursor: pointer;
}
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: .5; cursor: not-allowed; }