背景:v1.9.0 把界面迁到 Bootstrap 5 时保留了旧自研 CSS,v1.9.2 又叠加了一层 「墨绿渐变」覆盖层,形成三套令牌(--paper/--ink、prefers-color-scheme、 data-bs-theme)并存。系统偏好与 Cookie 不一致时,页面会出现半亮半暗、表单 标签/抽屉标题/订阅页签不可见、输入框变黑块等问题。 本次改动: - 样式加载顺序改为 bootstrap → app.css;删除旧纸墨令牌与 v1.9.2 覆盖层, app.css 重写为单一主题层(:root/[data-bs-theme=light] 与 [data-bs-theme=dark] 两套语义令牌)。组件只读 --app-*,解决 --ink-2 同时被当作「次级文字色」和 「卡片底色」的语义冲突。 - 主题只认 <html data-bs-theme>:服务端按 Cookie 直出;没有 Cookie 时由 <head> 内联脚本在首屏按系统偏好补齐,修好「跟随系统」并避免闪白。大屏同理。 - 修复 Bootstrap 覆盖自研设计的问题:正文 14px + 中文字体栈、22/16/14px 标题、 按钮/输入框/焦点环/卡片回到设计值;普通按钮新增 .btn-soft,不再变透明文字。 - 布局修复:客户/套餐表单的 .grid-2 不再塞 3 个字段;包详情页把筛选独立成 GET 表单(在搜索框回车不再误触批量开通);客户详情操作区与 meta 重排; 抽屉时钟改为固定 46px 并用它对齐抽屉头的 sticky 偏移;追加面板在抽屉里 两列月历、不再 1100px 竖排;手机端日历数字不再换行溢出,移动端表格隐藏 低优先级列,不再被裁切。 - 大屏:KPI/面板去掉 Bootstrap utility,统一由 screen.css 控制;TOP/今日待打 改为固定列宽 + grid-column 对齐;浅色主题的链接、热力、图例对比度补齐; 热力格不再整体降透明度;当日浮层可滚动并支持点击/键盘打开。 - 配色与可读性:普通文本对比度全部达标(截图 lint 由 65 处降到 0);日历 外月日期改为浅底深字,不再整格 opacity;archived 行改为中性底色而非降透明。 - 缓存:新增内嵌静态资源内容指纹 AssetVersion(12 位 sha256),所有 /static 链接带 ?v=;带指纹的响应 public, max-age=31536000, immutable,不带指纹的 回源 no-cache;HTML 继续 no-store。改样式重新编译即自动破缓存,不再依赖 手改版本号(仍保留 v1.10.0 作为产品版本)。 - 认证页重做:登录/初始化页改用 .auth 卡片(品牌、主题切换、绿色焦点环), 去掉 min-height:100vh 叠加 main padding 造成的 40px 纵向滚动。 - JS:修 toISOString 计算自然日差一天的时区 bug;主题切换读 data-bs-theme 并同步 aria-pressed;全选支持半选;大屏切主题同时更新 data-bs-theme; 提示条改为固定定位、淡出不再顶动页面。 - README 更新主题与缓存说明;版本号 1.9.5 → 1.10.0。 验证:gofmt / go vet / go test 全绿;1440、1100、390 三档,明暗两套,工作台/ 客户/套餐/订阅/设置/日志/大屏/登录全部截图走查,无横向溢出与控制台错误。
This commit is contained in:
+1052
-1285
File diff suppressed because it is too large
Load Diff
+79
-45
@@ -2,15 +2,22 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/* 提示条自动淡出 */
|
||||
/* ---------- 工具:本地日期,禁止用 toISOString 做“自然日”计算 ---------- */
|
||||
function pad2(n) { return n < 10 ? '0' + n : '' + n; }
|
||||
function parseDay(s) { return new Date(s + 'T00:00:00'); }
|
||||
function fmtDay(d) { return d.getFullYear() + '-' + pad2(d.getMonth() + 1) + '-' + pad2(d.getDate()); }
|
||||
function addDays(s, n) { var d = parseDay(s); d.setDate(d.getDate() + n); return fmtDay(d); }
|
||||
function diffDays(a, b) { return Math.round((b.getTime() - a.getTime()) / 86400000); }
|
||||
|
||||
/* ---------- 提示条:自动淡出(.flash 固定定位,不会顶动页面) ---------- */
|
||||
document.querySelectorAll('[data-flash]').forEach(function (el) {
|
||||
setTimeout(function () {
|
||||
el.classList.add('hide');
|
||||
setTimeout(function () { el.remove(); }, 450);
|
||||
setTimeout(function () { el.remove(); }, 400);
|
||||
}, 4200);
|
||||
});
|
||||
|
||||
/* 按 / 聚焦搜索框 */
|
||||
/* ---------- 按 / 聚焦搜索框 ---------- */
|
||||
document.addEventListener('keydown', function (e) {
|
||||
if (e.key !== '/' || e.metaKey || e.ctrlKey || e.altKey) return;
|
||||
var tag = (document.activeElement && document.activeElement.tagName) || '';
|
||||
@@ -19,17 +26,14 @@
|
||||
if (s) { e.preventDefault(); s.focus(); s.select(); }
|
||||
});
|
||||
|
||||
/* 危险操作确认 */
|
||||
/* ---------- 危险操作确认 ---------- */
|
||||
document.querySelectorAll('form[data-confirm]').forEach(function (f) {
|
||||
f.addEventListener('submit', function (e) {
|
||||
if (!window.confirm(f.getAttribute('data-confirm'))) e.preventDefault();
|
||||
});
|
||||
});
|
||||
|
||||
/* 追加时长面板:点日历挑终止日 + 实时反算 */
|
||||
function parseDay(s) { return new Date(s + 'T00:00:00'); }
|
||||
function diffDays(a, b) { return Math.round((b.getTime() - a.getTime()) / 86400000); }
|
||||
|
||||
/* ---------- 追加时长面板:点日历挑终止日 + 实时反算 ---------- */
|
||||
document.querySelectorAll('form[data-extend]').forEach(function (form) {
|
||||
var base = parseDay(form.getAttribute('data-base'));
|
||||
var today = parseDay(form.getAttribute('data-today'));
|
||||
@@ -63,7 +67,7 @@
|
||||
if (input.value) paint(input.value);
|
||||
});
|
||||
|
||||
/* 新订阅表单:按套餐类型切换「天数 / 次数 / 终止日」 */
|
||||
/* ---------- 新订阅表单:按套餐类型切换「天数 / 次数 / 终止日」 ---------- */
|
||||
document.querySelectorAll('form[data-sub-form]').forEach(function (form) {
|
||||
var sel = form.querySelector('[data-pkg-select]');
|
||||
var daysWrap = form.querySelector('[data-days-wrap]');
|
||||
@@ -71,14 +75,23 @@
|
||||
var endWrap = form.querySelector('[data-end-wrap]');
|
||||
var startWrap = form.querySelector('[data-start-wrap]');
|
||||
var startInput = form.querySelector('input[name="start_date"]');
|
||||
var endInput = endWrap && endWrap.querySelector('input');
|
||||
if (!sel) return;
|
||||
|
||||
/* 只覆盖“上一次自动填的”终止日,不碰用户手填的值 */
|
||||
function setAutoEnd(v) {
|
||||
if (!endInput || !v) return;
|
||||
if (!endInput.value || endInput.dataset.auto === endInput.value) {
|
||||
endInput.value = v;
|
||||
endInput.dataset.auto = v;
|
||||
}
|
||||
}
|
||||
|
||||
function sync() {
|
||||
var opt = sel.options[sel.selectedIndex];
|
||||
var unit = opt && opt.getAttribute('data-unit');
|
||||
var amount = opt && opt.getAttribute('data-amount');
|
||||
var validity = opt && parseInt(opt.getAttribute('data-validity') || '0', 10);
|
||||
var endInput = endWrap && endWrap.querySelector('input');
|
||||
|
||||
if (unit === 'season') {
|
||||
if (daysWrap) daysWrap.hidden = true;
|
||||
@@ -96,11 +109,7 @@
|
||||
if (daysWrap) daysWrap.hidden = true;
|
||||
if (countWrap) { countWrap.hidden = false; if (amount) countWrap.querySelector('input').value = amount; }
|
||||
if (endWrap) endWrap.hidden = false;
|
||||
if (validity > 0 && endInput && !endInput.value && startInput && startInput.value) {
|
||||
var d = new Date(startInput.value + 'T00:00:00');
|
||||
d.setDate(d.getDate() + validity - 1);
|
||||
endInput.value = d.toISOString().slice(0, 10);
|
||||
}
|
||||
if (validity > 0 && startInput && startInput.value) setAutoEnd(addDays(startInput.value, validity - 1));
|
||||
} else if (unit === 'day') {
|
||||
if (daysWrap) { daysWrap.hidden = false; if (amount) daysWrap.querySelector('input').value = amount; }
|
||||
if (countWrap) countWrap.hidden = true;
|
||||
@@ -111,11 +120,21 @@
|
||||
if (endWrap) endWrap.hidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
sel.addEventListener('change', sync);
|
||||
if (startInput) {
|
||||
startInput.addEventListener('change', function () {
|
||||
var opt = sel.options[sel.selectedIndex];
|
||||
var validity = opt && parseInt(opt.getAttribute('data-validity') || '0', 10);
|
||||
if (opt && opt.getAttribute('data-unit') === 'count' && validity > 0 && startInput.value) {
|
||||
setAutoEnd(addDays(startInput.value, validity - 1));
|
||||
}
|
||||
});
|
||||
}
|
||||
sync();
|
||||
});
|
||||
|
||||
/* 套餐表单:切换默认量单位文案 */
|
||||
/* ---------- 套餐表单:切换默认量单位文案 ---------- */
|
||||
document.querySelectorAll('form[data-package-form]').forEach(function (form) {
|
||||
var label = form.querySelector('[data-unit-label]');
|
||||
var radios = form.querySelectorAll('input[name="unit"]');
|
||||
@@ -134,31 +153,59 @@
|
||||
radios.forEach(function (r) { r.addEventListener('change', sync); });
|
||||
sync();
|
||||
});
|
||||
|
||||
/* ---------- 批量开通:表头全选 + 半选状态 ---------- */
|
||||
document.querySelectorAll('[data-select-all]').forEach(function (box) {
|
||||
var form = box.closest('form') || document;
|
||||
var boxes = form.querySelectorAll('input[name="customer_ids"]');
|
||||
|
||||
function refresh() {
|
||||
var total = 0, checked = 0;
|
||||
boxes.forEach(function (c) {
|
||||
if (c.disabled) return;
|
||||
total++;
|
||||
if (c.checked) checked++;
|
||||
});
|
||||
box.checked = total > 0 && checked === total;
|
||||
box.indeterminate = checked > 0 && checked < total;
|
||||
}
|
||||
|
||||
box.addEventListener('change', function () {
|
||||
boxes.forEach(function (c) { if (!c.disabled) c.checked = box.checked; });
|
||||
box.indeterminate = false;
|
||||
});
|
||||
boxes.forEach(function (c) { c.addEventListener('change', refresh); });
|
||||
refresh();
|
||||
});
|
||||
})();
|
||||
|
||||
/* ---------- 亮色 / 暗色切换 ----------
|
||||
偏好写 cookie,服务端首屏直接带 data-theme,不闪。
|
||||
没有 cookie 时跟随系统(由 CSS 的 prefers-color-scheme 决定)。 */
|
||||
唯一状态源是 <html data-bs-theme>:服务端按 Cookie 直出,
|
||||
没有 Cookie 时由 <head> 里的内联脚本按系统偏好补上。 */
|
||||
(function () {
|
||||
'use strict';
|
||||
var KEY = 'daili_theme';
|
||||
var root = document.documentElement;
|
||||
var btns = document.querySelectorAll('[data-theme-toggle]');
|
||||
if (!btns.length) return;
|
||||
|
||||
function effective() {
|
||||
var attr = document.documentElement.getAttribute('data-theme');
|
||||
if (attr === 'light' || attr === 'dark') return attr;
|
||||
return window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
||||
function current() {
|
||||
return root.getAttribute('data-bs-theme') === 'dark' ? 'dark' : 'light';
|
||||
}
|
||||
function paint() {
|
||||
var dark = current() === 'dark';
|
||||
btns.forEach(function (b) { b.setAttribute('aria-pressed', dark ? 'true' : 'false'); });
|
||||
}
|
||||
|
||||
Array.prototype.forEach.call(btns, function (btn) {
|
||||
btns.forEach(function (btn) {
|
||||
btn.addEventListener('click', function () {
|
||||
var next = effective() === 'dark' ? 'light' : 'dark';
|
||||
document.documentElement.setAttribute('data-theme', next);
|
||||
document.documentElement.setAttribute('data-bs-theme', next);
|
||||
var next = current() === 'dark' ? 'light' : 'dark';
|
||||
root.setAttribute('data-bs-theme', next);
|
||||
document.cookie = KEY + '=' + next + '; path=/; max-age=31536000; SameSite=Lax';
|
||||
paint();
|
||||
});
|
||||
});
|
||||
paint();
|
||||
})();
|
||||
|
||||
/* ---------- 触摸小键盘 + 抽屉时钟 + 更多菜单 ---------- */
|
||||
@@ -171,14 +218,14 @@
|
||||
var d = new Date();
|
||||
var pad = function (n) { return n < 10 ? '0' + n : '' + n; };
|
||||
var t = pad(d.getHours()) + ':' + pad(d.getMinutes()) + ':' + pad(d.getSeconds());
|
||||
Array.prototype.forEach.call(clocks, function (el) { el.textContent = t; });
|
||||
clocks.forEach(function (el) { el.textContent = t; });
|
||||
}
|
||||
if (clocks.length) { tick(); setInterval(tick, 1000); }
|
||||
|
||||
/* 小键盘:输入手机尾号
|
||||
关键点:鼠标按下时阻止默认行为,否则按钮会先抢走输入框焦点;
|
||||
每次按键后再把焦点和光标送回输入框末尾。 */
|
||||
Array.prototype.forEach.call(document.querySelectorAll('[data-keypad]'), function (pad) {
|
||||
document.querySelectorAll('[data-keypad]').forEach(function (pad) {
|
||||
// 键盘是表单的兄弟节点(不在 <form> 内),所以先找输入框,再用 input.form 反查表单
|
||||
var scope = pad.closest('.drawer-block') || pad.parentElement || document;
|
||||
var input = scope.querySelector('input[name="tail"]');
|
||||
@@ -222,33 +269,20 @@
|
||||
|
||||
/* 更多菜单:点开一个时收起其它,点空白处关闭 */
|
||||
document.addEventListener('click', function (e) {
|
||||
var opened = document.querySelectorAll('.more-actions[open]');
|
||||
Array.prototype.forEach.call(opened, function (d) {
|
||||
document.querySelectorAll('.more-actions[open]').forEach(function (d) {
|
||||
if (!d.contains(e.target)) { d.removeAttribute('open'); }
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
|
||||
/* ---------- 全选 + 触控/PC 小键盘模式 ---------- */
|
||||
/* ---------- 触控/PC 小键盘模式 ---------- */
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/* 批量开通:表头全选 */
|
||||
Array.prototype.forEach.call(document.querySelectorAll('[data-select-all]'), function (box) {
|
||||
box.addEventListener('change', function () {
|
||||
var form = box.closest('form') || document;
|
||||
Array.prototype.forEach.call(form.querySelectorAll('input[name="customer_ids"]'), function (c) {
|
||||
if (!c.disabled) { c.checked = box.checked; }
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/* 触控 / PC 模式:触控时显示键盘并禁用输入框(不唤起系统输入法) */
|
||||
var KEY = 'daili_keypad_mode';
|
||||
|
||||
function applyMode(touch) {
|
||||
Array.prototype.forEach.call(document.querySelectorAll('[data-keypad]'), function (pad) {
|
||||
document.querySelectorAll('[data-keypad]').forEach(function (pad) {
|
||||
pad.hidden = !touch;
|
||||
var block = pad.closest('.drawer-block') || document;
|
||||
var input = block.querySelector('input[name="tail"]');
|
||||
@@ -270,7 +304,7 @@
|
||||
try { touchMode = localStorage.getItem(KEY) === 'touch'; } catch (err) { }
|
||||
applyMode(touchMode);
|
||||
|
||||
Array.prototype.forEach.call(document.querySelectorAll('[data-keypad-toggle]'), function (btn) {
|
||||
document.querySelectorAll('[data-keypad-toggle]').forEach(function (btn) {
|
||||
btn.addEventListener('click', function () {
|
||||
touchMode = !touchMode;
|
||||
try { localStorage.setItem(KEY, touchMode ? 'touch' : 'pc'); } catch (err) { }
|
||||
|
||||
+232
-355
@@ -1,82 +1,70 @@
|
||||
/* ============================================================
|
||||
代打台 · 可视化大屏(记分板)
|
||||
默认深色;亮色由系统偏好或 [data-theme="light"] 覆盖
|
||||
代打台 · 可视化大屏(v1.10)
|
||||
------------------------------------------------------------
|
||||
只认 <html data-bs-theme="light|dark">;默认由模板给 dark。
|
||||
Bootstrap 只用于重置与栅格,视觉全部在本文件内闭环。
|
||||
============================================================ */
|
||||
|
||||
:root {
|
||||
--bg: #0c0f12;
|
||||
--panel: #12161b;
|
||||
--panel-2: #171c22;
|
||||
--line: #232a32;
|
||||
--ink: #e9edf1;
|
||||
--ink-2: #aab4bf;
|
||||
--muted: #6f7b87;
|
||||
--accent: #58c1a3;
|
||||
--accent-2: #8bd9c4;
|
||||
--danger: #ef6b62;
|
||||
--warn: #e6ac55;
|
||||
--ok: #58c1a3;
|
||||
--glow: 0 0 24px rgba(88, 193, 163, 0.18);
|
||||
:root,
|
||||
[data-bs-theme="light"] {
|
||||
--scr-bg: #eef3ee;
|
||||
--scr-panel: #ffffff;
|
||||
--scr-panel-2: #f7faf7;
|
||||
--scr-line: #dbe5dc;
|
||||
--scr-text: #0f241d;
|
||||
--scr-text-2: #33493f;
|
||||
--scr-muted: #5f7468;
|
||||
--scr-accent: #1f6b52;
|
||||
--scr-accent-2: #2f8a69;
|
||||
--scr-accent-solid: #1f6b52;
|
||||
--scr-danger: #b3261e;
|
||||
--scr-warn: #8a5200;
|
||||
--scr-glow: 0 0 18px rgba(31, 107, 82, 0.12);
|
||||
--scr-shadow: 0 14px 32px -22px rgba(16, 32, 24, 0.4);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
:root:not([data-theme="dark"]) {
|
||||
--bg: #f4f2ec;
|
||||
--panel: #ffffff;
|
||||
--panel-2: #faf9f5;
|
||||
--line: #e0ddd2;
|
||||
--ink: #1b1e23;
|
||||
--ink-2: #4a4f57;
|
||||
--muted: #8a8f97;
|
||||
--accent: #2f7d68;
|
||||
--accent-2: #245c4d;
|
||||
--danger: #b3302a;
|
||||
--warn: #a0600f;
|
||||
--ok: #2f7d68;
|
||||
--glow: 0 0 18px rgba(47, 125, 104, 0.12);
|
||||
}
|
||||
}
|
||||
|
||||
:root[data-theme="light"] {
|
||||
--bg: #f4f2ec;
|
||||
--panel: #ffffff;
|
||||
--panel-2: #faf9f5;
|
||||
--line: #e0ddd2;
|
||||
--ink: #1b1e23;
|
||||
--ink-2: #4a4f57;
|
||||
--muted: #8a8f97;
|
||||
--accent: #2f7d68;
|
||||
--accent-2: #245c4d;
|
||||
--danger: #b3302a;
|
||||
--warn: #a0600f;
|
||||
--ok: #2f7d68;
|
||||
--glow: 0 0 18px rgba(47, 125, 104, 0.12);
|
||||
[data-bs-theme="dark"] {
|
||||
--scr-bg: #0a120f;
|
||||
--scr-panel: #111a16;
|
||||
--scr-panel-2: #16211c;
|
||||
--scr-line: #24352d;
|
||||
--scr-text: #e8f2ec;
|
||||
--scr-text-2: #b5c9bd;
|
||||
--scr-muted: #87a094;
|
||||
--scr-accent: #5cc4a3;
|
||||
--scr-accent-2: #7bd7b8;
|
||||
--scr-accent-solid: #2b7d61;
|
||||
--scr-danger: #f08a82;
|
||||
--scr-warn: #e0b072;
|
||||
--scr-glow: 0 0 24px rgba(92, 196, 163, 0.16);
|
||||
--scr-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
html, body { height: 100%; margin: 0; }
|
||||
|
||||
body {
|
||||
body.screen-body {
|
||||
background:
|
||||
radial-gradient(1200px 600px at 15% -10%, rgba(47,163,122,.18), transparent 60%),
|
||||
radial-gradient(900px 500px at 100% 0%, rgba(22,84,63,.22), transparent 55%),
|
||||
var(--bg);
|
||||
color: var(--ink);
|
||||
font-family: "Bahnschrift", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
|
||||
radial-gradient(1200px 600px at 12% -10%, color-mix(in srgb, var(--scr-accent) 14%, transparent), transparent 60%),
|
||||
radial-gradient(900px 500px at 100% 0%, color-mix(in srgb, var(--scr-accent) 8%, transparent), transparent 55%),
|
||||
var(--scr-bg);
|
||||
color: var(--scr-text);
|
||||
font-family: "Microsoft YaHei UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
|
||||
system-ui, -apple-system, "Segoe UI", sans-serif;
|
||||
font-size: 14px;
|
||||
line-height: 1.45;
|
||||
overflow: hidden;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
/* 背景:极淡的网格与光晕 */
|
||||
body::before {
|
||||
body.screen-body::before {
|
||||
content: "";
|
||||
position: fixed; inset: 0; z-index: 0; pointer-events: none;
|
||||
background:
|
||||
radial-gradient(1200px 600px at 20% -10%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%),
|
||||
linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 40px,
|
||||
linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 40px 100%;
|
||||
opacity: 0.5;
|
||||
linear-gradient(var(--scr-line) 1px, transparent 1px) 0 0 / 100% 44px,
|
||||
linear-gradient(90deg, var(--scr-line) 1px, transparent 1px) 0 0 / 44px 100%;
|
||||
opacity: 0.35;
|
||||
}
|
||||
|
||||
.scr {
|
||||
@@ -85,69 +73,65 @@ body::before {
|
||||
grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
|
||||
gap: 10px;
|
||||
height: 100vh;
|
||||
height: 100dvh;
|
||||
padding: 12px 16px 8px;
|
||||
}
|
||||
|
||||
/* ---------- 头部 ---------- */
|
||||
|
||||
.scr-head { display: flex; align-items: center; gap: 16px; min-height: 40px; }
|
||||
.scr-head { display: flex; align-items: center; gap: 14px; min-height: 40px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--scr-line); }
|
||||
|
||||
.scr-brand { display: flex; align-items: baseline; gap: 6px; font-size: 17px; font-weight: 700; letter-spacing: 0.08em; }
|
||||
.scr-brand { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; letter-spacing: 0.06em; color: var(--scr-text); }
|
||||
.scr-brand .mark {
|
||||
display: inline-grid; place-items: center;
|
||||
width: 24px; height: 24px; margin-right: 4px;
|
||||
background: var(--accent); color: var(--bg);
|
||||
font-size: 13px; border-radius: 2px;
|
||||
align-self: center;
|
||||
width: 26px; height: 26px;
|
||||
background: var(--scr-accent-solid); color: #fff;
|
||||
font-size: 13px; font-weight: 800; border-radius: 8px;
|
||||
}
|
||||
.scr-brand em { font-style: normal; font-size: 11px; color: var(--muted); letter-spacing: 0.2em; }
|
||||
.scr-brand em { font-style: normal; font-size: 11px; font-weight: 500; color: var(--scr-muted); letter-spacing: 0.16em; }
|
||||
|
||||
.scr-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
|
||||
.scr-tabs a {
|
||||
display: inline-flex; align-items: center; gap: 5px;
|
||||
height: 28px; padding: 0 11px;
|
||||
font-size: 12px; color: var(--ink-2); text-decoration: none;
|
||||
border: 1px solid var(--line); border-radius: 999px;
|
||||
background: var(--panel);
|
||||
font-size: 12px; color: var(--scr-text-2); text-decoration: none;
|
||||
border: 1px solid var(--scr-line); border-radius: 999px;
|
||||
background: var(--scr-panel);
|
||||
}
|
||||
.scr-tabs a::before {
|
||||
content: ""; width: 6px; height: 6px; border-radius: 50%;
|
||||
background: var(--tab, var(--accent));
|
||||
}
|
||||
.scr-tabs a.on { background: var(--accent); border-color: var(--accent); color: var(--bg); }
|
||||
.scr-tabs a.on::before { background: var(--bg); }
|
||||
.scr-tabs a::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--tab, var(--scr-accent)); }
|
||||
.scr-tabs a:hover { border-color: var(--scr-accent); color: var(--scr-text); text-decoration: none; }
|
||||
.scr-tabs a.on { background: var(--scr-accent-solid); border-color: var(--scr-accent-solid); color: #fff; }
|
||||
.scr-tabs a.on::before { background: #fff; }
|
||||
|
||||
.scr-tools { display: flex; align-items: center; gap: 8px; }
|
||||
.scr-switch {
|
||||
height: 28px; padding: 0 10px;
|
||||
display: inline-flex; align-items: center;
|
||||
font-size: 12px; color: var(--accent); text-decoration: none;
|
||||
border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
|
||||
border-radius: 999px; background: var(--panel);
|
||||
font-size: 12px; color: var(--scr-accent); text-decoration: none;
|
||||
border: 1px solid color-mix(in srgb, var(--scr-accent) 40%, var(--scr-line));
|
||||
border-radius: 999px; background: var(--scr-panel);
|
||||
}
|
||||
.scr-switch:hover { background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
|
||||
.scr-switch:hover { background: color-mix(in srgb, var(--scr-accent) 12%, var(--scr-panel)); text-decoration: none; }
|
||||
|
||||
.scr-theme {
|
||||
width: 28px; height: 28px; padding: 0;
|
||||
display: inline-grid; place-items: center;
|
||||
border: 1px solid var(--line); border-radius: 999px;
|
||||
background: var(--panel); color: var(--ink-2);
|
||||
border: 1px solid var(--scr-line); border-radius: 999px;
|
||||
background: var(--scr-panel); color: var(--scr-text-2);
|
||||
font-size: 13px; cursor: pointer;
|
||||
}
|
||||
.scr-theme:hover { border-color: var(--scr-accent); color: var(--scr-accent); }
|
||||
.scr-theme .ic-sun { display: none; }
|
||||
:root[data-theme="light"] .scr-theme .ic-sun { display: inline; }
|
||||
:root[data-theme="light"] .scr-theme .ic-moon { display: none; }
|
||||
@media (prefers-color-scheme: light) {
|
||||
:root:not([data-theme="dark"]) .scr-theme .ic-sun { display: inline; }
|
||||
:root:not([data-theme="dark"]) .scr-theme .ic-moon { display: none; }
|
||||
}
|
||||
[data-bs-theme="dark"] .scr-theme .ic-sun { display: inline; }
|
||||
[data-bs-theme="dark"] .scr-theme .ic-moon { display: none; }
|
||||
|
||||
.scr-clock { margin-left: auto; text-align: right; line-height: 1.1; }
|
||||
.scr-clock b { font-family: var(--mono, "Bahnschrift", monospace); font-size: 22px; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
|
||||
.scr-clock span { display: block; font-size: 11px; color: var(--muted); }
|
||||
.scr-clock b { font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace; font-size: 22px; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; color: var(--scr-text); }
|
||||
.scr-clock span { display: block; font-size: 11px; color: var(--scr-muted); }
|
||||
|
||||
.scr-links { font-size: 11px; color: var(--muted); }
|
||||
.scr-links a { color: var(--accent); text-decoration: none; }
|
||||
.scr-links { font-size: 11px; color: var(--scr-muted); }
|
||||
.scr-links a { color: var(--scr-accent); text-decoration: none; }
|
||||
.scr-links a:hover { text-decoration: underline; }
|
||||
|
||||
/* ---------- KPI ---------- */
|
||||
|
||||
@@ -155,23 +139,24 @@ body::before {
|
||||
.kpi {
|
||||
position: relative;
|
||||
display: flex; align-items: baseline; gap: 6px;
|
||||
padding: 10px 14px;
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 3px;
|
||||
padding: 10px 14px 10px 18px;
|
||||
background: var(--scr-panel);
|
||||
border: 1px solid var(--scr-line);
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
box-shadow: var(--scr-shadow);
|
||||
}
|
||||
.kpi::after {
|
||||
content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
|
||||
background: var(--accent);
|
||||
background: var(--scr-accent);
|
||||
}
|
||||
.kpi span { font-size: 12px; color: var(--muted); margin-right: auto; }
|
||||
.kpi b { font-family: "Bahnschrift", monospace; font-size: 30px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
|
||||
.kpi i { font-style: normal; font-size: 11px; color: var(--muted); }
|
||||
.kpi-hot::after { background: var(--danger); }
|
||||
.kpi-hot b { color: var(--danger); }
|
||||
.kpi-warm::after { background: var(--warn); }
|
||||
.kpi-warm b { color: var(--warn); }
|
||||
.kpi span { font-size: 12px; color: var(--scr-muted); margin-right: auto; }
|
||||
.kpi b { font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace; font-size: 30px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--scr-text); }
|
||||
.kpi i { font-style: normal; font-size: 11px; color: var(--scr-muted); }
|
||||
.kpi-hot::after { background: var(--scr-danger); }
|
||||
.kpi-hot b { color: var(--scr-danger); }
|
||||
.kpi-warm::after { background: var(--scr-warn); }
|
||||
.kpi-warm b { color: var(--scr-warn); }
|
||||
|
||||
/* ---------- 主区 ---------- */
|
||||
|
||||
@@ -179,140 +164,146 @@ body::before {
|
||||
|
||||
.panel {
|
||||
display: flex; flex-direction: column; min-height: 0;
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 3px;
|
||||
background: var(--scr-panel);
|
||||
border: 1px solid var(--scr-line);
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
box-shadow: var(--scr-shadow);
|
||||
}
|
||||
.panel-head {
|
||||
display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
|
||||
padding: 9px 14px;
|
||||
border-bottom: 1px solid var(--line);
|
||||
background: var(--panel-2);
|
||||
border-bottom: 1px solid var(--scr-line);
|
||||
background: var(--scr-panel-2);
|
||||
}
|
||||
.panel-head h2 { margin: 0; font-size: 13px; letter-spacing: 0.08em; font-weight: 700; }
|
||||
.panel-head span { font-size: 11px; color: var(--muted); }
|
||||
.panel-head h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; color: var(--scr-text); }
|
||||
.panel-head span { font-size: 11px; color: var(--scr-muted); }
|
||||
|
||||
/* 热力 */
|
||||
.heat-grid { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; padding: 8px 12px; min-height: 0; }
|
||||
.heat-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
|
||||
.heat-dow span { text-align: center; font-size: 10px; color: var(--muted); }
|
||||
.heat-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
|
||||
.heat-grid { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; padding: 8px 12px; min-height: 0; min-width: 0; overflow: hidden; }
|
||||
.heat-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 4px; }
|
||||
.heat-dow span { text-align: center; font-size: 10px; color: var(--scr-muted); }
|
||||
.heat-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 4px; align-items: stretch; }
|
||||
.heat-cell {
|
||||
position: relative;
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
min-height: 0; aspect-ratio: 2.05 / 1;
|
||||
padding: 4px 7px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 2px;
|
||||
background: var(--panel-2);
|
||||
font-size: 11px; color: var(--muted);
|
||||
min-height: 34px; min-width: 0;
|
||||
padding: 3px 7px 3px 9px;
|
||||
border: 1px solid var(--scr-line); border-radius: 6px;
|
||||
background: var(--scr-panel-2);
|
||||
font-size: 11px; color: var(--scr-muted);
|
||||
overflow: hidden;
|
||||
transition: transform 0.1s ease, border-color 0.1s ease;
|
||||
}
|
||||
.heat-cell span { font-family: "Bahnschrift", monospace; font-size: 11px; }
|
||||
.heat-cell b { font-family: "Bahnschrift", monospace; font-size: 12px; color: var(--ink-2); }
|
||||
.heat-cell.out { opacity: 0.28; }
|
||||
.heat-cell.past { opacity: 0.66; }
|
||||
.heat-cell.today { outline: 1px solid var(--accent); outline-offset: -1px; }
|
||||
.heat-cell.today span { color: var(--accent); font-weight: 700; }
|
||||
.heat-cell:hover { transform: translateY(-1px); border-color: var(--accent); z-index: 3; }
|
||||
.heat-cell span { font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace; font-size: 11px; color: var(--scr-text-2); }
|
||||
.heat-cell b { font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace; font-size: 12px; font-weight: 700; color: var(--scr-text); white-space: nowrap; }
|
||||
.heat-cell.out { background: var(--scr-panel-2); border-color: var(--scr-line); }
|
||||
.heat-cell.out span, .heat-cell.out b { color: var(--scr-muted); }
|
||||
.heat-cell.past { opacity: 1; }
|
||||
.heat-cell.today { outline: 1px solid var(--scr-accent); outline-offset: -1px; }
|
||||
.heat-cell.today span { color: var(--scr-accent); font-weight: 700; }
|
||||
.heat-cell:hover { transform: translateY(-1px); border-color: var(--scr-accent); z-index: 3; }
|
||||
|
||||
.heat-cell.h1 { background: color-mix(in srgb, var(--accent) 12%, var(--panel-2)); border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); }
|
||||
.heat-cell.h2 { background: color-mix(in srgb, var(--accent) 24%, var(--panel-2)); }
|
||||
.heat-cell.h3 { background: color-mix(in srgb, var(--accent) 38%, var(--panel-2)); }
|
||||
.heat-cell.h4 { background: color-mix(in srgb, var(--accent) 56%, var(--panel-2)); }
|
||||
.heat-cell.h3 b, .heat-cell.h4 b { color: var(--bg); }
|
||||
.heat-cell.h3 span, .heat-cell.h4 span { color: color-mix(in srgb, var(--bg) 75%, var(--accent)); }
|
||||
.heat-cell.h1 { background: color-mix(in srgb, var(--scr-accent) 10%, var(--scr-panel-2)); }
|
||||
.heat-cell.h2 { background: color-mix(in srgb, var(--scr-accent) 22%, var(--scr-panel-2)); }
|
||||
.heat-cell.h3 { background: color-mix(in srgb, var(--scr-accent) 36%, var(--scr-panel-2)); }
|
||||
.heat-cell.h4 { background: color-mix(in srgb, var(--scr-accent) 52%, var(--scr-panel-2)); }
|
||||
.heat-cell.h3 span, .heat-cell.h4 span { color: var(--scr-text); }
|
||||
.heat-cell.h3 b, .heat-cell.h4 b { color: var(--scr-text); }
|
||||
|
||||
.cell-urgent {
|
||||
position: absolute; top: 3px; right: 3px;
|
||||
width: 5px; height: 5px; border-radius: 50%;
|
||||
background: var(--danger);
|
||||
box-shadow: 0 0 6px color-mix(in srgb, var(--danger) 70%, transparent);
|
||||
background: var(--scr-danger);
|
||||
box-shadow: 0 0 6px color-mix(in srgb, var(--scr-danger) 70%, transparent);
|
||||
}
|
||||
|
||||
.heat-legend {
|
||||
display: flex; align-items: center; gap: 4px;
|
||||
padding: 6px 14px 10px;
|
||||
font-size: 10px; color: var(--muted);
|
||||
}
|
||||
.heat-legend { display: flex; align-items: center; gap: 4px; padding: 6px 14px 10px; font-size: 10px; color: var(--scr-muted); }
|
||||
.heat-legend span { margin-right: 6px; }
|
||||
.heat-legend i {
|
||||
width: 14px; height: 9px; border-radius: 1px;
|
||||
border: 1px solid var(--line);
|
||||
display: inline-block;
|
||||
}
|
||||
.heat-legend i.h0 { background: var(--panel-2); }
|
||||
.heat-legend i.h1 { background: color-mix(in srgb, var(--accent) 12%, var(--panel-2)); }
|
||||
.heat-legend i.h2 { background: color-mix(in srgb, var(--accent) 24%, var(--panel-2)); }
|
||||
.heat-legend i.h3 { background: color-mix(in srgb, var(--accent) 38%, var(--panel-2)); }
|
||||
.heat-legend i.h4 { background: color-mix(in srgb, var(--accent) 56%, var(--panel-2)); }
|
||||
.heat-legend .legend-hint { margin-left: auto; font-style: normal; opacity: 0.7; }
|
||||
.heat-legend i { width: 14px; height: 9px; border-radius: 2px; border: 1px solid var(--scr-line); display: inline-block; }
|
||||
.heat-legend i.h0 { background: var(--scr-panel-2); }
|
||||
.heat-legend i.h1 { background: color-mix(in srgb, var(--scr-accent) 10%, var(--scr-panel-2)); }
|
||||
.heat-legend i.h2 { background: color-mix(in srgb, var(--scr-accent) 22%, var(--scr-panel-2)); }
|
||||
.heat-legend i.h3 { background: color-mix(in srgb, var(--scr-accent) 36%, var(--scr-panel-2)); }
|
||||
.heat-legend i.h4 { background: color-mix(in srgb, var(--scr-accent) 52%, var(--scr-panel-2)); }
|
||||
.heat-legend .legend-hint { margin-left: auto; font-style: normal; opacity: 0.8; }
|
||||
|
||||
/* TOP 10 */
|
||||
.top-list { list-style: none; margin: 0; padding: 6px 10px; overflow: hidden; flex: 1 1 auto; }
|
||||
.top-list { list-style: none; margin: 0; padding: 6px 10px; overflow: auto; flex: 1 1 auto; min-height: 0; }
|
||||
.top-item {
|
||||
display: grid;
|
||||
grid-template-columns: 22px 54px minmax(0, 1fr) auto auto 56px;
|
||||
grid-template-columns: 24px 56px minmax(0, 1fr) minmax(0, 118px) 78px 64px;
|
||||
gap: 8px; align-items: center;
|
||||
padding: 5px 4px;
|
||||
border-bottom: 1px dashed var(--line);
|
||||
border-bottom: 1px dashed var(--scr-line);
|
||||
font-size: 12px;
|
||||
}
|
||||
.top-item:last-child { border-bottom: 0; }
|
||||
.top-item .rank { font-family: "Bahnschrift", monospace; font-size: 11px; color: var(--muted); }
|
||||
.top-item:nth-child(-n+3) .rank { color: var(--accent); font-weight: 700; }
|
||||
.top-tail { font-family: "Bahnschrift", monospace; font-size: 14px; font-weight: 700; letter-spacing: 0.03em; }
|
||||
.top-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
|
||||
.top-item .rank { grid-column: 1; font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace; font-size: 11px; color: var(--scr-muted); }
|
||||
.top-item:nth-child(-n+3) .rank { color: var(--scr-accent); font-weight: 700; }
|
||||
.top-tail { grid-column: 2; font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace; font-size: 14px; font-weight: 700; letter-spacing: 0.03em; color: var(--scr-text); }
|
||||
.top-name { grid-column: 3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--scr-text-2); }
|
||||
.top-pkg {
|
||||
font-size: 10px; padding: 1px 6px; border-radius: 2px;
|
||||
border-left: 2px solid var(--tag, var(--accent));
|
||||
background: color-mix(in srgb, var(--tag, var(--accent)) 14%, transparent);
|
||||
color: var(--ink-2); white-space: nowrap;
|
||||
grid-column: 4;
|
||||
font-size: 10px; padding: 1px 6px; border-radius: 999px;
|
||||
border-left: 2px solid var(--tag, var(--scr-accent));
|
||||
background: color-mix(in srgb, var(--tag, var(--scr-accent)) 14%, transparent);
|
||||
color: var(--scr-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
|
||||
}
|
||||
.top-remain { font-family: "Bahnschrift", monospace; font-size: 11px; white-space: nowrap; }
|
||||
.top-item.lv-today .top-remain { color: var(--danger); font-weight: 700; }
|
||||
.top-item.lv-warn .top-remain { color: var(--warn); }
|
||||
.top-bar { height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; }
|
||||
.top-bar i { display: block; height: 100%; background: var(--accent); }
|
||||
.top-item.lv-today .top-bar i { background: var(--danger); }
|
||||
.top-item.lv-warn .top-bar i { background: var(--warn); }
|
||||
.top-remain { grid-column: 5; font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace; font-size: 11px; color: var(--scr-text-2); white-space: nowrap; }
|
||||
.top-bar { grid-column: 6; height: 4px; background: var(--scr-line); border-radius: 999px; overflow: hidden; }
|
||||
.top-bar i { display: block; height: 100%; background: var(--scr-accent); }
|
||||
.top-item.lv-today .top-remain { color: var(--scr-danger); font-weight: 700; }
|
||||
.top-item.lv-warn .top-remain { color: var(--scr-warn); }
|
||||
.top-item.lv-today .top-bar i { background: var(--scr-danger); }
|
||||
.top-item.lv-warn .top-bar i { background: var(--scr-warn); }
|
||||
|
||||
/* ---------- 底部两块 ---------- */
|
||||
|
||||
.scr-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-height: 150px; max-height: 30vh; }
|
||||
.today-list { list-style: none; margin: 0; padding: 4px 10px 8px; overflow: auto; }
|
||||
.scr-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-height: 168px; max-height: 30vh; }
|
||||
.today-list { list-style: none; margin: 0; padding: 4px 10px 8px; overflow: auto; min-height: 0; }
|
||||
.today-list li {
|
||||
display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto;
|
||||
display: grid;
|
||||
grid-template-columns: auto minmax(0, 1fr) 86px 52px 76px;
|
||||
gap: 8px; align-items: center;
|
||||
padding: 5px 6px;
|
||||
border-bottom: 1px dashed var(--line);
|
||||
border-bottom: 1px dashed var(--scr-line);
|
||||
font-size: 12px;
|
||||
}
|
||||
.today-list li:last-child { border-bottom: 0; }
|
||||
.today-list li.urgent {
|
||||
background: color-mix(in srgb, var(--danger) 9%, transparent);
|
||||
border-left: 2px solid var(--danger);
|
||||
background: color-mix(in srgb, var(--scr-danger) 8%, transparent);
|
||||
border-left: 2px solid var(--scr-danger);
|
||||
padding-left: 8px;
|
||||
}
|
||||
.today-list .tchip { grid-column: 1; }
|
||||
.today-list .pkg { grid-column: 2; font-size: 10px; color: var(--scr-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.today-list .asg { grid-column: 3; }
|
||||
.today-list .tag-urgent { grid-column: 4; justify-self: start; }
|
||||
.today-list .rem { grid-column: 5; font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace; font-size: 11px; color: var(--scr-text-2); white-space: nowrap; text-align: right; }
|
||||
|
||||
.tchip {
|
||||
display: inline-flex; align-items: baseline; gap: 3px;
|
||||
padding: 1px 6px;
|
||||
border-left: 2px solid var(--tag, var(--accent));
|
||||
background: color-mix(in srgb, var(--tag, var(--accent)) 14%, transparent);
|
||||
border-radius: 1px; white-space: nowrap;
|
||||
border-left: 2px solid var(--tag, var(--scr-accent));
|
||||
background: color-mix(in srgb, var(--tag, var(--scr-accent)) 14%, transparent);
|
||||
border-radius: 2px 6px 6px 2px; white-space: nowrap;
|
||||
color: var(--scr-text-2);
|
||||
}
|
||||
.tchip b { font-family: "Bahnschrift", monospace; font-size: 13px; }
|
||||
.today-list .pkg { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.today-list .rem { font-family: "Bahnschrift", monospace; font-size: 11px; color: var(--ink-2); white-space: nowrap; }
|
||||
.tchip b { font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace; font-size: 13px; color: var(--scr-text); }
|
||||
|
||||
.tag-urgent {
|
||||
font-size: 9px; line-height: 1; padding: 2px 4px;
|
||||
background: var(--danger); color: #fff; border-radius: 2px;
|
||||
display: inline-flex; align-items: center;
|
||||
height: 18px; padding: 0 6px;
|
||||
font-size: 10px; font-weight: 700; line-height: 1;
|
||||
background: color-mix(in srgb, var(--scr-danger) 18%, var(--scr-panel));
|
||||
color: var(--scr-danger);
|
||||
border: 1px solid color-mix(in srgb, var(--scr-danger) 32%, transparent);
|
||||
border-radius: 999px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.scr-empty, .scr-empty-inline { color: var(--muted); font-size: 12px; padding: 16px; text-align: center; margin: 0; }
|
||||
.scr-empty, .scr-empty-inline { color: var(--scr-muted); font-size: 12px; padding: 16px; text-align: center; margin: 0; }
|
||||
.scr-empty-inline { padding: 0; text-align: left; }
|
||||
|
||||
/* ---------- 最近追加 ---------- */
|
||||
@@ -320,18 +311,18 @@ body::before {
|
||||
.scr-recent {
|
||||
display: flex; align-items: center; gap: 10px;
|
||||
padding: 5px 12px;
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line); border-radius: 3px;
|
||||
font-size: 11px; color: var(--muted);
|
||||
background: var(--scr-panel);
|
||||
border: 1px solid var(--scr-line); border-radius: 10px;
|
||||
font-size: 11px; color: var(--scr-muted);
|
||||
overflow: hidden;
|
||||
}
|
||||
.recent-label { flex: 0 0 auto; letter-spacing: 0.12em; color: var(--accent); font-size: 10px; }
|
||||
.recent-label { flex: 0 0 auto; letter-spacing: 0.12em; color: var(--scr-accent); font-size: 10px; }
|
||||
.recent-track { display: flex; gap: 18px; overflow: hidden; white-space: nowrap; }
|
||||
.recent-item { color: var(--ink-2); }
|
||||
.recent-item b { font-family: "Bahnschrift", monospace; font-size: 12px; color: var(--ink); margin-right: 3px; }
|
||||
.recent-item em { font-style: normal; color: var(--accent); margin-left: 3px; }
|
||||
.recent-item { color: var(--scr-text-2); }
|
||||
.recent-item b { font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace; font-size: 12px; color: var(--scr-text); margin-right: 3px; }
|
||||
.recent-item em { font-style: normal; color: var(--scr-accent); margin-left: 3px; }
|
||||
|
||||
.scr-foot { text-align: center; font-size: 10px; color: var(--muted); letter-spacing: 0.06em; }
|
||||
.scr-foot { text-align: center; font-size: 10px; color: var(--scr-muted); letter-spacing: 0.06em; }
|
||||
|
||||
/* ---------- 当日明细浮层 ---------- */
|
||||
|
||||
@@ -339,186 +330,72 @@ body::before {
|
||||
position: fixed; z-index: 60;
|
||||
width: 340px; max-height: 62vh; overflow: auto;
|
||||
padding: 10px 12px;
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--accent);
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7), var(--glow);
|
||||
background: var(--scr-panel);
|
||||
border: 1px solid var(--scr-accent);
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.55), var(--scr-glow);
|
||||
font-size: 12px;
|
||||
pointer-events: none;
|
||||
pointer-events: auto;
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
.day-pop[hidden] { display: none; }
|
||||
.day-pop h4 {
|
||||
margin: 0 0 6px; display: flex; align-items: baseline; justify-content: space-between;
|
||||
font-size: 12px; color: var(--ink);
|
||||
}
|
||||
.day-pop h4 small { font-weight: 400; color: var(--muted); font-size: 10px; }
|
||||
.day-pop .pop-meta { display: flex; gap: 10px; margin-bottom: 6px; font-size: 10px; color: var(--muted); }
|
||||
.day-pop .pop-meta b { color: var(--ink-2); font-family: "Bahnschrift", monospace; }
|
||||
.day-pop h4 { margin: 0 0 6px; display: flex; align-items: baseline; justify-content: space-between; font-size: 12px; color: var(--scr-text); }
|
||||
.day-pop h4 small { font-weight: 400; color: var(--scr-muted); font-size: 10px; }
|
||||
.day-pop .pop-meta { display: flex; gap: 10px; margin-bottom: 6px; font-size: 10px; color: var(--scr-muted); }
|
||||
.day-pop .pop-meta b { color: var(--scr-text-2); font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace; }
|
||||
.day-pop ul { list-style: none; margin: 0; padding: 0; }
|
||||
.day-pop li {
|
||||
display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
|
||||
gap: 6px; align-items: center;
|
||||
padding: 3px 0; border-bottom: 1px dashed var(--line);
|
||||
}
|
||||
.day-pop li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 3px 0; border-bottom: 1px dashed var(--scr-line); }
|
||||
.day-pop li:last-child { border-bottom: 0; }
|
||||
.day-pop li.urgent { color: var(--danger); }
|
||||
.day-pop li.urgent { color: var(--scr-danger); }
|
||||
.day-pop li.done { opacity: 0.45; text-decoration: line-through; }
|
||||
.day-pop .pop-tail { font-family: "Bahnschrift", monospace; font-size: 12px; font-weight: 700; }
|
||||
.day-pop .pop-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
|
||||
.day-pop .pop-rem { font-size: 10px; color: var(--muted); white-space: nowrap; }
|
||||
.day-pop .pop-more { margin-top: 6px; font-size: 10px; color: var(--muted); text-align: right; }
|
||||
.day-pop .pop-empty { color: var(--muted); text-align: center; padding: 8px 0; }
|
||||
.day-pop .pop-tail { font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace; font-size: 12px; font-weight: 700; }
|
||||
.day-pop .pop-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--scr-text-2); }
|
||||
.day-pop .pop-rem { font-size: 10px; color: var(--scr-muted); white-space: nowrap; }
|
||||
.day-pop .pop-more { margin-top: 6px; font-size: 10px; color: var(--scr-muted); text-align: right; }
|
||||
.day-pop .pop-empty { color: var(--scr-muted); text-align: center; padding: 8px 0; }
|
||||
|
||||
/* ---------- 小屏适配(笔记本投屏也常见) ---------- */
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
.scr-main { grid-template-columns: 1fr 1fr; }
|
||||
.scr-kpis .kpi b { font-size: 24px; }
|
||||
.top-item { grid-template-columns: 20px 48px minmax(0, 1fr) auto 48px; }
|
||||
.top-item .top-pkg { display: none; }
|
||||
}
|
||||
|
||||
@media (max-width: 860px) {
|
||||
body { overflow: auto; }
|
||||
.scr { height: auto; }
|
||||
.scr-main, .scr-bottom { grid-template-columns: 1fr; }
|
||||
.scr-tabs, .scr-links { display: none; }
|
||||
}
|
||||
|
||||
|
||||
/* ---------- 打手颜色(大屏) ---------- */
|
||||
/* ---------- 打手颜色 ---------- */
|
||||
|
||||
.asg-strip {
|
||||
position: absolute; left: 0; top: 0; bottom: 0;
|
||||
display: flex; flex-direction: column;
|
||||
width: 3px; overflow: hidden;
|
||||
width: 3px; overflow: hidden; border-radius: 6px 0 0 6px;
|
||||
}
|
||||
.asg-strip i { display: block; flex: 1 1 0; min-height: 3px; }
|
||||
.asg-strip.sm { width: 3px; }
|
||||
|
||||
.heat-cell { padding-left: 9px; }
|
||||
|
||||
.asg {
|
||||
display: inline-flex; align-items: center; gap: 4px;
|
||||
font-size: 10px; color: var(--ink-2); white-space: nowrap;
|
||||
overflow: hidden; text-overflow: ellipsis;
|
||||
}
|
||||
.asg i { width: 7px; height: 7px; border-radius: 1px; flex: 0 0 auto; }
|
||||
.asg.none { color: var(--muted); }
|
||||
.asg { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; color: var(--scr-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.asg i { width: 7px; height: 7px; border-radius: 2px; flex: 0 0 auto; }
|
||||
.asg.none { color: var(--scr-muted); }
|
||||
.asg.none i { opacity: 0.5; }
|
||||
|
||||
.today-list li { grid-template-columns: auto minmax(0, 1fr) auto auto auto; }
|
||||
.pop-who { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 4px; vertical-align: 0; }
|
||||
|
||||
.pop-who {
|
||||
display: inline-block; width: 7px; height: 7px;
|
||||
border-radius: 1px; margin-right: 4px; vertical-align: 0;
|
||||
/* ---------- 小屏 / 投屏适配 ---------- */
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
.scr-main { grid-template-columns: 1fr 1fr; }
|
||||
.scr-kpis .kpi b { font-size: 24px; }
|
||||
.top-item { grid-template-columns: 24px 52px minmax(0, 1fr) 78px 56px; }
|
||||
.top-item .top-pkg { display: none; }
|
||||
.top-remain { grid-column: 4; }
|
||||
.top-bar { grid-column: 5; }
|
||||
.today-list li { grid-template-columns: auto minmax(0, 1fr) 52px 76px; }
|
||||
.today-list .asg { display: none; }
|
||||
.today-list .tag-urgent { grid-column: 3; }
|
||||
.today-list .rem { grid-column: 4; }
|
||||
}
|
||||
|
||||
@media (max-width: 860px) {
|
||||
body.screen-body { overflow: auto; }
|
||||
.scr { height: auto; }
|
||||
.scr-main, .scr-bottom { grid-template-columns: 1fr; }
|
||||
.scr-bottom { max-height: none; }
|
||||
.scr-tabs, .scr-links { display: none; }
|
||||
.scr-clock { margin-left: 0; }
|
||||
.scr-kpis { grid-template-columns: 1fr 1fr; }
|
||||
}
|
||||
|
||||
/* ---------- v1.9.1:大屏对齐 Bootstrap ---------- */
|
||||
.heat-cell { border-color: var(--bs-border-color); }
|
||||
.heat-cell.h1 { background: rgba(var(--bs-success-rgb), 0.14); }
|
||||
.heat-cell.h2 { background: rgba(var(--bs-success-rgb), 0.26); }
|
||||
.heat-cell.h3 { background: rgba(var(--bs-success-rgb), 0.40); }
|
||||
.heat-cell.h4 { background: rgba(var(--bs-success-rgb), 0.58); }
|
||||
.scr-kpis .kpi { --bs-card-border-color: var(--bs-border-color); }
|
||||
|
||||
/* v1.9.2 ink */
|
||||
.scr-tabs a.on { background: linear-gradient(135deg,#16543f,#2fa37a); border-color: transparent; }
|
||||
|
||||
/* v1.9.4:大屏弱化文字提亮,提升可读性 */
|
||||
.scr { --muted: #9fb8ab; --ink-2: #b9d2c6; }
|
||||
.scr-links, .scr-foot, .scr-head .sub, .scr-head em,
|
||||
.kpi small, .kpi .unit, .panel-sub,
|
||||
.top-item .meta, .top-item .sub, .due-item .sub,
|
||||
.heat-cell .lbl, .scr-note { color: #a9c3b6 !important; }
|
||||
.scr a { color: #8fe0bf !important; }
|
||||
.cal-dow span, .scr-cal .dow { color: #a9c3b6 !important; }
|
||||
.kpi b, .kpi strong { color: #eafff6 !important; }
|
||||
.heat-cell.h1 { color: #dff5ea; }
|
||||
/* v1.9.4:非本月日期再提亮一档 */
|
||||
.heat-cell.out, .scr-cal .out { color: #a9c3b6 !important; opacity: .85; }
|
||||
/* v1.9.5:热力日历对齐修复 + 文字反色 */
|
||||
.panel-head { position: relative; z-index: 2; }
|
||||
.heat-grid { overflow: hidden; min-width: 0; }
|
||||
.heat-dow, .heat-row {
|
||||
display: grid !important;
|
||||
grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
|
||||
grid-auto-flow: row;
|
||||
gap: 4px;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.heat-cell { transition: none; }
|
||||
}
|
||||
.heat-row { align-items: stretch; }
|
||||
.heat-cell {
|
||||
width: 100% !important;
|
||||
min-width: 0;
|
||||
aspect-ratio: auto !important;
|
||||
min-height: 34px;
|
||||
padding: 2px 6px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.heat-cell span, .heat-cell b, .heat-cell em {
|
||||
color: var(--ink-ink) !important;
|
||||
font-family: "Bahnschrift", monospace;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.heat-cell b { color: #63d6ad !important; font-weight: 700; }
|
||||
.heat-cell.out { opacity: .45 !important; }
|
||||
.heat-cell.past { opacity: .75 !important; }
|
||||
.heat-legend { margin-top: 6px; color: var(--muted); }
|
||||
/* ---------- v1.9.5:大屏浅色主题配色修复 ---------- */
|
||||
:root[data-theme="light"] .scr,
|
||||
:root[data-bs-theme="light"] .scr {
|
||||
--bg: #f2f7f4;
|
||||
--surface: #ffffff;
|
||||
--surface-2: #eaf1ed;
|
||||
--line: #d7e3dc;
|
||||
--line-2: #c6d8cf;
|
||||
--muted: #55705f;
|
||||
--ink: #0f241d;
|
||||
--ink-2: #27453a;
|
||||
--accent: #16543f;
|
||||
--accent-2: #1d7a58;
|
||||
color: #0f241d;
|
||||
}
|
||||
:root[data-theme="light"] .scr a,
|
||||
:root[data-bs-theme="light"] .scr a { color: #16543f; }
|
||||
:root[data-theme="light"] .scr em,
|
||||
:root[data-theme="light"] .scr small,
|
||||
:root[data-theme="light"] .scr .sub,
|
||||
:root[data-theme="light"] .scr .meta,
|
||||
:root[data-theme="light"] .scr .unit,
|
||||
:root[data-theme="light"] .scr .panel-sub,
|
||||
:root[data-theme="light"] .scr .scr-links,
|
||||
:root[data-theme="light"] .scr .scr-foot { color: #55705f !important; }
|
||||
:root[data-theme="light"] .scr-tags a,
|
||||
:root[data-theme="light"] .scr-tabs a,
|
||||
:root[data-theme="light"] .scr-switch,
|
||||
:root[data-theme="light"] .scr-head .sub { color: #27453a !important; background: #ffffff; border: 1px solid #d7e3dc; }
|
||||
:root[data-theme="light"] .scr-tags a.on,
|
||||
:root[data-theme="light"] .scr-tabs a.on { color: #ffffff !important; background: linear-gradient(135deg,#16543f,#2fa37a); border-color: transparent; }
|
||||
:root[data-theme="light"] .kpi,
|
||||
:root[data-theme="light"] .kpi b,
|
||||
:root[data-theme="light"] .kpi strong,
|
||||
:root[data-theme="light"] .kpi small,
|
||||
:root[data-theme="light"] .kpi .unit { color: #0f241d !important; }
|
||||
:root[data-theme="light"] .kpi b,
|
||||
:root[data-theme="light"] .kpi strong { color: #16543f !important; }
|
||||
:root[data-theme="light"] .heat-cell,
|
||||
:root[data-theme="light"] .heat-cell span,
|
||||
:root[data-theme="light"] .heat-cell b { color: #0f241d !important; }
|
||||
:root[data-theme="light"] .heat-cell b { color: #16543f !important; }
|
||||
:root[data-theme="light"] .heat-cell.out { opacity: .55 !important; }
|
||||
:root[data-theme="light"] .heat-cell .note,
|
||||
:root[data-theme="light"] .heat-legend { color: #55705f !important; }
|
||||
:root[data-theme="light"] .top-item,
|
||||
:root[data-theme="light"] .top-item span,
|
||||
:root[data-theme="light"] .top-item b,
|
||||
:root[data-theme="light"] .due-item,
|
||||
:root[data-theme="light"] .today-item { color: #0f241d !important; }
|
||||
:root[data-theme="light"] .top-item .pkg-tag,
|
||||
:root[data-theme="light"] .top-item em,
|
||||
:root[data-theme="light"] .today-item em { color: #1d7a58 !important; }
|
||||
:root[data-theme="light"] .panel-head h2 { color: #0f241d; }
|
||||
:root[data-theme="light"] .heat-dow span { color: #55705f !important; }
|
||||
:root[data-theme="light"] .scr-note { color: #55705f !important; }
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 大屏:时钟 + 全屏 + 主题 + 日历悬停明细 */
|
||||
/* 大屏:时钟 + 全屏 + 主题 + 日历悬停/点按明细 */
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
@@ -25,32 +25,42 @@
|
||||
document.documentElement.requestFullscreen();
|
||||
}
|
||||
}
|
||||
if (e.key === 'Escape') { hide(); }
|
||||
});
|
||||
|
||||
/* ---------- 主题切换 ---------- */
|
||||
/* ---------- 主题切换:唯一状态源 data-bs-theme ---------- */
|
||||
var THEME_KEY = 'daili_theme';
|
||||
function effectiveTheme() {
|
||||
var attr = document.documentElement.getAttribute('data-theme');
|
||||
if (attr === 'light' || attr === 'dark') return attr;
|
||||
return window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';
|
||||
var root = document.documentElement;
|
||||
var themeBtns = document.querySelectorAll('[data-theme-toggle]');
|
||||
|
||||
function currentTheme() {
|
||||
return root.getAttribute('data-bs-theme') === 'light' ? 'light' : 'dark';
|
||||
}
|
||||
document.querySelectorAll('[data-theme-toggle]').forEach(function (btn) {
|
||||
function paintTheme() {
|
||||
var dark = currentTheme() === 'dark';
|
||||
themeBtns.forEach(function (b) { b.setAttribute('aria-pressed', dark ? 'true' : 'false'); });
|
||||
}
|
||||
|
||||
themeBtns.forEach(function (btn) {
|
||||
btn.addEventListener('click', function () {
|
||||
var next = effectiveTheme() === 'dark' ? 'light' : 'dark';
|
||||
document.documentElement.setAttribute('data-theme', next);
|
||||
var next = currentTheme() === 'dark' ? 'light' : 'dark';
|
||||
root.setAttribute('data-bs-theme', next);
|
||||
document.cookie = THEME_KEY + '=' + next + '; path=/; max-age=31536000; SameSite=Lax';
|
||||
paintTheme();
|
||||
});
|
||||
});
|
||||
paintTheme();
|
||||
|
||||
/* ---------- 日历格子悬停明细 ---------- */
|
||||
var root = document.querySelector('.scr');
|
||||
/* ---------- 日历格子明细 ---------- */
|
||||
var scr = document.querySelector('.scr');
|
||||
var pop = document.getElementById('day-pop');
|
||||
if (!root || !pop) return;
|
||||
if (!scr || !pop) return;
|
||||
|
||||
var api = root.getAttribute('data-api') || '/api/screen/day';
|
||||
var pkg = root.getAttribute('data-pkg') || '0';
|
||||
var api = scr.getAttribute('data-api') || '/api/screen/day';
|
||||
var pkg = scr.getAttribute('data-pkg') || '0';
|
||||
var cache = {};
|
||||
var hideTimer = null;
|
||||
var pinned = false;
|
||||
|
||||
function esc(s) {
|
||||
return String(s == null ? '' : s).replace(/[&<>"']/g, function (c) {
|
||||
@@ -77,7 +87,7 @@
|
||||
var d = new Date(data.date + 'T00:00:00');
|
||||
var label = data.date + ' 周' + '日一二三四五六'.charAt(d.getDay());
|
||||
var html = '<h4>' + esc(label) + '<small>' + data.total + ' 单 · 已完成 ' + data.done +
|
||||
(data.urgent ? ' · <span style="color:var(--danger)">加急 ' + data.urgent + '</span>' : '') + '</small></h4>';
|
||||
(data.urgent ? ' · <span style="color:var(--scr-danger)">加急 ' + data.urgent + '</span>' : '') + '</small></h4>';
|
||||
if (!data.items || !data.items.length) {
|
||||
html += '<div class="pop-empty">这天没有排单</div>';
|
||||
} else {
|
||||
@@ -121,12 +131,32 @@
|
||||
});
|
||||
}
|
||||
|
||||
function hideSoon() {
|
||||
hideTimer = setTimeout(function () { pop.hidden = true; }, 160);
|
||||
function hide() {
|
||||
clearTimeout(hideTimer);
|
||||
pinned = false;
|
||||
pop.hidden = true;
|
||||
}
|
||||
function hideSoon() {
|
||||
if (pinned) return;
|
||||
clearTimeout(hideTimer);
|
||||
hideTimer = setTimeout(function () { pop.hidden = true; }, 260);
|
||||
}
|
||||
function keepOpen() { clearTimeout(hideTimer); }
|
||||
|
||||
document.querySelectorAll('.heat-cell[data-date]').forEach(function (cell) {
|
||||
cell.addEventListener('mouseenter', function () { show(cell); });
|
||||
cell.addEventListener('mouseleave', hideSoon);
|
||||
cell.addEventListener('focus', function () { show(cell); });
|
||||
cell.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
var openForCell = !pop.hidden && pop.dataset.date === cell.getAttribute('data-date');
|
||||
if (openForCell) { hide(); return; }
|
||||
pinned = true;
|
||||
show(cell);
|
||||
pop.dataset.date = cell.getAttribute('data-date');
|
||||
});
|
||||
});
|
||||
|
||||
pop.addEventListener('mouseenter', keepOpen);
|
||||
pop.addEventListener('mouseleave', function () { if (!pinned) hideSoon(); });
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user