HEL-301: apply frost-obsidian day/night theme across the archive UI.

Replace inline styles with shared tokens, add remembered day/night/system switching, a details drawer, and hold-to-confirm for irreversible deletes without changing business logic.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
梁铭洋
2026-08-31 19:51:39 +08:00
co-authored by Cursor multica-agent
parent 472cf7942e
commit e0fca95a6a
5 changed files with 1204 additions and 297 deletions
+685
View File
@@ -0,0 +1,685 @@
/* 霜曜融合 · 日夜主题。颜色/字体/圆角/阴影/动效唯一来源。勿在页面叠加覆盖。 */
:root {
--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
--ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
--ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
--side-w: 232px;
--radius: 9px;
--radius-lg: 14px;
--font-body: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
--font-mono: ui-monospace, "JetBrains Mono", "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
--focus-ring: #0a84ff;
--bg: #f5f5f7;
--text: #1d1d1f;
--text-2: #6e6e73;
--text-3: #8e8e93;
--hairline: rgba(0, 0, 0, 0.08);
--surface: #ffffff;
--material: rgba(255, 255, 255, 0.62);
--accent: #c62f22;
--accent-solid: #c62f22;
--accent-soft: rgba(198, 47, 34, 0.08);
--gold: #8a6d1a;
--gold-bright: #b8933d;
--gold-soft: rgba(138, 109, 26, 0.09);
--gold-line: rgba(138, 109, 26, 0.28);
--green: #248a3d;
--green-bg: rgba(52, 199, 89, 0.12);
--orange: #b25000;
--orange-bg: rgba(255, 159, 10, 0.14);
--red: #d70015;
--red-bg: rgba(255, 59, 48, 0.10);
--red-solid: #d70015;
--gray-bg: rgba(120, 120, 128, 0.12);
--surface-2: #ffffff;
--fill: rgba(118, 118, 128, 0.10);
--fill-strong: rgba(118, 118, 128, 0.16);
--hover: rgba(0, 0, 0, 0.045);
--row-hover: rgba(0, 0, 0, 0.025);
--scrim: rgba(0, 0, 0, 0.24);
--pushback-filter: brightness(0.98);
--material-drawer: rgba(255, 255, 255, 0.86);
--shadow-drawer: -24px 0 64px rgba(0, 0, 0, 0.14);
--grip: rgba(0, 0, 0, 0.18);
--gold-fade: rgba(138, 109, 26, 0.03);
--switch-off: rgba(120, 120, 128, 0.24);
--switch-on: #34c759;
--focus-glow: rgba(10, 132, 255, 0.18);
--red-glow: rgba(255, 59, 48, 0.14);
--red-line: rgba(215, 0, 21, 0.45);
--material-toast: rgba(30, 30, 32, 0.92);
--shadow-toast: 0 8px 24px rgba(0, 0, 0, 0.22);
--shadow-seg: 0 1px 3px rgba(0, 0, 0, 0.10), 0 0 0 1px rgba(0, 0, 0, 0.03);
--login-card: rgba(255, 255, 255, 0.86);
--line: var(--hairline);
--card: var(--surface);
--muted: var(--text-2);
--input-border: var(--hairline);
--input-bg: var(--surface);
--primary: var(--accent-solid);
--primary-hover: var(--accent);
--head: var(--fill);
--shadow: none;
}
html[data-theme="night"] {
color-scheme: dark;
--focus-ring: #409cff;
--bg: #100f0d;
--text: #f2f0eb;
--text-2: #a9a49b;
--text-3: #8e8a82;
--hairline: rgba(255, 255, 255, 0.10);
--surface: #1b1916;
--surface-2: #2a2721;
--material: rgba(26, 24, 21, 0.62);
--fill: rgba(255, 255, 255, 0.08);
--fill-strong: rgba(255, 255, 255, 0.13);
--hover: rgba(255, 255, 255, 0.05);
--row-hover: rgba(255, 255, 255, 0.04);
--scrim: rgba(0, 0, 0, 0.52);
--pushback-filter: brightness(0.92);
--accent: #e05341;
--accent-solid: #cf4529;
--accent-soft: rgba(224, 83, 65, 0.16);
--gold: #d9b45c;
--gold-bright: #f0cd7a;
--gold-soft: rgba(217, 180, 92, 0.13);
--gold-line: rgba(217, 180, 92, 0.34);
--gold-fade: rgba(217, 180, 92, 0.04);
--green: #45cd6e;
--green-bg: rgba(69, 205, 110, 0.15);
--orange: #ffb340;
--orange-bg: rgba(255, 179, 64, 0.15);
--red: #ff6b5e;
--red-bg: rgba(255, 107, 94, 0.14);
--red-solid: #d63c2f;
--gray-bg: rgba(150, 150, 158, 0.16);
--material-drawer: rgba(31, 29, 25, 0.84);
--shadow-drawer: -24px 0 64px rgba(0, 0, 0, 0.55);
--grip: rgba(255, 255, 255, 0.22);
--switch-off: rgba(120, 120, 128, 0.34);
--switch-on: #30d158;
--focus-glow: rgba(64, 156, 255, 0.30);
--red-glow: rgba(255, 107, 94, 0.20);
--red-line: rgba(255, 107, 94, 0.50);
--material-toast: rgba(54, 52, 47, 0.94);
--shadow-toast: 0 8px 24px rgba(0, 0, 0, 0.50);
--shadow-seg: 0 1px 3px rgba(0, 0, 0, 0.50), 0 0 0 1px rgba(255, 255, 255, 0.06);
--login-card: rgba(31, 29, 25, 0.88);
}
html[data-theme-anim],
html[data-theme-anim] *,
html[data-theme-anim] *::before,
html[data-theme-anim] *::after {
transition-property: color, background-color, border-color, box-shadow, filter, opacity !important;
transition-duration: 200ms !important;
transition-timing-function: ease !important;
transition-delay: 0ms !important;
}
*, *::before, *::after { box-sizing: border-box; }
html { font: 14px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; color-scheme: light; }
html, body { max-width: 100%; }
body {
min-height: 100vh;
margin: 0;
color: var(--text);
background:
radial-gradient(1200px 600px at 85% -10%, rgba(198, 47, 34, 0.05), transparent 60%),
radial-gradient(900px 500px at -10% 110%, rgba(138, 109, 26, 0.05), transparent 55%),
var(--bg);
}
html[data-theme="night"] body {
background:
radial-gradient(1200px 600px at 85% -10%, rgba(224, 83, 65, 0.07), transparent 60%),
radial-gradient(900px 500px at -10% 110%, rgba(217, 180, 92, 0.06), transparent 55%),
var(--bg);
}
img { display: block; }
.num, td.col-amount, td.col-rate, td.col-date,
.fin-out-num, .metric .v {
font-variant-numeric: tabular-nums;
font-family: var(--font-mono), var(--font-body);
}
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 6px; }
/* —— Shell —— */
.v-fusion { min-height: 100vh; display: flex; color: var(--text); }
.sidebar {
width: var(--side-w); flex: 0 0 var(--side-w);
position: sticky; top: 0; height: 100vh;
display: flex; flex-direction: column;
padding: 20px 14px;
background: var(--material);
-webkit-backdrop-filter: blur(24px) saturate(180%);
backdrop-filter: blur(24px) saturate(180%);
border-right: 1px solid var(--hairline);
z-index: 20;
overflow: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; color: inherit; text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 9px; }
html[data-theme="night"] .logo-day { display: none; }
html:not([data-theme="night"]) .logo-night { display: none; }
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--text-3); letter-spacing: 0.02em; }
.nav-label { font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: 0.04em; padding: 14px 10px 6px; }
.nav-item {
display: flex; align-items: center; gap: 9px;
width: 100%; padding: 7px 10px; border-radius: 8px;
font-size: 13.5px; color: var(--text-2); text-align: left;
text-decoration: none; background: none; border: 0; cursor: pointer;
transition: background-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out);
}
.nav-item:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
.nav-item:hover { background: var(--hover); color: var(--text); }
}
.nav-item[data-active], .nav-item.current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0; flex: 0 0 auto; }
.nav-item[data-active] .dot, .nav-item.current .dot { opacity: 1; }
.sidebar-foot { margin-top: auto; padding: 12px 10px 4px; font-size: 11.5px; color: var(--text-3); border-top: 1px solid var(--hairline); }
.theme-toggle { display: flex; gap: 2px; padding: 2px; margin: 12px 8px 0; background: var(--fill); border-radius: 9px; }
.theme-toggle button {
flex: 1; height: 26px; border-radius: 7px; font-size: 11.5px; color: var(--text-2);
background: none; border: 0; cursor: pointer; padding: 0 4px; font-weight: 500;
transition: color 150ms ease, background-color 150ms ease;
}
.theme-toggle button[aria-pressed="true"] {
color: var(--text); font-weight: 600; background: var(--surface-2); box-shadow: var(--shadow-seg);
}
.nav-burger {
display: none; width: 32px; height: 32px; border-radius: 9px;
background: var(--fill); border: 0; color: var(--text); cursor: pointer;
align-items: center; justify-content: center; font-size: 16px;
}
.nav-scrim {
display: none; position: fixed; inset: 0; z-index: 19; background: var(--scrim);
}
.content-shell { flex: 1; min-width: 0; display: flex; flex-direction: column; transition: transform 300ms var(--ease-out), filter 300ms var(--ease-out); transform-origin: center 40%; }
.v-fusion[data-drawer-open] .content-shell { transform: scale(0.985); filter: var(--pushback-filter); }
.content, .wrap { flex: 1; min-width: 0; padding: 28px 36px 80px; width: 100%; box-sizing: border-box; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title, .card > h3, h3.section-title {
font-size: 26px; font-weight: 700; letter-spacing: -0.022em; line-height: 1.15; margin: 0 0 6px;
}
.page-sub { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.page-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* —— Buttons —— */
button {
font: inherit; cursor: pointer;
display: inline-flex; align-items: center; justify-content: center; gap: 6px;
height: 32px; padding: 0 15px; border-radius: var(--radius);
font-size: 13px; font-weight: 600; border: 0;
background: var(--accent-solid); color: #fff;
transition: transform 160ms var(--ease-out), background-color 150ms ease, filter 150ms ease;
}
button:active, .btn:active, .toolbar-btn:active, .icon-btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
button:hover { filter: brightness(1.07); }
}
.btn, .toolbar-btn, .icon-btn, .clear-link {
display: inline-flex; align-items: center; justify-content: center; gap: 4px;
height: 32px; padding: 0 12px; border-radius: var(--radius);
font-size: 13px; font-weight: 600; text-decoration: none; box-sizing: border-box;
transition: transform 160ms var(--ease-out), background-color 150ms ease, filter 150ms ease, border-color 150ms ease, color 150ms ease;
}
.btn--primary, .toolbar-btn.primary { background: var(--accent-solid); border: 0; color: #fff; }
.btn--plain, .toolbar-btn, .icon-btn, .clear-link, button.btn-gray, .btn-gray {
background: var(--fill); color: var(--text); border: 1px solid transparent;
}
@media (hover: hover) and (pointer: fine) {
.btn--plain:hover, .toolbar-btn:hover, .icon-btn:hover, .clear-link:hover, .btn-gray:hover {
background: var(--fill-strong);
}
.btn--primary:hover, .toolbar-btn.primary:hover { filter: brightness(1.07); color: #fff; }
}
.icon-btn { height: 28px; padding: 0 10px; font-size: 12px; }
.icon-btn.danger, .btn-danger, button.btn-danger {
background: var(--red-bg); color: var(--red); border: 1px solid var(--red-line);
}
.icon-btn.danger:hover, .btn-danger:hover { background: var(--red-bg); color: var(--red); filter: none; }
.a { color: var(--text); text-decoration: none; }
/* —— Forms —— */
input, select, textarea {
font: inherit; color: var(--text);
padding: 0 11px; height: 34px;
border: 1px solid var(--hairline); border-radius: var(--radius);
background: var(--surface);
outline: none;
transition: border-color 150ms ease, box-shadow 150ms ease;
}
textarea { height: auto; min-height: 72px; padding: 8px 11px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus {
border-color: var(--focus-ring); box-shadow: 0 0 0 3px var(--focus-glow);
}
input[type="file"] { height: auto; padding: 6px; }
input[type="checkbox"], input[type="radio"] { width: auto; height: auto; padding: 0; }
/* —— Cards / layout —— */
.card {
background: var(--surface);
border: 1px solid var(--hairline);
border-radius: var(--radius-lg);
padding: 16px 18px;
min-width: 0;
}
.grid { display: grid; grid-template-columns: minmax(180px, 250px) minmax(0, 1fr); gap: 14px; min-width: 0; }
.muted, .path, .small { color: var(--text-2); }
.small { font-size: 12px; }
.inline { display: inline; }
/* —— Stats / metrics —— */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat, .metric {
position: relative;
background: var(--surface); border-radius: var(--radius-lg); padding: 16px 18px;
border: 1px solid var(--hairline);
text-decoration: none; color: inherit; display: block;
}
.stat-label, .metric .k { font-size: 12px; color: var(--text-2); }
.stat-value, .metric .v { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-top: 3px; color: var(--text); }
.stat-value small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.stat-foot { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.stat--alert .stat-value, .metric.m-overdue .v { color: var(--red); }
.stat--gold::before, .metric.m-active::before {
content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 2px;
border-radius: 2px; background: linear-gradient(90deg, var(--gold), var(--gold-bright));
}
.stat--gold .stat-value, .metric.m-active .v { color: var(--gold); }
.metric.m-due .v { color: var(--orange); }
.subtle-link { color: inherit; text-decoration: none; }
.subtle-link:hover { filter: brightness(1.05); }
/* —— Table —— */
.table-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th, th {
text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: 0.03em;
color: var(--text-3); padding: 10px 12px; border-bottom: 1px solid var(--hairline);
background: transparent; white-space: nowrap;
}
td { padding: 10px 12px; border-bottom: 1px solid var(--hairline); }
tbody tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr { transition: background-color 120ms ease; }
@media (hover: hover) and (pointer: fine) {
.table-wrap tbody tr:hover { background: var(--row-hover); }
}
.cell-main { font-weight: 600; }
.cell-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.cell-right { text-align: right; }
.cell-remaining { font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
tr[data-status="over"] .cell-remaining, tr[data-status="逾期中"] .cell-remaining { color: var(--red); }
tr[data-status="done"] .cell-remaining, tr[data-status="已完成"] .cell-remaining { color: var(--text-3); font-weight: 600; }
.table-wrap { overflow-x: hidden; max-width: 100%; width: 100%; }
.table-wrap table { min-width: 0; width: 100%; }
.table-wrap thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.table-wrap th:last-child, .table-wrap td:last-child { position: sticky; right: 0; background: var(--surface); z-index: 1; }
.table-wrap thead th:last-child { z-index: 3; }
.fixed-table { table-layout: fixed; }
.truncate { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-check { width: 34px; }
.col-kind { width: 64px; text-align: center; }
.th-stack { display: flex; flex-direction: column; gap: 2px; line-height: 1.2; align-items: flex-start; }
.th-sub { font-size: 11px; font-weight: 400; color: var(--text-3); }
.col-name { width: 108px; }
.col-inst { width: 96px; }
.col-borrower { width: 88px; }
.col-guarantor { width: 88px; }
.col-amount { width: 84px; }
.col-date { width: 68px; }
.col-rate { width: 46px; }
.col-status { width: 72px; }
.col-action { width: 148px; }
/* —— Pills / badges —— */
.pill, .badge {
display: inline-flex; align-items: center; gap: 5px;
height: 22px; padding: 0 9px; border-radius: 999px;
font-size: 11.5px; font-weight: 600; border: 0;
}
.pill::before, .badge.b1::before, .badge.b2::before, .badge.b3::before, .badge.b4::before {
content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor;
}
.pill--ok, .badge.b1 { color: var(--green); background: var(--green-bg); }
.pill--due, .badge.b3 { color: var(--orange); background: var(--orange-bg); }
.pill--over, .badge.b4 { color: var(--red); background: var(--red-bg); }
.pill--done, .badge.b2 { color: var(--text-2); background: var(--gray-bg); }
.badge-k-loan { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.badge-k-guar { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-weight: 600; }
/* —— Toolbar / pager —— */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar-left { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.pager a { color: var(--accent); text-decoration: none; }
.pager a:hover { text-decoration: underline; }
.icon-actions { display: flex; gap: 4px; flex-wrap: nowrap; white-space: nowrap; }
/* —— Tree —— */
.tree { position: sticky; top: 16px; max-height: calc(100vh - 48px); overflow: auto; }
.tree ul { list-style: none; padding-left: 14px; margin: 0; }
.tree li { margin: 2px 0; position: relative; }
.tree details { margin: 2px 0; }
.tree summary { cursor: pointer; color: var(--text); list-style: none; }
.tree summary::-webkit-details-marker { display: none; }
.tree li::before { content: ""; position: absolute; left: -9px; top: -6px; bottom: -6px; border-left: 1px solid var(--hairline); }
.tree li::after { content: ""; position: absolute; left: -9px; top: 15px; width: 9px; border-top: 1px solid var(--hairline); }
.tree > ul > li::before, .tree > ul > li::after { display: none; }
.tree-item { display: flex; align-items: center; gap: 6px; min-height: 28px; padding: 2px 4px; border-radius: 8px; }
.tree-item:hover { background: var(--hover); }
.tree-toggle { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 4px; color: var(--text-3); font-size: 11px; user-select: none; }
details[open] > summary .tree-toggle { transform: rotate(90deg); }
.tree-link { color: var(--text); text-decoration: none; display: inline-block; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-link:hover { text-decoration: underline; }
.tree-link.current { font-weight: 700; color: var(--accent); }
.tree-link.current::before { content: ""; display: inline-block; width: 3px; height: 14px; background: var(--accent); border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.tree-link.ancestor { font-weight: 600; color: var(--text); }
.tree-actions { display: inline-flex; gap: 4px; margin-left: auto; opacity: .25; transition: opacity .2s; }
.tree-item:hover .tree-actions, .tree-link.current + .tree-actions { opacity: 1; }
.tree-btn {
display: inline-flex; align-items: center; justify-content: center;
width: 18px; height: 18px; border: 1px solid transparent; border-radius: 5px;
text-decoration: none; font-size: 11px; background: transparent; color: var(--text-3);
}
.tree-btn:hover { border-color: var(--hairline); background: var(--fill); }
.tree-btn.edit:hover { color: var(--accent); }
.tree-btn.add:hover { color: var(--green); }
.tree-btn.del { opacity: 0; visibility: hidden; }
.tree-item:hover .tree-btn.del, .tree-link.current + .tree-actions .tree-btn.del { opacity: 1; visibility: visible; }
.tree-btn.del:hover { color: var(--red); }
.quick-links-col { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.quick-links-col .tree-link { padding: 4px 2px; }
.quick-menu-details { border: 1px solid var(--hairline); border-radius: 10px; background: var(--fill); overflow: hidden; }
.quick-menu-details > summary { list-style: none; cursor: pointer; padding: 8px 10px; font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 8px; user-select: none; }
.quick-menu-details > summary::-webkit-details-marker { display: none; }
.quick-menu-details > summary::after { content: "▶"; font-size: 10px; color: var(--text-3); transition: transform .2s; }
.quick-menu-details[open] > summary::after { transform: rotate(90deg); }
.quick-menu-hint { font-weight: 400; color: var(--text-3); font-size: 12px; }
.quick-menu-details .quick-links-col { padding: 4px 10px 12px; }
/* —— Archive form —— */
.archive-form-grid { display: grid; grid-template-columns: 1fr; gap: 10px 12px; max-width: 920px; }
.archive-form-grid .form-actions { grid-column: 1/-1; display: flex; gap: 10px; align-items: center; }
.archive-form-grid .full { grid-column: 1/-1; }
.archive-form-grid .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; align-items: start; }
.archive-form-grid .form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; align-items: start; }
.archive-form-grid .form-row-overdue { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(52px, 76px) minmax(0, 1.15fr); gap: 10px 12px; align-items: start; }
.archive-form-grid .form-col-float .form-field-stack > label { font-size: 12px; color: var(--text-2); }
.archive-form-grid .form-col-float .form-field-stack input { text-align: center; font-size: 13px; padding: 6px 4px; }
.archive-form-grid .form-field-stack { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.archive-form-grid .form-field-stack > label { font-size: 13px; color: var(--text-2); }
.archive-form-grid .form-field-stack input,
.archive-form-grid .form-field-stack select,
.archive-form-grid .form-field-stack textarea { width: 100%; box-sizing: border-box; }
.archive-form-grid .date-labeled { display: flex; align-items: center; gap: 10px; min-width: 0; }
.archive-form-grid .date-labeled .date-fixed-label { flex: 0 0 auto; font-size: 14px; color: var(--text); white-space: nowrap; }
.archive-form-grid .date-labeled input[type=date] { flex: 1 1 auto; min-width: 0; }
.form-field[data-error] input, .form-field[data-error] select {
border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow);
animation: fusion-shake 300ms var(--ease-in-out);
}
.field-err { font-size: 11.5px; color: var(--red); min-height: 14px; }
@keyframes fusion-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
/* —— Calculators —— */
.fin-tool-page { max-width: 1100px; }
.fin-two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 16px; align-items: start; }
.fin-panel { border: 1px solid var(--hairline); border-radius: 12px; padding: 14px; background: var(--surface); }
.fin-panel h4 { margin: 0 0 10px; font-size: 15px; color: var(--text); }
.fin-result-card {
background: linear-gradient(180deg, var(--gold-soft), var(--gold-fade));
border: 1px solid var(--gold-line); border-radius: 12px; padding: 14px;
}
.fin-row { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; align-items: center; margin-bottom: 10px; font-size: 13px; }
.fin-row label { color: var(--text-2); }
.fin-muted { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.fin-out-num { font-size: 22px; font-weight: 700; color: var(--gold); letter-spacing: .02em; }
.fin-cn-cap { font-size: 13px; color: var(--text-2); margin-top: 6px; line-height: 1.5; }
.fin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
/* —— Flash —— */
.flash-ok, .flash-err {
padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; font-size: 13px; font-weight: 600;
}
.flash-ok { background: var(--green-bg); color: var(--green); }
.flash-err { background: var(--red-bg); color: var(--red); }
/* —— Drawer —— */
.scrim {
position: fixed; inset: 0; z-index: 40;
background: var(--scrim);
opacity: 0; pointer-events: none;
transition: opacity 350ms var(--ease-out);
}
.v-fusion[data-drawer-open] .scrim { opacity: 1; pointer-events: auto; }
.drawer {
position: fixed; top: 0; right: 0; bottom: 0; z-index: 41;
width: min(480px, 94vw);
display: flex; flex-direction: column;
background: var(--material-drawer);
-webkit-backdrop-filter: blur(28px) saturate(180%);
backdrop-filter: blur(28px) saturate(180%);
border-left: 1px solid var(--gold-line);
box-shadow: var(--shadow-drawer);
transform: translateX(102%);
transition: transform 420ms var(--ease-drawer);
will-change: transform;
touch-action: pan-y;
}
.v-fusion[data-drawer-open] .drawer { transform: translateX(0); }
.drawer[data-dragging] { transition: none; }
.drawer-grip { display: flex; justify-content: center; padding: 10px 0 4px; cursor: grab; }
.drawer-grip span { width: 40px; height: 4px; border-radius: 2px; background: var(--grip); }
.drawer-head { padding: 12px 26px 16px; border-bottom: 1px solid var(--hairline); }
.drawer-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: 0.18em; color: var(--gold); }
.drawer-title { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; margin-top: 6px; }
.drawer-sub { font-size: 12.5px; color: var(--text-2); margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 26px; }
.drawer-foot { display: flex; gap: 10px; padding: 16px 26px 22px; border-top: 1px solid var(--hairline); }
.drawer-close {
position: absolute; top: 14px; right: 18px; width: 30px; height: 30px; border-radius: 50%;
background: var(--fill); color: var(--text-2); border: 0; cursor: pointer;
display: flex; align-items: center; justify-content: center;
transition: transform 160ms var(--ease-out), background-color 150ms ease;
}
.drawer-close:active { transform: scale(0.92); }
.hero-amount {
display: flex; align-items: flex-end; justify-content: space-between; gap: 14px;
padding: 14px 16px 13px; margin-bottom: 18px;
background: linear-gradient(180deg, var(--gold-soft), var(--gold-fade));
border: 1px solid var(--gold-line); border-radius: var(--radius-lg);
}
.hero-amount .ha-label { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--gold); }
.hero-amount .ha-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: var(--gold); line-height: 1.15; font-variant-numeric: tabular-nums; font-family: var(--font-mono), var(--font-body); }
.hero-amount .ha-side { text-align: right; font-size: 11.5px; color: var(--text-2); line-height: 1.6; }
.hero-amount .ha-side b { color: var(--text); font-weight: 650; }
.hero-amount[data-zero] .ha-value, .hero-amount[data-zero] .ha-label { color: var(--text-3); }
.hero-amount[data-zero] { background: var(--gray-bg); border-color: var(--hairline); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.field label { display: block; font-size: 11.5px; color: var(--text-3); margin-bottom: 2px; }
.field .val { font-size: 14px; font-weight: 600; }
.drawer .section-title, .drawer-kicker {
font-size: 12px; font-weight: 700; letter-spacing: 0.1em; color: var(--text-2);
margin: 24px 0 12px; display: flex; align-items: center; gap: 10px;
}
.drawer .section-title::after, .drawer-kicker::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.plan-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 10px; margin-bottom: 8px; font-size: 13px; background: var(--surface); }
.plan-kind { font-weight: 600; }
.plan-date { color: var(--text-2); font-size: 12px; }
.plan-amt { margin-left: auto; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.empty { padding: 18px; text-align: center; color: var(--text-3); font-size: 12.5px; border: 1px dashed var(--hairline); border-radius: 10px; }
/* —— Hold-to-confirm —— */
.hold-btn {
position: relative; overflow: hidden; flex: 1;
height: 38px; border-radius: 10px;
border: 1px solid var(--red-line); color: var(--red);
background: var(--surface);
font-size: 13px; font-weight: 650;
transition: transform 160ms var(--ease-out);
}
.hold-btn:active { transform: scale(0.97); }
.hold-btn .fill {
position: absolute; inset: 0; background: var(--red-solid);
clip-path: inset(0 100% 0 0);
transition: clip-path 200ms var(--ease-out);
}
.hold-btn[data-holding] .fill { clip-path: inset(0 0 0 0); transition: clip-path 1.4s linear; }
.hold-btn .lbl { position: relative; z-index: 1; transition: color 150ms ease; }
.hold-btn[data-holding] .lbl { color: #fff; }
.hold-overlay {
position: fixed; inset: 0; z-index: 55; display: flex; align-items: center; justify-content: center;
background: var(--scrim); padding: 20px;
}
.hold-overlay[hidden] { display: none; }
.hold-panel {
width: min(380px, 100%); background: var(--material-drawer);
-webkit-backdrop-filter: blur(24px) saturate(180%);
backdrop-filter: blur(24px) saturate(180%);
border: 1px solid var(--hairline); border-radius: var(--radius-lg);
padding: 22px 22px 18px; box-shadow: var(--shadow-toast);
}
.hold-panel h4 { margin: 0 0 8px; font-size: 17px; }
.hold-panel p { margin: 0 0 16px; font-size: 13px; color: var(--text-2); }
/* —— Toast —— */
.toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
display: flex; align-items: center; gap: 9px;
height: 40px; padding: 0 16px; border-radius: 999px;
background: var(--material-toast); color: #fff; font-size: 13px; font-weight: 500;
-webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
box-shadow: var(--shadow-toast);
transition: transform 400ms var(--ease-drawer), opacity 400ms ease;
}
.toast[data-hidden] { transform: translateY(-140%); opacity: 0; }
.toast .tick { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; background: var(--switch-on); color: #fff; align-items: center; justify-content: center; font-size: 11px; }
/* —— Login —— */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box {
width: min(420px, 100%);
background: var(--login-card);
-webkit-backdrop-filter: blur(24px) saturate(180%);
backdrop-filter: blur(24px) saturate(180%);
border: 1px solid var(--hairline);
border-radius: var(--radius-lg);
padding: 28px 26px 24px;
}
.login-box .brand { padding: 0 0 18px; }
.login-box h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.02em; }
.login-box .sub { margin: 0 0 16px; color: var(--text-2); font-size: 13px; }
.login-box form { display: flex; flex-direction: column; gap: 10px; }
.login-box button { width: 100%; height: 38px; }
.login-theme { position: fixed; top: 16px; right: 16px; z-index: 5; }
/* —— Search / seg leftover —— */
.search {
display: flex; align-items: center; gap: 7px;
height: 32px; padding: 0 12px; min-width: 180px;
background: var(--fill); border-radius: 9px; color: var(--text-3); font-size: 13px;
}
.search input { background: none; border: 0; outline: none; width: 100%; color: var(--text); height: auto; padding: 0; box-shadow: none; }
.search input:focus { box-shadow: none; border: 0; }
.seg { display: inline-flex; padding: 2px; background: var(--fill); border-radius: 9px; margin-bottom: 14px; }
.seg button { position: relative; height: 26px; padding: 0 14px; border-radius: 7px; font-size: 12.5px; color: var(--text-2); background: none; font-weight: 500; }
.seg button[data-active] { color: var(--text); font-weight: 600; background: var(--surface-2); box-shadow: var(--shadow-seg); filter: none; }
/* —— Responsive —— */
@media (max-width: 1280px) {
.grid { grid-template-columns: minmax(170px, 220px) minmax(0, 1fr); }
.tree-link { max-width: 130px; }
.content, .wrap { padding: 22px 22px 72px; }
}
@media (max-width: 1180px) {
.archive-table .hide-md { display: none; }
.col-name { width: 140px; } .col-inst { width: 110px; } .col-borrower { width: 100px; } .col-guarantor { width: 92px; } .col-action { width: 132px; }
.stats, .metric-wrap { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
.nav-burger { display: inline-flex; }
.sidebar {
position: fixed; left: 0; top: 0; transform: translateX(-102%);
transition: transform 320ms var(--ease-drawer); box-shadow: var(--shadow-drawer);
}
.v-fusion[data-nav-open] .sidebar { transform: translateX(0); }
.v-fusion[data-nav-open] .nav-scrim { display: block; }
.grid { grid-template-columns: 1fr; }
.tree { position: static; max-height: none; }
.stats, .metric-wrap { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
.content, .wrap { padding: 16px 14px 64px; }
}
@media (max-width: 900px) {
.fin-two-col { grid-template-columns: 1fr; }
.field-grid { grid-template-columns: 1fr; }
.archive-table thead { display: none; }
.archive-table, .archive-table tbody, .archive-table tr, .archive-table td { display: block; width: 100%; }
.archive-table tr { border: 1px solid var(--hairline); border-radius: 10px; padding: 8px; margin-bottom: 8px; background: var(--surface); }
.archive-table td { border: 0; padding: 4px 0; }
.archive-table td::before {
content: attr(data-label);
display: inline-block; min-width: 84px; color: var(--text-3); font-size: 12px; margin-right: 6px;
}
.archive-table td.col-check::before { content: "选择"; }
.archive-table td.col-kind::before { content: "类型"; }
.archive-table td.col-check { padding-bottom: 6px; border-bottom: 1px dashed var(--hairline); margin-bottom: 6px; }
.archive-table td.col-action { position: static; background: transparent; width: 100%; padding-top: 8px; border-top: 1px dashed var(--hairline); margin-top: 6px; }
.archive-table td.col-action::before { content: "操作"; }
.archive-table .hide-md { display: block; }
.icon-actions { flex-wrap: wrap; white-space: normal; }
.table-wrap th:last-child, .table-wrap td:last-child { position: static; }
}
@media (max-width: 780px) {
.archive-form-grid .form-row-2,
.archive-form-grid .form-row-3,
.archive-form-grid .form-row-overdue { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
.stats, .metric-wrap { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
.page-title, .card > h3, h3.section-title { font-size: 22px; }
}
@media (max-width: 520px) {
.fin-row { grid-template-columns: 1fr; }
}
@media (max-width: 1366px) {
th, td { padding: 6px 5px; font-size: 12px; }
.col-name { width: 100px; } .col-inst { width: 90px; } .col-borrower { width: 82px; } .col-guarantor { width: 78px; } .col-amount { width: 76px; }
.col-date { width: 64px; } .col-rate { width: 42px; } .col-status { width: 56px; } .col-action { width: 126px; }
.icon-btn, .toolbar-btn { height: 26px; padding: 0 8px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { animation-duration: 0.01ms !important; }
.scrim, .toast, .content-shell { transition-duration: 120ms; }
.drawer { transform: none; opacity: 0; visibility: hidden; transition: opacity 150ms ease, visibility 150ms ease; }
.v-fusion[data-drawer-open] .drawer { opacity: 1; visibility: visible; }
.v-fusion[data-drawer-open] .content-shell { transform: none; filter: none; }
.toast[data-hidden] { transform: none; opacity: 0; }
.form-field[data-error] input { animation: none; }
.hold-btn[data-holding] .fill { transition: none; }
button:active, .btn:active, .toolbar-btn:active, .icon-btn:active, .nav-item:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
.sidebar { background: #fbfbfd; -webkit-backdrop-filter: none; backdrop-filter: none; }
.drawer, .hold-panel, .login-box { background: #ffffff; -webkit-backdrop-filter: none; backdrop-filter: none; }
.toast { background: #1e1e20; }
html[data-theme="night"] .sidebar { background: #171512; }
html[data-theme="night"] .drawer,
html[data-theme="night"] .hold-panel,
html[data-theme="night"] .login-box { background: #1f1d19; }
html[data-theme="night"] .toast { background: #36342f; }
}
@media (prefers-contrast: more) {
:root { --hairline: rgba(0, 0, 0, 0.28); --text-2: #4b4b50; --text-3: #5d5d63; --gold: #6d5510; --gold-line: rgba(109, 85, 16, 0.5); }
html[data-theme="night"] { --hairline: rgba(255, 255, 255, 0.32); --text-2: #cdc9c0; --text-3: #aaa69e; --gold: #f0cd7a; --gold-line: rgba(240, 205, 122, 0.55); }
}
+325
View File
@@ -0,0 +1,325 @@
(function () {
"use strict";
var THEME_KEY = "theme";
var LEGACY_KEY = "theme_mode";
var LOGO_DAY = "assets/logo-day.png";
var LOGO_NIGHT = "assets/logo-night.png";
function prefersDark() {
return window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
}
function reducedMotion() {
return window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
}
function getPref() {
var pref = localStorage.getItem(THEME_KEY);
if (pref === "day" || pref === "night" || pref === "system") return pref;
var legacy = localStorage.getItem(LEGACY_KEY);
if (legacy === "dark") return "night";
if (legacy === "light") return "day";
return "system";
}
function resolvedTheme(pref) {
if (pref === "night") return "night";
if (pref === "day") return "day";
return prefersDark() ? "night" : "day";
}
function persist(pref, resolved) {
localStorage.setItem(THEME_KEY, pref);
localStorage.setItem(LEGACY_KEY, resolved === "night" ? "dark" : "light");
}
function applyTheme(pref, animate) {
var resolved = resolvedTheme(pref);
var html = document.documentElement;
if (animate && !reducedMotion()) {
html.setAttribute("data-theme-anim", "");
setTimeout(function () { html.removeAttribute("data-theme-anim"); }, 240);
}
html.setAttribute("data-theme", resolved);
html.setAttribute("data-theme-pref", pref);
html.classList.toggle("dark", resolved === "night");
if (document.body) document.body.classList.toggle("dark", resolved === "night");
persist(pref, resolved);
document.querySelectorAll("[data-theme-btn]").forEach(function (b) {
b.setAttribute("aria-pressed", String(b.getAttribute("data-theme-btn") === pref));
});
}
window.__jnBootTheme = function () {
applyTheme(getPref(), false);
};
window.toggleTheme = function () {
var next = resolvedTheme(getPref()) === "night" ? "day" : "night";
applyTheme(next, true);
};
window.setThemePref = function (pref) {
applyTheme(pref, true);
};
function toast(msg) {
var wrap = document.querySelector(".toast-wrap");
if (!wrap) {
wrap = document.createElement("div");
wrap.className = "toast-wrap";
document.body.appendChild(wrap);
}
wrap.innerHTML = '<div class="toast" data-hidden role="status"><span class="tick" aria-hidden="true">✓</span><span></span></div>';
var t = wrap.querySelector(".toast");
t.querySelector("span:last-child").textContent = msg;
requestAnimationFrame(function () {
requestAnimationFrame(function () { t.removeAttribute("data-hidden"); });
});
clearTimeout(toast._t);
toast._t = setTimeout(function () { t.setAttribute("data-hidden", ""); }, 2600);
}
window.jnToast = toast;
function root() { return document.querySelector("[data-variant-root]"); }
function closeDrawer() {
var r = root();
if (!r) return;
r.removeAttribute("data-drawer-open");
var d = r.querySelector("[data-drawer]");
if (d && d.hasAttribute("data-open-state")) {
d.removeAttribute("data-dragging");
if (!reducedMotion()) d.style.transform = "translateX(102%)";
setTimeout(function () {
d.removeAttribute("data-open-state");
d.style.transform = "";
d.innerHTML = "";
}, reducedMotion() ? 0 : 460);
}
}
function openDrawerHtml(html) {
var r = root();
if (!r) return;
var d = r.querySelector("[data-drawer]");
if (!d) return;
d.innerHTML = html;
r.setAttribute("data-drawer-open", "");
d.setAttribute("data-open-state", "");
var closeBtn = d.querySelector(".drawer-close");
if (closeBtn) closeBtn.focus();
}
function openDrawerFromUrl(url) {
var sep = url.indexOf("?") >= 0 ? "&" : "?";
fetch(url + sep + "fragment=1", { credentials: "same-origin", headers: { "X-Requested-With": "drawer" } })
.then(function (res) {
if (!res.ok) throw new Error("load");
return res.text();
})
.then(function (html) {
if (html.indexOf("drawer-grip") < 0) {
window.location.href = url;
return;
}
openDrawerHtml(html);
})
.catch(function () { window.location.href = url; });
}
/* Hold-to-confirm dialog */
var holdTimer = null;
var pendingHold = null;
function hideHold() {
clearTimeout(holdTimer);
var ov = document.getElementById("hold-overlay");
if (ov) ov.hidden = true;
var btn = ov && ov.querySelector(".hold-btn");
if (btn) btn.removeAttribute("data-holding");
pendingHold = null;
}
function runHoldAction(action) {
hideHold();
if (!action) return;
if (action.type === "href") {
window.location.href = action.href;
return;
}
if (action.type === "form") {
action.form.submit();
return;
}
if (action.type === "fn" && typeof action.fn === "function") {
action.fn();
}
}
function showHold(message, action) {
pendingHold = action;
var ov = document.getElementById("hold-overlay");
if (!ov) return false;
ov.querySelector("[data-hold-msg]").textContent = message || "此操作不可撤销";
ov.hidden = false;
ov.querySelector(".hold-btn").focus();
return true;
}
window.jnHoldThen = function (message, fn) {
showHold(message, { type: "fn", fn: fn });
};
function requestDeleteSelected() {
var ids = Array.prototype.slice.call(document.querySelectorAll(".cid:checked")).map(function (x) { return x.value; });
if (ids.length === 0) { alert("请先选择要删除的档案"); return; }
showHold("将提交双管理员删除申请,按住确认", {
type: "href",
href: "index.php?action=request_delete_selected&ids=" + encodeURIComponent(ids.join(","))
});
}
window.requestDeleteSelected = requestDeleteSelected;
function bindHoldPointer(btn) {
btn.addEventListener("pointerdown", function (e) {
if (e.button && e.button !== 0) return;
btn.setAttribute("data-holding", "");
clearTimeout(holdTimer);
holdTimer = setTimeout(function () {
btn.removeAttribute("data-holding");
runHoldAction(pendingHold);
}, 1400);
});
["pointerup", "pointerleave", "pointercancel"].forEach(function (ev) {
btn.addEventListener(ev, function () {
clearTimeout(holdTimer);
btn.removeAttribute("data-holding");
});
});
}
/* Drawer drag-to-dismiss */
var drag = null;
function endDrag() {
if (!drag) return;
var r = root();
var d = r && r.querySelector("[data-drawer]");
if (d) {
d.removeAttribute("data-dragging");
if (drag.dx > 110 || drag.v > 0.11) closeDrawer();
else d.style.transform = "translateX(0)";
}
drag = null;
}
document.addEventListener("DOMContentLoaded", function () {
applyTheme(getPref(), false);
if (window.matchMedia) {
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", function () {
if (getPref() === "system") applyTheme("system", true);
});
}
var flash = document.getElementById("flash-banner");
if (flash) {
flash.scrollIntoView({ behavior: reducedMotion() ? "auto" : "smooth", block: "center" });
setTimeout(function () {
flash.style.transition = "opacity 0.4s ease, transform 0.4s ease";
flash.style.opacity = "0";
flash.style.transform = "translateY(-6px)";
setTimeout(function () { flash.remove(); }, 450);
}, 3000);
}
var holdBtn = document.querySelector("#hold-overlay .hold-btn");
if (holdBtn) bindHoldPointer(holdBtn);
document.addEventListener("click", function (e) {
var t = e.target;
var themeBtn = t.closest && t.closest("[data-theme-btn]");
if (themeBtn) {
applyTheme(themeBtn.getAttribute("data-theme-btn"), true);
return;
}
if (t.closest && t.closest("[data-nav-toggle]")) {
var r = root();
if (r) {
if (r.hasAttribute("data-nav-open")) r.removeAttribute("data-nav-open");
else r.setAttribute("data-nav-open", "");
}
return;
}
if (t.closest && t.closest("[data-nav-scrim], [data-close-nav]")) {
var rr = root();
if (rr) rr.removeAttribute("data-nav-open");
return;
}
if (t.closest && t.closest("[data-close-drawer]")) {
e.preventDefault();
closeDrawer();
return;
}
if (t.closest && t.closest("[data-cancel-hold]")) {
e.preventDefault();
hideHold();
return;
}
var holdEl = t.closest && t.closest("[data-hold-confirm]");
if (holdEl) {
e.preventDefault();
var msg = holdEl.getAttribute("data-hold-confirm") || "按住确认";
if (holdEl.tagName === "A") {
showHold(msg, { type: "href", href: holdEl.getAttribute("href") });
return;
}
if (holdEl.tagName === "BUTTON") {
var form = holdEl.form || holdEl.closest("form");
if (form) showHold(msg, { type: "form", form: form });
return;
}
}
var detailLink = t.closest && t.closest('a[href*="action=archive_detail"]');
if (detailLink && !detailLink.target && !e.metaKey && !e.ctrlKey && !e.shiftKey) {
if (!detailLink.closest(".drawer")) {
e.preventDefault();
openDrawerFromUrl(detailLink.getAttribute("href"));
return;
}
}
});
document.addEventListener("keydown", function (e) {
if (e.key === "Escape") {
hideHold();
closeDrawer();
var r = root();
if (r) r.removeAttribute("data-nav-open");
}
});
document.addEventListener("pointerdown", function (e) {
var grip = e.target.closest && e.target.closest("[data-grip]");
var r = root();
if (!grip || !r || !r.hasAttribute("data-drawer-open") || drag) return;
drag = { startX: e.clientX, dx: 0, v: 0, lastX: e.clientX, lastT: performance.now() };
var d = r.querySelector("[data-drawer]");
if (d) d.setAttribute("data-dragging", "");
if (grip.setPointerCapture && e.pointerId != null) {
try { grip.setPointerCapture(e.pointerId); } catch (err) { /* ignore */ }
}
});
document.addEventListener("pointermove", function (e) {
if (!drag) return;
var now = performance.now();
var dt = Math.max(now - drag.lastT, 1);
drag.v = 0.7 * drag.v + 0.3 * ((e.clientX - drag.lastX) / dt);
drag.lastX = e.clientX;
drag.lastT = now;
var dx = e.clientX - drag.startX;
if (dx < 0) dx = dx * 0.25;
drag.dx = dx;
var d = root() && root().querySelector("[data-drawer]");
if (d) d.style.transform = "translateX(" + dx + "px)";
});
document.addEventListener("pointerup", endDrag);
document.addEventListener("pointercancel", endDrag);
});
})();
Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

+194 -297
View File
@@ -51,29 +51,41 @@ if ($action === 'login') {
$flash = getFlash();
?>
<!doctype html>
<html lang="zh-CN"><head><meta charset="UTF-8"><title>金牛集团贷款档案管理系统 - 登录</title>
<style>
body{font-family:Inter,Arial,sans-serif;background:linear-gradient(130deg,#edf3ff 0%,#f8fbff 42%,#f1f5f9 100%);margin:0;color:#1f2937}
.box{max-width:420px;margin:88px auto;background:rgba(255,255,255,.95);padding:28px;border-radius:16px;box-shadow:0 18px 45px rgba(31,59,100,.14);backdrop-filter:blur(2px)}
h2{margin:0 0 8px;font-size:24px;color:#1f3b64}
.sub{margin:0 0 16px;color:#64748b;font-size:14px}
input{width:100%;padding:11px 12px;margin:8px 0;border:1px solid #d2d9e6;border-radius:10px;box-sizing:border-box;background:#fff}
input:focus{border-color:#2f5da8;outline:none;box-shadow:0 0 0 3px rgba(47,93,168,.15)}
button{width:100%;background:#1f3b64;color:#fff;border:0;padding:11px;border-radius:10px;cursor:pointer;font-weight:600}
button:hover{background:#234578}
.err{background:#ffe8e8;color:#a40000;padding:8px;border-radius:6px}
</style>
<html lang="zh-CN"><head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>金牛集团贷款档案管理系统 - 登录</title>
<script>
(function(){var p=localStorage.getItem('theme');if(p!=='day'&&p!=='night'&&p!=='system'){var o=localStorage.getItem('theme_mode');p=o==='dark'?'night':(o==='light'?'day':'system');}var n=p==='night'||(p==='system'&&window.matchMedia&&matchMedia('(prefers-color-scheme: dark)').matches);document.documentElement.setAttribute('data-theme',n?'night':'day');document.documentElement.setAttribute('data-theme-pref',p);if(n)document.documentElement.classList.add('dark');})();
</script>
<link rel="stylesheet" href="assets/app.css">
</head><body>
<div class="box">
<h2>金牛集团贷款档案管理系统</h2>
<p class="sub">请输入账号密码登录系统</p>
<?php if ($flash): ?><div class="err"><?= e($flash['msg']) ?></div><?php endif; ?>
<form method="post">
<input name="username" placeholder="用户名" required>
<input type="password" name="password" placeholder="密码" required>
<button type="submit">登录</button>
</form>
<div class="login-theme theme-toggle" role="group" aria-label="主题">
<button type="button" data-theme-btn="day" aria-pressed="false">☀ 日间</button>
<button type="button" data-theme-btn="night" aria-pressed="false">☾ 夜间</button>
<button type="button" data-theme-btn="system" aria-pressed="false">系统</button>
</div>
<div class="login-page">
<div class="login-box">
<a class="brand" href="index.php?action=login">
<img class="logo-day" src="assets/logo-day.png" alt="金牛实业">
<img class="logo-night" src="assets/logo-night.png" alt="金牛实业">
<div>
<div class="brand-name">金牛贷款档案</div>
<div class="brand-sub">JINNIU ARCHIVE</div>
</div>
</a>
<h2>登录系统</h2>
<p class="sub">金牛集团 · 银行贷款与对外担保归档</p>
<?php if ($flash): ?><div class="flash-err"><?= e($flash['msg']) ?></div><?php endif; ?>
<form method="post">
<input name="username" placeholder="用户名" required autocomplete="username">
<input type="password" name="password" placeholder="密码" required autocomplete="current-password">
<button type="submit">登录</button>
</form>
</div>
</div>
<script src="assets/app.js"></script>
</body></html>
<?php
exit;
@@ -86,6 +98,20 @@ if ($action === 'home') {
$_SESSION['last_list_url'] = 'index.php' . ($qs !== '' ? ('?' . $qs) : '');
}
function isNavActive(string $key): bool
{
$a = (string)($GLOBALS['action'] ?? 'home');
if ($key === 'home') {
return in_array($a, ['home', 'archive_form', 'archive_detail', 'new_dir', 'edit_dir'], true);
}
return $a === $key;
}
function navItemHtml(string $href, string $label, bool $active): string
{
return '<a class="nav-item" href="' . e($href) . '"' . ($active ? ' data-active' : '') . '><span class="dot"></span>' . e($label) . '</a>';
}
function pageHeader(array $me): void
{
$flash = getFlash();
@@ -93,275 +119,90 @@ function pageHeader(array $me): void
if ($lastListUrl === '' || strpos($lastListUrl, 'index.php') !== 0) {
$lastListUrl = 'index.php';
}
$isAdminUser = (($me['role'] ?? '') === 'admin');
?>
<!doctype html>
<html lang="zh-CN"><head><meta charset="UTF-8"><title>金牛集团贷款档案管理系统</title>
<style>
:root{
--bg:#f3f6fb;--text:#1f2937;--card:#fff;--line:#edf0f5;--head:#f8fafc;--muted:#6b7280;
--top1:#1d355c;--top2:#254776;--primary:#1f3b64;--primary-hover:#234578;
--input-bg:#fff;--input-border:#d8e0ea;--shadow:0 8px 24px rgba(15,23,42,.08);
}
body.dark{
--bg:#0f172a;--text:#e5e7eb;--card:#111827;--line:#1f2937;--head:#172033;--muted:#9ca3af;
--top1:#0b1222;--top2:#172441;--primary:#2a4c80;--primary-hover:#355d99;
--input-bg:#0b1324;--input-border:#2a3a55;--shadow:0 8px 24px rgba(0,0,0,.35);
}
*{box-sizing:border-box}
html,body{max-width:100%;overflow-x:hidden}
body{font-family:Inter,Arial,sans-serif;background:var(--bg);margin:0;color:var(--text)}
.top{background:linear-gradient(90deg,var(--top1),var(--top2));color:#fff;padding:10px 10px;display:flex;justify-content:space-between;align-items:center;box-shadow:0 3px 18px rgba(20,44,84,.22);position:sticky;top:0;z-index:40;gap:8px;flex-wrap:wrap}
.brand{font-size:18px;font-weight:700;letter-spacing:.2px}
.a{color:#fff;text-decoration:none;margin-left:12px;padding:7px 10px;border-radius:8px;transition:background .2s}
.a:hover{background:rgba(255,255,255,.16)}
.wrap{padding:12px 16px 6px;max-width:100%;margin:0 auto;width:100%;box-sizing:border-box}
.grid{display:grid;grid-template-columns:minmax(180px,250px) minmax(0,1fr);gap:12px;min-width:0}
.card{background:var(--card);border-radius:14px;padding:14px;box-shadow:var(--shadow);min-width:0;box-sizing:border-box}
table{width:100%;border-collapse:collapse}
th,td{border-bottom:1px solid var(--line);padding:7px 6px;font-size:13px;text-align:left}
th{color:#475569;font-weight:600;background:var(--head)}
input,select{padding:8px 10px;border:1px solid var(--input-border);border-radius:8px;background:var(--input-bg);color:var(--text)}
input:focus,select:focus{border-color:#2f5da8;outline:none;box-shadow:0 0 0 3px rgba(47,93,168,.12)}
button{padding:8px 12px;border:0;border-radius:8px;background:var(--primary);color:#fff;cursor:pointer}
button:hover{background:var(--primary-hover)}
.muted{color:var(--muted)}
.badge{padding:3px 9px;border-radius:999px;font-size:12px}
.b1{background:#e8f1ff;color:#1d4ed8}.b2{background:#eee;color:#374151}.b3{background:#fff;border:1px solid #e5e7eb;color:#374151}.b4{background:#fee2e2;color:#b91c1c}
.flash-ok{background:#e7ffe8;color:#0b7a1a;padding:8px;border-radius:6px;margin-bottom:8px}
.flash-err{background:#ffe8e8;color:#a40000;padding:8px;border-radius:6px;margin-bottom:8px}
.tree ul{list-style:none;padding-left:14px;margin:0}
.tree li{margin:2px 0;position:relative}
.inline{display:inline}
.small{font-size:12px}
.path{font-size:12px;color:var(--muted)}
.btn-danger{background:#b91c1c}
.btn-gray{background:#4b5563}
.table-wrap{overflow-x:hidden;max-width:100%;width:100%}
.table-wrap table{min-width:0;width:100%}
.table-wrap thead th{position:sticky;top:0;z-index:2}
.table-wrap th:last-child,.table-wrap td:last-child{position:sticky;right:0;background:var(--card);z-index:1}
.table-wrap thead th:last-child{z-index:3}
.fixed-table{table-layout:fixed}
.truncate{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.col-check{width:34px}
.col-kind{width:64px;text-align:center}
.badge-k-loan{font-size:11px;padding:2px 6px;border-radius:6px;background:#eef4ff;color:#1e40af;font-weight:600}
.badge-k-guar{font-size:11px;padding:2px 6px;border-radius:6px;background:#ecfdf5;color:#166534;font-weight:600}
.th-stack{display:flex;flex-direction:column;gap:2px;line-height:1.2;align-items:flex-start}
.th-sub{font-size:11px;font-weight:400;color:#64748b}
.col-name{width:108px}
.col-inst{width:96px}
.col-borrower{width:88px}
.col-guarantor{width:88px}
.col-amount{width:84px}
.col-date{width:68px}
.col-rate{width:46px}
.col-status{width:52px}
.col-action{width:138px}
.archive-form-grid{display:grid;grid-template-columns:1fr;gap:10px 12px;max-width:920px}
.archive-form-grid .form-actions{grid-column:1/-1;display:flex;gap:10px;align-items:center}
.archive-form-grid .full{grid-column:1/-1}
.archive-form-grid .form-row-2{display:grid;grid-template-columns:1fr 1fr;gap:10px 12px;align-items:start}
.archive-form-grid .form-row-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 12px;align-items:start}
.archive-form-grid .form-row-overdue{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(52px,76px) minmax(0,1.15fr);gap:10px 12px;align-items:start}
.archive-form-grid .form-col-float .form-field-stack>label{font-size:12px;color:#64748b}
.archive-form-grid .form-col-float .form-field-stack input{text-align:center;font-size:13px;padding:6px 4px}
.archive-form-grid .form-field-stack{display:flex;flex-direction:column;gap:4px;min-width:0}
.archive-form-grid .form-field-stack>label{font-size:13px;color:#475569}
.archive-form-grid .form-field-stack input,.archive-form-grid .form-field-stack select,.archive-form-grid .form-field-stack textarea{width:100%;box-sizing:border-box}
.archive-form-grid .form-field-stack textarea{resize:vertical;min-height:72px;font-family:inherit;font-size:14px;line-height:1.45;padding:8px 10px;border-radius:8px;border:1px solid var(--input-border);background:var(--input-bg);color:var(--text)}
.archive-form-grid .date-labeled{display:flex;align-items:center;gap:10px;min-width:0}
.archive-form-grid .date-labeled .date-fixed-label{flex:0 0 auto;font-size:14px;color:var(--text);white-space:nowrap}
.archive-form-grid .date-labeled input[type=date]{flex:1 1 auto;min-width:0}
.toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.toolbar-left{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.toolbar-right{display:flex;gap:10px;align-items:center}
.pill{background:#eef4ff;color:#1e3a8a;padding:5px 10px;border-radius:999px;font-size:12px;font-weight:600}
.metric-wrap{display:grid;grid-template-columns:repeat(7,minmax(110px,1fr));gap:10px;margin-bottom:12px}
.metric{background:linear-gradient(180deg,#ffffff,#f8fbff);border:1px solid #e3eaf5;border-radius:12px;padding:10px}
.metric .k{font-size:12px;color:#64748b}
.metric .v{margin-top:4px;font-size:22px;color:#1f3b64;font-weight:700}
.metric.m-all{background:#f8fafc}
.metric.m-active{background:#eff6ff}
.metric.m-done{background:#f3f4f6}
.metric.m-unset{background:#ffffff}
.metric.m-due{background:#fff7ed}
.metric.m-plan{background:#ecfeff}
.metric.m-overdue{background:#fef2f2}
.tree{position:sticky;top:72px;max-height:calc(100vh - 90px);overflow:auto}
.section-title{margin:0 0 10px;font-size:18px;color:#1f3b64}
.subtle-link{color:#1d4ed8;text-decoration:none}
.subtle-link:hover{text-decoration:underline}
.toolbar-btn,.icon-btn{
display:inline-flex;align-items:center;justify-content:center;gap:4px;
height:28px;padding:0 10px;border:1px solid var(--input-border);
border-radius:8px;background:var(--input-bg);
color:var(--text);text-decoration:none;font-size:12px;
transition:all .2s ease;box-sizing:border-box;
}
.toolbar-btn:hover,.icon-btn:hover{border-color:#2f5da8;color:#1d4ed8;background:rgba(59,130,246,.06)}
.toolbar-btn.primary{background:var(--primary);border-color:var(--primary);color:#fff}
.toolbar-btn.primary:hover{background:var(--primary-hover);border-color:var(--primary-hover);color:#fff}
.tree details{margin:2px 0}
.tree summary{cursor:pointer;color:var(--text);list-style:none}
.tree summary::-webkit-details-marker{display:none}
.tree li::before{content:"";position:absolute;left:-9px;top:-6px;bottom:-6px;border-left:1px solid var(--line)}
.tree li::after{content:"";position:absolute;left:-9px;top:15px;width:9px;border-top:1px solid var(--line)}
.tree > ul > li::before,.tree > ul > li::after{display:none}
.tree-item{display:flex;align-items:center;gap:6px;min-height:28px;padding:2px 4px;border-radius:8px}
.tree-item:hover{background:rgba(59,130,246,.06)}
.tree-toggle{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:4px;color:#64748b;font-size:11px;user-select:none}
details[open] > summary .tree-toggle{transform:rotate(90deg)}
.tree-link{color:var(--text);text-decoration:none;display:inline-block;max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tree-link:hover{text-decoration:underline}
.tree-link.current{font-weight:700;color:#1d4ed8}
.tree-link.current::before{content:"";display:inline-block;width:3px;height:14px;background:#3b82f6;border-radius:3px;margin-right:6px;vertical-align:-2px}
.quick-links-col{display:flex;flex-direction:column;align-items:flex-start;gap:8px;min-width:0}
.quick-links-col .tree-link{padding:4px 2px}
.quick-menu-details{border:1px solid var(--line);border-radius:10px;background:var(--head);overflow:hidden}
.quick-menu-details>summary{list-style:none;cursor:pointer;padding:8px 10px;font-size:13px;font-weight:600;color:var(--text);display:flex;align-items:center;justify-content:space-between;gap:8px;user-select:none}
.quick-menu-details>summary::-webkit-details-marker{display:none}
.quick-menu-details>summary::after{content:"▶";font-size:10px;color:var(--muted);transition:transform .2s}
.quick-menu-details[open]>summary::after{transform:rotate(90deg)}
.quick-menu-hint{font-weight:400;color:var(--muted);font-size:12px}
.quick-menu-details .quick-links-col{padding:4px 10px 12px}
.fin-tool-page{max-width:1100px}
.fin-two-col{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,360px);gap:16px;align-items:start}
@media (max-width:900px){.fin-two-col{grid-template-columns:1fr}}
.fin-panel{border:1px solid var(--line);border-radius:12px;padding:14px;background:var(--card)}
.fin-panel h4{margin:0 0 10px;font-size:15px;color:#1f3b64}
.fin-result-card{background:linear-gradient(165deg,#f0f7ff 0%,#e8f4fc 100%);border:1px solid #c7d9ee;border-radius:12px;padding:14px;box-shadow:inset 0 1px 0 rgba(255,255,255,.6)}
body.dark .fin-result-card{background:linear-gradient(165deg,#172554 0%,#1e3a5f 100%);border-color:#334e80}
.fin-row{display:grid;grid-template-columns:120px 1fr;gap:8px 12px;align-items:center;margin-bottom:10px;font-size:13px}
@media (max-width:520px){.fin-row{grid-template-columns:1fr}}
.fin-row label{color:var(--muted)}
.fin-muted{font-size:12px;color:var(--muted);margin-top:4px}
.fin-out-num{font-size:22px;font-weight:700;color:#1f3b64;letter-spacing:.02em}
body.dark .fin-out-num{color:#e2e8f0}
.fin-cn-cap{font-size:13px;color:#475569;margin-top:6px;line-height:1.5}
.fin-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.tree-link.ancestor{font-weight:600;color:#334155}
.tree-actions{display:inline-flex;gap:4px;margin-left:auto;opacity:.25;transition:opacity .2s}
.tree-item:hover .tree-actions,.tree-link.current + .tree-actions{opacity:1}
.tree-btn{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border:1px solid transparent;border-radius:5px;text-decoration:none;font-size:11px;background:transparent;color:var(--muted)}
.tree-btn:hover{border-color:var(--input-border);background:var(--input-bg)}
.tree-btn.edit:hover{color:#1d4ed8}
.tree-btn.add:hover{color:#0f766e}
.tree-btn.del{opacity:0;visibility:hidden;transition:opacity .18s}
.tree-item:hover .tree-btn.del,.tree-link.current + .tree-actions .tree-btn.del{opacity:1;visibility:visible}
.tree-btn.del:hover{color:#b91c1c;border-color:#fecaca;background:#fff1f2}
.pager{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:12px;flex-wrap:wrap}
.pager a{color:#1d4ed8;text-decoration:none}
.pager a:hover{text-decoration:underline}
.theme-btn{background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.32)}
.theme-btn:hover{background:rgba(255,255,255,.26)}
.icon-actions{display:flex;gap:4px;flex-wrap:nowrap;white-space:nowrap}
.icon-btn.danger{border-color:#fecaca;color:#b91c1c}
.icon-btn.danger:hover{background:#fee2e2;border-color:#fecaca;color:#b91c1c}
.clear-link{padding:8px 10px;border:1px solid var(--input-border);border-radius:8px;text-decoration:none;color:var(--muted);font-size:13px}
.clear-link:hover{border-color:#2f5da8;color:#1d4ed8}
@media (max-width:1280px){
.grid{grid-template-columns:minmax(170px,220px) minmax(0,1fr)}
.tree-link{max-width:130px}
}
@media (max-width:1024px){.grid{grid-template-columns:1fr}.tree{position:static;max-height:none}.metric-wrap{grid-template-columns:repeat(3,minmax(120px,1fr))}.top{align-items:flex-start}.wrap{padding:10px 12px 4px}}
@media (max-width:720px){.metric-wrap{grid-template-columns:repeat(2,minmax(120px,1fr))}}
@media (max-width:780px){
.archive-form-grid .form-row-2,.archive-form-grid .form-row-3,.archive-form-grid .form-row-overdue{grid-template-columns:1fr}
}
@media (max-width:1366px){
th,td{padding:6px 5px;font-size:12px}
.col-name{width:100px}.col-inst{width:90px}.col-borrower{width:82px}.col-guarantor{width:78px}.col-amount{width:76px}
.col-date{width:64px}.col-rate{width:42px}.col-status{width:48px}.col-action{width:126px}
.icon-btn,.toolbar-btn{height:26px;padding:0 8px;font-size:11px}
}
@media (max-width:1180px){
.archive-table .hide-md{display:none}
.col-name{width:140px}.col-inst{width:110px}.col-borrower{width:100px}.col-guarantor{width:92px}.col-action{width:132px}
}
@media (max-width:900px){
.archive-table thead{display:none}
.archive-table,.archive-table tbody,.archive-table tr,.archive-table td{display:block;width:100%}
.archive-table tr{border:1px solid var(--line);border-radius:10px;padding:8px;margin-bottom:8px;background:var(--card)}
.archive-table td{border:0;padding:4px 0}
.archive-table td::before{
content:attr(data-label);
display:inline-block;
min-width:84px;
color:var(--muted);
font-size:12px;
margin-right:6px;
}
.archive-table td.col-check::before{content:"选择"}
.archive-table td.col-kind::before{content:"类型"}
.archive-table td.col-check{padding-bottom:6px;border-bottom:1px dashed var(--line);margin-bottom:6px}
.archive-table td.col-action{position:static;background:transparent;width:100%;padding-top:8px;border-top:1px dashed var(--line);margin-top:6px}
.archive-table td.col-action::before{content:"操作"}
.archive-table .hide-md{display:block}
.icon-actions{flex-wrap:wrap;white-space:normal}
}
</style>
</head><body>
<div class="top">
<div class="brand">金牛集团贷款档案管理系统</div>
<div style="display:flex;align-items:center;flex-wrap:wrap;row-gap:6px">
<span><?= e(maskUsername((string)$me['username'])) ?> (<?= e(roleLabel((string)$me['role'])) ?>)</span>
<button type="button" id="theme_toggle_btn" class="a theme-btn" onclick="toggleTheme()">🌙</button>
<a class="a" href="<?= e($lastListUrl) ?>" onclick="if(window.history.length>1){window.history.back();return false;}">返回上页</a>
<a class="a" href="index.php">返回列表</a>
<a class="a" href="index.php?action=profile">个人设置</a>
<?php if ($me['role'] === 'admin'): ?><a class="a" href="index.php?action=users">用户管理</a><?php endif; ?>
<?php if ($me['role'] === 'admin'): ?><a class="a" href="index.php?action=delete_approvals">删除审核</a><?php endif; ?>
<a class="a" href="index.php?action=logout">退出</a>
<html lang="zh-CN"><head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>金牛集团贷款档案管理系统</title>
<script>
(function(){var p=localStorage.getItem('theme');if(p!=='day'&&p!=='night'&&p!=='system'){var o=localStorage.getItem('theme_mode');p=o==='dark'?'night':(o==='light'?'day':'system');}var n=p==='night'||(p==='system'&&window.matchMedia&&matchMedia('(prefers-color-scheme: dark)').matches);document.documentElement.setAttribute('data-theme',n?'night':'day');document.documentElement.setAttribute('data-theme-pref',p);if(n)document.documentElement.classList.add('dark');})();
</script>
<link rel="stylesheet" href="assets/app.css">
</head>
<body class="v-fusion" data-variant-root>
<div class="nav-scrim" data-nav-scrim></div>
<aside class="sidebar">
<a class="brand" href="index.php">
<img class="logo-day" src="assets/logo-day.png" alt="金牛实业">
<img class="logo-night" src="assets/logo-night.png" alt="金牛实业">
<div>
<div class="brand-name">金牛贷款档案</div>
<div class="brand-sub">JINNIU ARCHIVE</div>
</div>
</a>
<div class="nav-label">档案管理</div>
<?= navItemHtml('index.php', '档案总览', isNavActive('home')) ?>
<?= navItemHtml('index.php?action=reminders', '还款提醒', isNavActive('reminders')) ?>
<?= navItemHtml('index.php?action=pending_updates', '待更新', isNavActive('pending_updates')) ?>
<div class="nav-label">统计查询</div>
<?= navItemHtml('index.php?action=quick_queries', '便捷查询', isNavActive('quick_queries')) ?>
<?= navItemHtml('index.php?action=query_totals', '查询总金额', isNavActive('query_totals')) ?>
<?= navItemHtml('index.php?action=query_payable_interest', '应付本息', isNavActive('query_payable_interest')) ?>
<?= navItemHtml('index.php?action=query_external_guarantee', '对外担保', isNavActive('query_external_guarantee')) ?>
<?= navItemHtml('index.php?action=repayment_history', '历史还款', isNavActive('repayment_history')) ?>
<div class="nav-label">工具</div>
<?= navItemHtml('index.php?action=interest_calculator', '利息计算器', isNavActive('interest_calculator')) ?>
<?= navItemHtml('index.php?action=acceptance_discount_calculator', '承兑贴现', isNavActive('acceptance_discount_calculator')) ?>
<?php if ($isAdminUser): ?>
<div class="nav-label">管理</div>
<?= navItemHtml('index.php?action=users', '用户管理', isNavActive('users')) ?>
<?= navItemHtml('index.php?action=delete_approvals', '删除审核', isNavActive('delete_approvals')) ?>
<?php endif; ?>
<div class="theme-toggle" role="group" aria-label="主题">
<button type="button" data-theme-btn="day" aria-pressed="false">☀ 日间</button>
<button type="button" data-theme-btn="night" aria-pressed="false">☾ 夜间</button>
<button type="button" data-theme-btn="system" aria-pressed="false">系统</button>
</div>
</div>
<div class="sidebar-foot">
<?= e(maskUsername((string)$me['username'])) ?> · <?= e(roleLabel((string)$me['role'])) ?><br>
<a class="nav-item" href="<?= e($lastListUrl) ?>" onclick="if(window.history.length>1){window.history.back();return false;}" style="padding:6px 0;margin-top:6px">返回上页</a>
<?= navItemHtml('index.php?action=profile', '个人设置', isNavActive('profile')) ?>
<?= navItemHtml('index.php?action=logout', '退出', false) ?>
</div>
</aside>
<div class="content-shell">
<div class="wrap">
<div class="page-head-actions" style="margin-bottom:12px">
<button type="button" class="nav-burger" data-nav-toggle aria-label="打开导航">☰</button>
</div>
<?php if ($flash): ?>
<div id="flash-banner" class="<?= $flash['type'] === 'ok' ? 'flash-ok' : 'flash-err' ?>"><?= e($flash['msg']) ?></div>
<script>
window.addEventListener('load', function () {
var el = document.getElementById('flash-banner');
if (el) {
el.scrollIntoView({behavior: 'smooth', block: 'center'});
setTimeout(function () {
el.style.transition = 'opacity 0.5s ease, transform 0.5s ease, max-height 0.5s ease, margin 0.5s ease, padding 0.5s ease';
el.style.opacity = '0';
el.style.transform = 'translateY(-6px)';
el.style.maxHeight = '0';
el.style.margin = '0';
el.style.paddingTop = '0';
el.style.paddingBottom = '0';
el.style.overflow = 'hidden';
}, 3000);
}
});
</script>
<?php endif; ?>
<?php
}
function pageFooter(): void
{
echo <<<HTML
echo <<<'HTML'
</div>
<script>
(function(){
var saved=localStorage.getItem('theme_mode');
if(saved==='dark'){document.body.classList.add('dark');}
refreshThemeIcon();
})();
function refreshThemeIcon(){
var btn=document.getElementById('theme_toggle_btn');
if(!btn){return;}
btn.textContent=document.body.classList.contains('dark')?'☀':'🌙';
btn.title=document.body.classList.contains('dark')?'切换浅色模式':'切换深色模式';
}
function toggleTheme(){
document.body.classList.toggle('dark');
localStorage.setItem('theme_mode', document.body.classList.contains('dark') ? 'dark' : 'light');
refreshThemeIcon();
}
</script>
</div>
<div class="scrim" data-close-drawer></div>
<aside class="drawer" role="dialog" aria-modal="true" aria-label="档案详情" data-drawer></aside>
<div id="hold-overlay" class="hold-overlay" hidden>
<div class="hold-panel" role="alertdialog" aria-labelledby="hold-title">
<h4 id="hold-title">请按住确认</h4>
<p data-hold-msg>此操作不可撤销</p>
<button type="button" class="hold-btn" aria-label="按住以确认">
<span class="fill" aria-hidden="true"></span>
<span class="lbl">按住确认</span>
</button>
<p style="margin:12px 0 0;text-align:center"><button type="button" class="btn btn--plain" data-cancel-hold>取消</button></p>
</div>
</div>
<div class="toast-wrap" aria-live="polite"></div>
<script src="assets/app.js"></script>
</body></html>
HTML;
}
@@ -1148,7 +989,7 @@ function buildTreeHtml(array $dirs, ?int $selectedId, bool $admin, array $pathId
if ((int)$d['level'] < 3) {
$actions .= '<a class="tree-btn add" title="新增子目录" href="index.php?action=new_dir&parent_id=' . $id . '">+</a>';
}
$actions .= '<a class="tree-btn del" title="删除目录" href="index.php?action=delete_dir&id=' . $id . '" onclick="return confirm(\'仅空目录可删除,确认?\')">🗑</a>';
$actions .= '<a class="tree-btn del" title="删除目录" href="index.php?action=delete_dir&id=' . $id . '" data-hold-confirm="仅空目录可删除,按住确认删除">🗑</a>';
$actions .= '</span>';
}
$html .= '<li>';
@@ -2118,7 +1959,7 @@ if ($action === 'delete_approvals') {
<input type="hidden" name="approval_id" value="<?= e((string)$ap['id']) ?>">
<input type="hidden" name="do" value="approve">
<input type="hidden" name="redirect_to" value="<?= e(currentUrlFromServer()) ?>">
<button type="submit">审核通过并删除</button>
<button type="submit" data-hold-confirm="审核通过后将删除档案,按住确认">审核通过并删除</button>
</form>
<form class="inline" method="post">
<input type="hidden" name="approval_id" value="<?= e((string)$ap['id']) ?>">
@@ -2312,14 +2153,58 @@ if ($action === 'archive_detail') {
});
$files = $pdo->prepare('SELECT * FROM files WHERE archive_id=:a ORDER BY id DESC');
$files->execute([':a' => $id]);
pageHeader($me); ?>
$fragment = isset($_GET['fragment']) && (string)$_GET['fragment'] === '1';
$remainTxt = amount($a['remaining_limit'] !== null ? (float)$a['remaining_limit'] : null);
$creditTxt = amount($a['credit_limit'] !== null ? (float)$a['credit_limit'] : null);
$remainZero = $status === '已完成' || ($a['remaining_limit'] !== null && (float)$a['remaining_limit'] <= 0);
$statusBadge = $status === '履行中' ? 'b1' : ($status === '已完成' ? 'b2' : ($status === '逾期中' ? 'b4' : 'b3'));
if ($fragment) {
header('Content-Type: text/html; charset=UTF-8');
?>
<div class="drawer-grip" data-grip><span></span></div>
<button type="button" class="drawer-close" data-close-drawer aria-label="关闭">✕</button>
<div class="drawer-head" data-grip>
<div class="drawer-eyebrow"><?= e(archiveKindLabel($detailKind)) ?> · <?= e((string)$a['name']) ?></div>
<div class="drawer-title"><?= e((string)$a['borrower']) ?></div>
<div class="drawer-sub"><?= e((string)$a['dir_name']) ?> <span class="badge <?= $statusBadge ?>"><?= e($status) ?></span></div>
</div>
<div class="drawer-body">
<div class="hero-amount"<?= $remainZero ? ' data-zero' : '' ?>>
<div>
<div class="ha-label">剩余额度</div>
<div class="ha-value num"><?= e($remainTxt === '' ? '—' : ('¥' . $remainTxt)) ?></div>
</div>
<div class="ha-side">合同金额 <b class="num"><?= e($creditTxt === '' ? '—' : ('¥' . $creditTxt)) ?></b><br>
年利率 <b class="num"><?= $detailKind === ARCHIVE_KIND_EXTERNAL_GUARANTEE ? '—' : e($a['annual_rate'] === null ? '' : ((string)$a['annual_rate'] . '%')) ?></b>
· 到期 <b class="num"><?= e((string)$a['end_date']) ?></b>
</div>
</div>
<div class="field-grid">
<div class="field"><label><?= $detailKind === ARCHIVE_KIND_EXTERNAL_GUARANTEE ? '债权人' : '贷款机构' ?></label><div class="val"><?= e((string)$a['loan_institution']) ?></div></div>
<div class="field"><label>业务类型</label><div class="val"><?= e(archiveKindLabel($detailKind)) ?></div></div>
<div class="field"><label>到期日</label><div class="val num"><?= e((string)$a['end_date']) ?></div></div>
<div class="field"><label>归档目录</label><div class="val"><?= e((string)$a['dir_name']) ?></div></div>
</div>
<?php
} else {
pageHeader($me);
?>
<div class="page-head">
<div>
<h1 class="page-title"><?= e($a['name']) ?></h1>
<div class="page-sub"><?= e($a['dir_name']) ?> · <?= e(archiveKindLabel($detailKind)) ?></div>
</div>
</div>
<?php } ?>
<div class="card">
<?php if (!$fragment): ?>
<h3><?= e($a['name']) ?> <span class="muted">(<?= e($a['dir_name']) ?>)</span></h3>
<p>状态:<span class="badge <?= $status === '履行中' ? 'b1' : ($status === '已完成' ? 'b2' : ($status === '逾期中' ? 'b4' : 'b3')) ?>"><?= e($status) ?></span>
<p>状态:<span class="badge <?= $statusBadge ?>"><?= e($status) ?></span>
<span class="muted" style="margin-left:10px">类型:<?= e(archiveKindLabel($detailKind)) ?></span></p>
<?php endif; ?>
<table>
<tr><th><?= $detailKind === ARCHIVE_KIND_EXTERNAL_GUARANTEE ? '债权人' : '贷款机构' ?></th><td><?= e((string)$a['loan_institution']) ?></td><th>借款主体</th><td><?= e((string)$a['borrower']) ?></td></tr>
<tr><th>授信额度</th><td><?= e(amount($a['credit_limit'] !== null ? (float)$a['credit_limit'] : null)) ?></td><th>剩余额度</th><td><?= e(amount($a['remaining_limit'] !== null ? (float)$a['remaining_limit'] : null)) ?></td></tr>
<tr><th>授信额度</th><td><?= e($creditTxt) ?></td><th>剩余额度</th><td class="cell-remaining num"><?= e($remainTxt) ?></td></tr>
<tr><th>起止日</th><td><?= e((string)$a['start_date']) ?></td><th>到期日</th><td><?= e((string)$a['end_date']) ?></td></tr>
<tr><th>年利率</th><td><?= $detailKind === ARCHIVE_KIND_EXTERNAL_GUARANTEE ? '<span class="muted">—</span>' : e($a['annual_rate'] === null ? '' : ((string)$a['annual_rate'] . '%')) ?></td><th>担保类型</th><td><?= e((string)$a['guarantee_type']) ?></td></tr>
<tr><th>担保人</th><td colspan="3"><?= e((string)$a['guarantor']) ?></td></tr>
@@ -2399,7 +2284,21 @@ if ($action === 'archive_detail') {
<?php endforeach; ?>
</table>
</div>
<?php pageFooter(); exit;
<?php
if ($fragment) {
?>
</div>
<div class="drawer-foot">
<?php if (isAdmin()): ?>
<a class="btn btn--plain" href="index.php?action=archive_form&id=<?= $id ?>" style="flex:1">编辑档案</a>
<?php endif; ?>
<button type="button" class="btn btn--plain" data-close-drawer style="flex:1">关闭</button>
</div>
<?php
exit;
}
pageFooter();
exit;
}
if ($action === 'archive_form') {
@@ -2691,7 +2590,7 @@ if ($action === 'archive_form') {
<div class="icon-actions">
<?php if (canPreview((string)$f['file_ext'])): ?><a class="icon-btn" target="_blank" href="index.php?action=preview_file&id=<?= (int)$f['id'] ?>">👁 预览</a><?php endif; ?>
<a class="icon-btn" href="index.php?action=download_file&id=<?= (int)$f['id'] ?>">⬇ 下载</a>
<a class="icon-btn danger" href="index.php?action=delete_file&id=<?= (int)$f['id'] ?>" onclick="return confirm('确认删除?')">🗑 删除</a>
<a class="icon-btn danger" href="index.php?action=delete_file&id=<?= (int)$f['id'] ?>" data-hold-confirm="删除文件后无法恢复,按住确认">🗑 删除</a>
</div>
</td>
</tr>
@@ -2971,10 +2870,10 @@ if ($action === 'users') {
<input name="new_password" placeholder="新密码" required>
<button class="btn-gray" type="submit">重置密码</button>
</form>
<form method="post" class="inline" onsubmit="return confirm('确认删除用户?')">
<form method="post" class="inline">
<input type="hidden" name="do" value="delete">
<input type="hidden" name="uid" value="<?= (int)$u['id'] ?>">
<button class="btn-danger" type="submit">删除</button>
<button class="btn-danger" type="submit" data-hold-confirm="删除用户后无法恢复,按住确认">删除</button>
</form>
</td>
</tr>
@@ -3877,6 +3776,12 @@ $pathIds = collectAncestorIds($dirs, $dirId ?: null);
pageHeader($me);
?>
<div class="page-head">
<div>
<h1 class="page-title">贷款档案</h1>
<div class="page-sub">金牛集团 · 银行贷款与对外担保归档</div>
</div>
</div>
<div class="grid">
<div class="card tree">
<div class="toolbar" style="margin-bottom:8px">
@@ -4001,14 +3906,14 @@ pageHeader($me);
$rowKind = normalizeArchiveKind($a['archive_kind'] ?? '');
$isExtGuarantee = $rowKind === ARCHIVE_KIND_EXTERNAL_GUARANTEE;
?>
<tr data-archive-kind="<?= e($rowKind) ?>">
<tr data-archive-kind="<?= e($rowKind) ?>" data-status="<?= e($s) ?>">
<td class="col-check" data-label="选择"><input class="cid" type="checkbox" name="ids[]" value="<?= (int)$a['id'] ?>"></td>
<td class="col-kind" data-label="类型"><?php if ($isExtGuarantee): ?><span class="badge-k-guar">担保</span><?php else: ?><span class="badge-k-loan">贷款</span><?php endif; ?></td>
<td class="col-name" data-label="档案名称"><span class="truncate" title="<?= e((string)$a['name']) ?>"><?= e((string)$a['name']) ?></span></td>
<td class="col-inst" data-label="贷款机构"><span class="truncate" title="<?= e((string)$a['loan_institution']) ?>"><?= e((string)$a['loan_institution']) ?></span></td>
<td class="col-borrower" data-label="借款主体"><span class="truncate" title="<?= e((string)$a['borrower']) ?>"><?= e((string)$a['borrower']) ?></span></td>
<td class="hide-md" data-label="授信额度"><?= e(amount($a['credit_limit'] !== null ? (float)$a['credit_limit'] : null)) ?></td>
<td data-label="剩余额度"><?= e(amount($a['remaining_limit'] !== null ? (float)$a['remaining_limit'] : null)) ?></td>
<td class="cell-remaining num" data-label="剩余额度"><?= e(amount($a['remaining_limit'] !== null ? (float)$a['remaining_limit'] : null)) ?></td>
<td class="col-date hide-md" data-label="起始日"><span class="truncate" title="<?= e((string)$a['start_date']) ?>"><?= e((string)$a['start_date']) ?></span></td>
<td class="col-date" data-label="到期日"><span class="truncate" title="<?= e((string)$a['end_date']) ?>"><?= e((string)$a['end_date']) ?></span></td>
<td class="col-guarantor" data-label="担保人"><span class="truncate" title="<?= e((string)$a['guarantor']) ?>"><?= e((string)$a['guarantor']) ?></span></td>
@@ -4021,7 +3926,7 @@ pageHeader($me);
<a class="icon-btn" href="index.php?action=archive_detail&id=<?= (int)$a['id'] ?>">👁 查看</a>
<?php if (isAdmin()): ?>
<a class="icon-btn" href="index.php?action=archive_form&id=<?= (int)$a['id'] ?>">✎ 编辑</a>
<a class="icon-btn danger" href="index.php?action=request_delete_archive&id=<?= (int)$a['id'] ?>" onclick="return confirm('将提交双管理员删除申请,确认?')">🗑 删除</a>
<a class="icon-btn danger" href="index.php?action=request_delete_archive&id=<?= (int)$a['id'] ?>" data-hold-confirm="将提交双管理员删除申请,按住确认">🗑 删除</a>
<?php endif; ?>
</div>
</td>
@@ -4036,14 +3941,6 @@ pageHeader($me);
<?php endif; ?>
</p>
</form>
<script>
function requestDeleteSelected(){
var ids=[...document.querySelectorAll('.cid:checked')].map(function(x){return x.value;});
if(ids.length===0){alert('请先选择要删除的档案');return;}
if(!confirm('将提交双管理员删除申请,确认?')){return;}
window.location.href='index.php?action=request_delete_selected&ids='+encodeURIComponent(ids.join(','));
}
</script>
<div class="pager">
<div class="small">第 <?= $currentPage ?> / <?= $totalPages ?> 页,共 <?= $totalCount ?> 条</div>
<div>