plc_control/web/styles.css

528 lines
11 KiB
CSS

:root {
--bg: #f1f5f9;
--surface: #ffffff;
--surface-2: #f8fafc;
--text: #0f172a;
--text-2: #475569;
--text-3: #94a3b8;
--accent: #2563eb;
--accent-hover: #1d4ed8;
--accent-bg: rgba(37, 99, 235, 0.06);
--success: #059669;
--danger: #ef4444;
--danger-hover: #dc2626;
--warning: #d97706;
--border: #e2e8f0;
--border-light: #f1f5f9;
--radius: 6px;
--topbar-h: 42px;
}
* { box-sizing: border-box; margin: 0; }
body {
font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
color: var(--text);
background: var(--border);
font-size: 14px;
line-height: 1.5;
height: 100vh;
overflow: hidden;
}
/* ── Topbar ─────────────────────────────────────── */
.topbar {
display: flex;
justify-content: space-between;
align-items: center;
height: var(--topbar-h);
padding: 0 16px;
background: var(--surface);
border-bottom: 1px solid var(--border);
}
.title {
font-size: 15px;
font-weight: 700;
color: var(--accent);
}
.status {
font-size: 12px;
color: var(--text-3);
}
/* ── Grid Layout ────────────────────────────────── */
.grid {
display: grid;
grid-template-columns: 340px 1fr;
grid-template-rows: 1fr 1fr;
gap: 1px;
height: calc(100vh - var(--topbar-h));
}
.panel.top-left { grid-column: 1; grid-row: 1; }
.panel.top-right { grid-column: 2; grid-row: 1; }
.panel.bottom {
grid-column: 1 / -1;
grid-row: 2;
min-height: 0;
}
.panel {
background: var(--surface);
display: flex;
flex-direction: column;
min-height: 0;
overflow: hidden;
}
/* ── Panel Header ───────────────────────────────── */
.panel-head {
display: flex;
justify-content: space-between;
align-items: center;
padding: 7px 12px;
border-bottom: 1px solid var(--border-light);
flex-shrink: 0;
}
h2, h3 {
font-size: 12px;
font-weight: 600;
color: var(--text-2);
text-transform: uppercase;
letter-spacing: 0.5px;
}
/* ── Buttons ────────────────────────────────────── */
button {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 4px;
padding: 4px 10px;
border: none;
border-radius: var(--radius);
font-size: 12px;
font-weight: 500;
cursor: pointer;
transition: all 0.15s;
background: var(--accent);
color: #fff;
white-space: nowrap;
}
button:hover { background: var(--accent-hover); }
button:disabled {
opacity: 0.4;
cursor: not-allowed;
}
button.secondary {
background: transparent;
color: var(--text-2);
border: 1px solid var(--border);
}
button.secondary:hover {
background: var(--bg);
border-color: var(--text-3);
}
button.danger {
background: var(--danger);
color: #fff;
}
button.danger:hover { background: var(--danger-hover); }
/* ── Source List ─────────────────────────────────── */
.list {
display: flex;
flex-direction: column;
overflow-y: auto;
flex: 1 1 auto;
min-height: 0;
padding: 6px;
gap: 4px;
}
.list-item {
padding: 7px 10px;
border: 1px solid var(--border);
border-radius: var(--radius);
display: flex;
flex-direction: column;
gap: 4px;
cursor: pointer;
transition: all 0.15s;
}
.list-item:hover {
background: var(--accent-bg);
border-color: rgba(37, 99, 235, 0.2);
}
.list-item.selected {
background: var(--accent-bg);
border-color: var(--accent);
}
.list-item .row {
display: flex;
justify-content: space-between;
align-items: center;
gap: 6px;
}
.list-item button {
padding: 2px 8px;
font-size: 11px;
}
.muted {
color: var(--text-3);
font-size: 12px;
}
/* ── Badges ──────────────────────────────────────── */
.badge {
display: inline-block;
font-size: 10px;
font-weight: 600;
padding: 1px 6px;
border-radius: 3px;
text-transform: uppercase;
letter-spacing: 0.3px;
background: rgba(37, 99, 235, 0.1);
color: var(--accent);
}
.badge.offline { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge.quality-good { background: rgba(5, 150, 105, 0.1); color: var(--success); }
.badge.quality-bad { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.badge.quality-uncertain { background: rgba(217, 119, 6, 0.1); color: var(--warning); }
.badge.quality-unknown { background: rgba(148, 163, 184, 0.12); color: #64748b; }
/* ── Data Table (Points) ─────────────────────────── */
.table-wrap {
flex: 1 1 auto;
overflow: auto;
min-height: 0;
}
.data-table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
table-layout: fixed;
}
.data-table thead {
position: sticky;
top: 0;
z-index: 1;
}
.data-table th {
background: var(--surface-2);
text-align: left;
padding: 5px 12px;
font-size: 11px;
font-weight: 600;
color: var(--text-3);
text-transform: uppercase;
letter-spacing: 0.3px;
border-bottom: 1px solid var(--border);
white-space: nowrap;
}
.data-table td {
padding: 4px 12px;
border-bottom: 1px solid var(--border-light);
vertical-align: middle;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.data-table tbody tr {
transition: background 0.1s;
}
.data-table tbody tr:hover {
background: var(--accent-bg);
}
.point-name {
font-weight: 500;
color: var(--text);
font-size: 13px;
overflow: hidden;
text-overflow: ellipsis;
}
.point-id {
font-size: 11px;
color: var(--text-3);
font-family: "JetBrains Mono", "Consolas", monospace;
}
.point-value {
font-family: "JetBrains Mono", "Consolas", monospace;
font-weight: 600;
font-size: 13px;
color: var(--text);
}
.empty-state {
text-align: center;
color: var(--text-3);
padding: 32px 12px !important;
font-size: 13px;
}
/* ── Pager ────────────────────────────────────────── */
.pager {
display: flex;
align-items: center;
gap: 2px;
font-size: 12px;
color: var(--text-3);
}
.pager button {
width: 22px;
height: 22px;
padding: 0;
font-size: 16px;
line-height: 1;
}
/* ── Toolbar ──────────────────────────────────────── */
.toolbar {
display: flex;
gap: 6px;
flex-shrink: 0;
}
/* ── Form ─────────────────────────────────────────── */
.form {
display: flex;
flex-direction: column;
gap: 12px;
}
.form label {
display: flex;
flex-direction: column;
gap: 4px;
font-size: 12px;
color: var(--text-2);
}
.form input[type="text"],
.form input[type="url"],
.form input[type="password"],
.form input[type="number"],
.form input:not([type]) {
padding: 7px 10px;
border-radius: var(--radius);
border: 1px solid var(--border);
background: var(--surface);
color: var(--text);
font-size: 14px;
transition: border-color 0.15s;
}
.form input:focus {
outline: none;
border-color: var(--accent);
box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}
.check-row {
flex-direction: row !important;
align-items: center;
gap: 6px;
}
.form-actions {
display: flex;
gap: 8px;
justify-content: flex-end;
padding-top: 4px;
}
/* ── Tree ─────────────────────────────────────────── */
.tree {
overflow-y: auto;
padding: 4px 8px;
flex: 1 1 auto;
min-height: 0;
}
.tree details { margin-left: 12px; }
.tree summary {
list-style: none;
cursor: pointer;
display: flex;
align-items: center;
gap: 4px;
padding: 2px 0;
font-size: 13px;
}
.tree summary.has-children::before {
content: "▸";
color: var(--text-3);
font-size: 10px;
}
.tree details[open] > summary.has-children::before {
content: "▾";
}
.tree summary::-webkit-details-marker { display: none; }
.tree .node-label { color: var(--text); }
/* ── Log ──────────────────────────────────────────── */
.log {
background: #0f172a;
padding: 6px 10px;
font-family: "JetBrains Mono", "Consolas", monospace;
font-size: 12px;
line-height: 1.55;
color: #cbd5e1;
overflow-y: auto;
flex: 1 1 auto;
display: flex;
flex-direction: column;
gap: 0;
min-height: 0;
}
.log-line {
white-space: pre-wrap;
word-break: break-word;
padding: 0 4px;
border-radius: 2px;
}
.log-line:hover { background: rgba(255, 255, 255, 0.04); }
.log-line .level {
font-weight: 700;
margin-right: 6px;
font-size: 11px;
}
.log-line .message { margin-left: 6px; }
.log-line .muted { margin-left: 4px; color: #64748b; }
.log-line.level-trace .level { color: #64748b; }
.log-line.level-debug .level { color: #38bdf8; }
.log-line.level-info .level { color: #34d399; }
.log-line.level-warn .level { color: #fbbf24; }
.log-line.level-error .level { color: #f87171; }
/* ── Modal ────────────────────────────────────────── */
.modal {
position: fixed;
inset: 0;
background: rgba(15, 23, 42, 0.45);
display: flex;
align-items: center;
justify-content: center;
z-index: 50;
backdrop-filter: blur(2px);
}
.modal.hidden { display: none; }
.modal-content {
width: min(860px, 94vw);
max-height: 85vh;
overflow: hidden;
background: var(--surface);
border-radius: 10px;
border: 1px solid var(--border);
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
display: flex;
flex-direction: column;
gap: 12px;
padding: 16px;
}
.modal-content.modal-sm {
width: min(420px, 94vw);
}
.modal-head {
display: flex;
justify-content: space-between;
align-items: center;
}
.modal-head h3 {
font-size: 15px;
text-transform: none;
letter-spacing: 0;
color: var(--text);
}
.modal-foot {
display: flex;
justify-content: space-between;
align-items: center;
}
.modal-content .tree {
flex: 1;
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 8px;
background: var(--surface-2);
max-height: 50vh;
}
/* ── Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
/* ── Responsive ───────────────────────────────────── */
@media (max-width: 900px) {
.grid {
grid-template-columns: 1fr;
grid-template-rows: auto 1fr auto;
height: auto;
}
body { height: auto; overflow: auto; }
.panel.top-left { min-height: 200px; }
.panel.top-right { min-height: 300px; }
.panel.bottom { max-height: none; min-height: 200px; }
}