diff --git a/public/assets/app.css b/public/assets/app.css new file mode 100644 index 0000000..138eaef --- /dev/null +++ b/public/assets/app.css @@ -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); } +} diff --git a/public/assets/app.js b/public/assets/app.js new file mode 100644 index 0000000..475bf63 --- /dev/null +++ b/public/assets/app.js @@ -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 = '
请输入账号密码登录系统
-