:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e5e9f0;
  --text: #1a2233;
  --text-2: #64708a;
  --text-3: #9aa5b8;
  --brand: #2f5cff;
  --brand-dark: #1e42d6;
  --brand-soft: #edf2ff;
  --danger: #e5484d;
  --danger-soft: #fff0f0;
  --warn: #f59e0b;
  --warn-soft: #fff7e6;
  --success: #12a06a;
  --success-soft: #e9f8f1;
  --purple: #7c5cff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-lg: 0 16px 48px rgba(16, 24, 40, .16);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
svg { width: 18px; height: 18px; flex: none; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

.app-shell { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 232px; flex: none; background: #10162a; color: #cbd5e8;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 22px 20px 20px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #4b74ff, #2f5cff); color: #fff;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { color: #fff; font-size: 16px; letter-spacing: .5px; }
.brand-text span { font-size: 10px; color: #7788aa; letter-spacing: 1.4px; text-transform: uppercase; }
.nav { padding: 8px 12px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 11px; color: #6b7a99; padding: 14px 10px 6px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin: 2px 0;
  border-radius: 8px; color: #aebbd3; font-size: 13.5px; transition: .16s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(47,92,255,.35); }
.nav-item svg { width: 17px; height: 17px; }
.nav-item span { flex: 1; }
.nav-badge {
  font-style: normal; font-size: 11px; background: rgba(255,255,255,.14);
  padding: 1px 7px; border-radius: 10px; min-width: 22px; text-align: center;
}
.nav-badge.danger { background: #e5484d; color: #fff; }
.sidebar-foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.07); }
.storage-note { font-size: 11.5px; color: #7c8bab; display: flex; align-items: center; gap: 7px; }
.storage-note .dot { width: 7px; height: 7px; border-radius: 50%; background: #35d39a; box-shadow: 0 0 0 3px rgba(53,211,154,.15); }

/* ---------- 主区 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 28px; gap: 14px; position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 16px; font-weight: 650; flex: 1; }
.topbar-actions { display: flex; gap: 10px; }
.menu-toggle { display: none; }
.content { padding: 26px 28px 48px; max-width: 1500px; width: 100%; margin: 0 auto; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 15px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13px; font-weight: 550; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { border-color: #c9d2e3; color: var(--text); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: #fff; border-color: #f3c7c9; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 650; }
.card-body { padding: 20px; }

.eyebrow { font-size: 11px; color: var(--text-3); letter-spacing: .5px; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.strong { font-weight: 650; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 550; }
.tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag-blue { background: var(--brand-soft); color: var(--brand); }
.tag-green { background: var(--success-soft); color: var(--success); }
.tag-orange { background: var(--warn-soft); color: #d97706; }
.tag-red { background: var(--danger-soft); color: var(--danger); }
.tag-gray { background: #f1f4f9; color: var(--text-2); }
.tag-ghost { background: #eef3ff; color: #3b5bdb; }
.subject-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px 7px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 13px; font-weight: 550; }
.subject-chip small { color: var(--text-3); font-weight: 400; font-size: 11px; }
.subject-chip-edit { border: none; background: transparent; color: var(--text-3); font-size: 14px; line-height: 1; cursor: pointer; padding: 0 2px; }
.subject-chip-edit:hover { color: var(--brand); }
.subject-chip-del { border: none; background: transparent; color: var(--text-3); font-size: 17px; line-height: 1; cursor: pointer; padding: 0 2px; }
.subject-chip-del:hover { color: var(--danger); }
.subject-rename-input { width: 130px; padding: 3px 6px; border: 1px solid var(--brand); border-radius: 5px; font-size: 13px; font-weight: 550; outline: none; }
.tag-purple { background: #f2edff; color: var(--purple); }

/* ---------- 看板 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; right: -18px; top: -18px; width: 84px; height: 84px; border-radius: 50%; background: var(--brand-soft); opacity: .55; }
.stat-card.green::after { background: var(--success-soft); }
.stat-card.orange::after { background: var(--warn-soft); }
.stat-card.purple::after { background: #f2edff; }
.stat-label { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 7px; position: relative; z-index: 1; }
.stat-label svg { width: 15px; height: 15px; }
.stat-value { font-size: 27px; font-weight: 700; margin-top: 8px; position: relative; z-index: 1; letter-spacing: -.5px; }
.stat-sub { font-size: 11.5px; color: var(--text-3); margin-top: 4px; position: relative; z-index: 1; }
.dashboard-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; margin-bottom: 18px; }
@media (max-width: 1080px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* ---------- 图表 ---------- */
.chart-wrap { position: relative; height: 240px; }
.chart-wrap svg { width: 100%; height: 100%; overflow: visible; }
.chart-bar { transition: opacity .15s; cursor: default; }
.chart-bar:hover { opacity: .8; }
.legend { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 14px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; }
.donut-center { text-align: center; }
.donut-center strong { display: block; font-size: 24px; }
.donut-center span { font-size: 11px; color: var(--text-3); }

/* ---------- 提醒列表 ---------- */
.reminder-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.reminder-item:last-child { border-bottom: 0; }
.reminder-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.reminder-icon.red { background: var(--danger-soft); color: var(--danger); }
.reminder-icon.orange { background: var(--warn-soft); color: #d97706; }
.reminder-icon.blue { background: var(--brand-soft); color: var(--brand); }
.reminder-main { flex: 1; min-width: 0; }
.reminder-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.reminder-desc { font-size: 11.5px; color: var(--text-2); }
.reminder-date { font-size: 11.5px; font-weight: 600; white-space: nowrap; text-align: right; }
.reminder-date.red { color: var(--danger); }
.reminder-date.orange { color: #d97706; }
.remind-sub { font-size: 10px; font-weight: 400; color: var(--text-2); margin-top: 2px; white-space: normal; }

/* ---------- 筛选栏 ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.search-box { position: relative; flex: 1; min-width: 220px; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 16px; height: 16px; }
.search-box input { width: 100%; height: 38px; padding: 0 12px 0 38px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); outline: none; }
.search-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
select.filter-select, input.filter-input {
  height: 38px; padding: 0 30px 0 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); outline: none; cursor: pointer;
}
select.filter-select:focus, input.filter-input:focus { border-color: var(--brand); }

/* ---------- 表格 ---------- */
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 12px 16px; background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 12px; white-space: nowrap; border-bottom: 1px solid var(--border); }
td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr { transition: background .12s; cursor: pointer; }
tbody tr:hover { background: #fafbff; }
tbody tr:last-child td { border-bottom: 0; }
.cell-name { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.amount { font-variant-numeric: tabular-nums; font-weight: 600; }
.empty { text-align: center; padding: 56px 20px; color: var(--text-3); }
.empty svg { width: 44px; height: 44px; opacity: .35; margin-bottom: 10px; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.page-btns { display: flex; gap: 6px; }
.page-btn { min-width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; color: var(--text-2); }
.page-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- 弹窗 / 抽屉 ---------- */
.modal-backdrop, .drawer-backdrop {
  position: fixed; inset: 0; background: rgba(16,22,42,.45); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-backdrop.open, .drawer-backdrop.open { display: flex; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden; animation: pop .18s ease-out; }
.modal-lg { max-width: 720px; }
.modal-sm { max-width: 400px; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal > form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 15px 22px; border-top: 1px solid var(--border); flex-shrink: 0; }

/* ---------- 附件在线预览 ---------- */
.detail-attach button.attach-preview { background: var(--brand-soft); border: 1px solid var(--brand); }
.preview-backdrop { background: rgba(10,14,28,.78); z-index: 140; }
.preview-shell {
  width: min(1100px, 100%); height: min(88vh, 900px); background: var(--surface);
  border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
  animation: pop .18s ease-out;
}
.preview-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.preview-head-title { min-width: 0; }
.preview-head-title h3 { margin: 3px 0 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.preview-body { flex: 1; min-height: 0; overflow: auto; background: #eef1f6; display: flex; align-items: flex-start; justify-content: center; }
.preview-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; }
.preview-stage img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 4px 20px rgba(0,0,0,.12); }
.preview-stage video { max-width: 100%; max-height: 100%; }
.preview-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.preview-text {
  margin: 0; padding: 24px; width: 100%; min-height: 100%;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word; color: #1f2937; background: #fff;
}
.preview-doc {
  width: min(820px, 100%); margin: 0 auto; padding: 40px 48px; background: #fff; color: #1f2937;
  min-height: 100%; box-shadow: 0 2px 14px rgba(0,0,0,.08); font-size: 14px; line-height: 1.85;
}
.preview-doc p { margin: 0 0 10px; }
.preview-doc .preview-sheet-name { font-weight: 700; font-size: 16px; margin-bottom: 16px; border-bottom: 2px solid var(--brand); padding-bottom: 8px; }
.preview-table { border-collapse: collapse; width: 100%; margin: 12px 0 18px; font-size: 13px; }
.preview-table td, .preview-table th { border: 1px solid #cbd5e1; padding: 6px 10px; text-align: left; vertical-align: top; }
.preview-doc .preview-sheet { display: block; overflow-x: auto; white-space: nowrap; }
.preview-sheet .row-no { background: #f1f5f9; color: #64748b; font-weight: 400; text-align: center; }
.preview-note { margin: auto; padding: 40px 24px; color: var(--text-2); text-align: center; max-width: 520px; }
@media (max-width: 640px) {
  .preview-shell { height: 92vh; }
  .preview-doc { padding: 20px; }
}
.modal-body p { margin: 4px 0; color: var(--text-2); }

/* 密码强度条（自助改密） */
.pwd-meter { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.pwd-meter-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; }
.pwd-meter-bar span { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .18s ease, background .18s ease; }
.pwd-meter-bar span.lv1 { background: var(--danger); }
.pwd-meter-bar span.lv2 { background: var(--warn); }
.pwd-meter-bar span.lv3 { background: #3b82f6; }
.pwd-meter-bar span.lv4 { background: var(--success); }
.pwd-meter-text { font-size: 12px; color: var(--text-2); white-space: nowrap; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.span-2 { grid-column: span 2; }
/* 发票金额三项同组：不含税金额 / 税率 / 含税金额 */
.amount-triple { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px 16px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field label b { color: var(--danger); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; color: var(--text); outline: none; resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.section-divider { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 12px; padding-top: 16px; border-top: 1px dashed var(--border); font-size: 13px; font-weight: 650; }

.node-row { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr 32px; gap: 8px; margin-bottom: 8px; align-items: center; }
.node-row input { min-height: 34px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; outline: none; font-size: 12.5px; }
.node-row input:focus { border-color: var(--brand); }
.node-del { width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: var(--danger-soft); color: var(--danger); border-radius: 6px; cursor: pointer; }
.node-empty { font-size: 12px; color: var(--text-3); padding: 8px 0; }

.upload-zone { border: 1.5px dashed #cfd8e8; border-radius: 10px; padding: 22px; text-align: center; color: var(--text-3); cursor: pointer; transition: .15s; }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.upload-zone svg { width: 24px; height: 24px; margin-bottom: 6px; }
.upload-zone p { margin: 0; font-size: 13px; }
.upload-zone small { color: var(--text-3); font-size: 11px; }
.attachment-list { margin-top: 10px; }
.attach-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; background: var(--surface-2); border-radius: 7px; margin-bottom: 6px; font-size: 12.5px; }
.attach-item svg { width: 15px; height: 15px; color: var(--brand); }
.attach-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-item .size { color: var(--text-3); font-size: 11px; }
.attach-item button { border: 0; background: transparent; color: var(--danger); cursor: pointer; font-size: 12px; }

.drawer-backdrop { justify-content: flex-end; padding: 0; }
.drawer { width: min(480px, 100%); height: 100%; background: var(--surface); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: .5; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { margin: 5px 0 0; font-size: 17px; }
.drawer-head-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.drawer-foot { display: flex; justify-content: space-between; padding: 16px 24px; border-top: 1px solid var(--border); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.detail-cell label { display: block; font-size: 11.5px; color: var(--text-3); margin-bottom: 3px; }
.detail-cell div { font-size: 13.5px; font-weight: 550; }
.detail-section { margin-top: 20px; }
.detail-section h4 { font-size: 13px; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.detail-node { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.detail-node:last-child { border-bottom: 0; }
.detail-node .chk { width: 17px; height: 17px; border-radius: 4px; border: 1.5px solid #cbd5e8; display: grid; place-items: center; cursor: pointer; flex: none; color: #fff; font-size: 11px; }
.detail-node .chk.done { background: var(--success); border-color: var(--success); }
.detail-node .n-name { flex: 1; }
.detail-node .n-date { color: var(--text-3); font-size: 11.5px; }
.detail-node.done .n-name { color: var(--text-3); text-decoration: line-through; }
.detail-attach { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 12.5px; border-bottom: 1px solid var(--border); }
.detail-attach button { border: 0; background: var(--brand-soft); color: var(--brand); border-radius: 5px; padding: 3px 9px; cursor: pointer; font-size: 11.5px; }

/* ---------- 设置页 ---------- */
.settings-card { max-width: 720px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.setting-row h4 { margin: 0 0 4px; font-size: 13.5px; }
.setting-row p { margin: 0; font-size: 12px; color: var(--text-2); }

/* ---------- 关联提示 / 快速新增 ---------- */
.link-hint { font-size: 11.5px; color: var(--brand); min-height: 16px; margin-top: 2px; }
.link-hint.warn { color: var(--danger); }
.payment-multi-list {
  max-height: 168px; overflow-y: auto; overflow-x: hidden; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; padding: 4px;
}
.payment-multi-list .pm-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 6px; cursor: pointer;
  font-size: 12.5px; font-weight: 400; color: var(--text);
}
.payment-multi-list .pm-item:hover { background: var(--brand-soft, #f2f6ff); }
/* 覆盖 .field input 的通用样式，避免复选框被撑成整行 */
.payment-multi-list .pm-item input[type=checkbox] {
  width: 16px; height: 16px; min-height: 0; flex: 0 0 16px; margin: 0; padding: 0;
  border: 1px solid var(--border); border-radius: 3px; background: #fff;
  accent-color: var(--brand); cursor: pointer;
}
.payment-multi-list .pm-item input[type=checkbox]:focus { border-color: var(--brand); box-shadow: none; }
.payment-multi-list .pm-main { flex: 1; min-width: 0; }
.payment-multi-list .pm-name { font-size: 12.5px; color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payment-multi-list .pm-meta { font-size: 11px; color: var(--text-2); }
.payment-multi-list .pm-empty { padding: 16px; text-align: center; color: var(--text-2); font-size: 12px; }
.payment-multi-list .pm-count { font-size: 11px; color: var(--brand); flex-shrink: 0; }

/* 通用复选框行（第二因子方式选择等） */
.payment-multi-list .check-line {
  display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 6px; cursor: pointer;
  font-size: 12.5px; font-weight: 400; color: var(--text);
}
.payment-multi-list .check-line:hover { background: var(--brand-soft, #f2f6ff); }
.payment-multi-list .check-line input[type=checkbox] {
  width: 16px; height: 16px; min-height: 0; flex: 0 0 16px; margin: 0; padding: 0;
  border: 1px solid var(--border); border-radius: 3px; background: #fff;
  accent-color: var(--brand); cursor: pointer;
}
.payment-multi-list .check-line input[type=checkbox]:focus { border-color: var(--brand); box-shadow: none; }
.payment-multi-list .check-line input[type=checkbox]:disabled { opacity: .45; cursor: not-allowed; }
/* 开关行 */
.switch-line { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--text); }
.switch-line input[type=checkbox] {
  width: 16px; height: 16px; min-height: 0; flex: 0 0 16px; margin: 0; padding: 0;
  border: 1px solid var(--border); border-radius: 3px; background: #fff;
  accent-color: var(--brand); cursor: pointer;
}

/* ---------- 账户菜单 ---------- */
.account-wrap { position: relative; }
.account-btn {
  display: flex; align-items: center; gap: 8px; padding: 5px 9px 5px 5px; border: 1px solid var(--border);
  border-radius: 20px; background: #fff; cursor: pointer; font: inherit; color: var(--text);
}
.account-btn:hover { border-color: var(--brand); }
.account-btn .avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 650; flex-shrink: 0;
}
.account-btn .account-name { font-size: 12.5px; font-weight: 600; }
.account-btn .account-role { font-size: 11px; color: var(--text-2); background: var(--brand-soft, #eef3ff); padding: 2px 6px; border-radius: 10px; }
.account-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 168px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(20,30,60,.14);
  padding: 6px; display: none;
}
.account-menu.open { display: block; }
.account-menu-head { padding: 8px 10px; font-size: 12px; color: var(--text-2); border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.account-menu button {
  display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; background: transparent;
  border-radius: 7px; cursor: pointer; font: inherit; font-size: 13px; color: var(--text);
}
.account-menu button:hover { background: var(--brand-soft, #eef3ff); color: var(--brand); }

/* ---------- 登录（科技风格） ---------- */
.login-backdrop {
  z-index: 200;
  background: radial-gradient(1200px 720px at 50% -12%, #1b2a55 0%, #0b1122 55%, #060a16 100%);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
}
/* 背景氛围层：网格 / 光晕 / 扫描线 */
.login-atmos { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.login-grid {
  position: absolute; inset: -40%;
  background-image:
    linear-gradient(rgba(96, 150, 255, .11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 150, 255, .11) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: perspective(620px) rotateX(56deg);
  animation: loginGridDrift 20s linear infinite;
  -webkit-mask-image: radial-gradient(ellipse at 50% 42%, #000 22%, transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 42%, #000 22%, transparent 70%);
}
@keyframes loginGridDrift { to { background-position: 0 46px, 46px 0; } }
.login-orb { position: absolute; border-radius: 50%; filter: blur(72px); opacity: .5; }
.login-orb-a { width: 420px; height: 420px; left: -9%; top: -14%; background: rgba(59, 130, 246, .55); animation: loginOrb 15s ease-in-out infinite; }
.login-orb-b { width: 380px; height: 380px; right: -7%; bottom: -16%; background: rgba(124, 92, 255, .48); animation: loginOrb 19s ease-in-out infinite reverse; }
@keyframes loginOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(38px, 30px) scale(1.14); }
}
.login-scan {
  position: absolute; left: 0; right: 0; height: 150px;
  background: linear-gradient(180deg, transparent, rgba(96, 165, 250, .07), transparent);
  animation: loginScan 7.5s linear infinite;
}
@keyframes loginScan { from { top: -150px; } to { top: 100%; } }

/* 动态背景画布：数据流（底层）+ 粒子网络（顶层） */
.login-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.login-canvas-stream { z-index: 1; opacity: .6; mix-blend-mode: screen; }
/* 粒子层需接收指针事件实现引力，但必须低于登录面板，否则会遮挡按钮 */
.login-canvas-particles { z-index: 3; opacity: .9; pointer-events: auto; }
.login-atmos > .login-grid { z-index: 0; }
.login-atmos > .login-orb { z-index: 2; }
.login-atmos > .login-scan { z-index: 4; }

/* 登录主面板：深色玻璃拟态 */
.login-panel {
  position: relative; z-index: 10; width: 100%; max-width: 424px; overflow: hidden;
  background: linear-gradient(162deg, rgba(21, 31, 60, .96), rgba(10, 16, 35, .98));
  border: 1px solid rgba(120, 160, 255, .22);
  border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(6, 11, 26, .7), 0 30px 80px rgba(3, 8, 24, .62), 0 0 64px rgba(47, 92, 255, .16);
  animation: loginIn .26s cubic-bezier(.2, .9, .3, 1);
}
@keyframes loginIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.login-panel::before {
  content: ''; position: absolute; top: 0; left: 14%; right: 14%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(125, 185, 255, .85), transparent);
}
/* 四角科技切角 */
.login-corner { position: absolute; width: 16px; height: 16px; border: 2px solid rgba(125, 190, 255, .9); pointer-events: none; z-index: 2; }
.tc-tl { top: 7px; left: 7px; border-right: 0; border-bottom: 0; }
.tc-tr { top: 7px; right: 7px; border-left: 0; border-bottom: 0; }
.tc-bl { bottom: 7px; left: 7px; border-right: 0; border-top: 0; }
.tc-br { bottom: 7px; right: 7px; border-left: 0; border-top: 0; }

/* 头部 */
.login-head { text-align: center; padding: 32px 28px 22px; border-bottom: 1px solid rgba(120, 160, 255, .14); }
.login-emblem { position: relative; width: 64px; height: 64px; margin: 0 auto 16px; display: grid; place-items: center; }
.login-mark {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #eaf1ff;
  background: linear-gradient(145deg, rgba(76, 124, 255, .96), rgba(41, 86, 220, .9));
  box-shadow: 0 0 28px rgba(60, 110, 255, .55), inset 0 0 18px rgba(255, 255, 255, .18);
}
.login-mark svg { width: 28px; height: 28px; }
.emblem-ring {
  position: absolute; inset: -5px; border-radius: 19px;
  border: 1px dashed rgba(125, 175, 255, .42); animation: loginSpin 14s linear infinite;
}
@keyframes loginSpin { to { transform: rotate(360deg); } }
.login-head h3 { margin: 0; font-size: 22px; letter-spacing: 4px; color: #f2f6ff; text-shadow: 0 0 20px rgba(90, 150, 255, .45); }
.login-subtitle { margin-top: 8px; font-size: 10px; letter-spacing: 2.4px; color: #6f8fc9; }
.login-head p { margin: 13px 0 0; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #7f96c4; letter-spacing: .4px; }
.login-pulse { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); animation: loginPulse 2.1s infinite; }
@keyframes loginPulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .5); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* 表单 */
.login-body { padding: 24px 28px 4px; }
.login-field { gap: 8px; }
.login-field label { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 600; letter-spacing: 1.3px; color: #8ea6d4; }
.field-code {
  font-size: 9.5px; letter-spacing: 1px; color: #6f97e8; font-weight: 700;
  border: 1px solid rgba(96, 140, 230, .42); border-radius: 4px; padding: 1px 5px;
}
.login-input-wrap { position: relative; display: flex; align-items: center; }
.login-input-wrap > svg { position: absolute; left: 13px; width: 17px; height: 17px; color: #5b7bbd; pointer-events: none; transition: color .2s; }
.login-field .login-input-wrap input {
  width: 100%; min-height: 44px; padding: 10px 14px 10px 41px; border-radius: 10px;
  background: rgba(8, 14, 32, .72); border: 1px solid rgba(120, 160, 255, .22);
  color: #e9f0ff; outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.login-field .login-input-wrap input::placeholder { color: #54689b; }
.login-field .login-input-wrap input:focus {
  border-color: rgba(96, 165, 250, .85); background: rgba(11, 19, 42, .92);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .16), 0 0 18px rgba(60, 120, 255, .32);
}
.login-input-wrap:focus-within > svg { color: #7cc4ff; }
.login-error { min-height: 18px; margin-top: 12px; font-size: 12.5px; color: #ff7d82; }
.login-hint {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
  font-size: 11.5px; color: #93a9d1; background: rgba(76, 124, 255, .12);
  border: 1px solid rgba(120, 160, 255, .18); padding: 9px 11px; border-radius: 9px;
}
.hint-tag { font-size: 9.5px; letter-spacing: 1.2px; color: #6ee7b7; border: 1px solid rgba(52, 211, 153, .42); border-radius: 4px; padding: 1px 5px; flex: none; }

/* ---------- 两阶段登录：阶段切换 ---------- */
.login-stage[hidden] { display: none !important; }
.login-stage { animation: loginStageIn .28s cubic-bezier(.2, .9, .3, 1); }
@keyframes loginStageIn { from { opacity: 0; transform: translateX(14px); } }
.login-stage-title {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
  font-size: 12px; font-weight: 650; letter-spacing: 1.4px; color: #9fc0f5;
}
.login-stage-title svg { width: 16px; height: 16px; color: #6ee7b7; }

/* ---------- 第二因子区块 ---------- */
.login-2fa-block { margin-top: 14px; }
.login-2fa-block > label {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 1.3px; color: #8ea6d4;
}
.login-2fa-desc { margin: 0 0 10px; font-size: 11.5px; line-height: 1.7; color: #7f96c4; }
.login-2fa-status { margin-top: 8px; font-size: 11.5px; color: #7f96c4; min-height: 16px; line-height: 1.6; }
.login-2fa-status.ok { color: #6ee7b7; }
.login-2fa-status.err { color: #ff7d82; }
.login-2fa-status.warn { color: #ffc978; }

/* 图形验证码 */
.captcha-row { display: flex; align-items: center; gap: 9px; }
.captcha-canvas {
  width: 150px; height: 46px; flex: none; border-radius: 9px; cursor: pointer;
  border: 1px solid rgba(120, 160, 255, .3); background: #0d1730;
  transition: border-color .2s, box-shadow .2s;
}
.captcha-canvas:hover { border-color: rgba(96, 165, 250, .7); box-shadow: 0 0 14px rgba(59, 130, 246, .28); }
.captcha-row input {
  flex: 1; min-width: 0; min-height: 44px; padding: 10px 13px; border-radius: 10px;
  background: rgba(8, 14, 32, .72); border: 1px solid rgba(120, 160, 255, .22);
  color: #e9f0ff; outline: none; letter-spacing: 4px; font-weight: 650; text-transform: uppercase;
  transition: border-color .2s, box-shadow .2s;
}
.captcha-row input::placeholder { color: #54689b; letter-spacing: 1px; font-weight: 400; }
.captcha-row input:focus {
  border-color: rgba(96, 165, 250, .85); background: rgba(11, 19, 42, .92);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .16), 0 0 18px rgba(60, 120, 255, .3);
}
.captcha-refresh {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer;
  border-radius: 10px; color: #8fb0ee;
  background: rgba(76, 124, 255, .12); border: 1px solid rgba(120, 160, 255, .22);
  transition: color .2s, background .2s, transform .3s;
}
.captcha-refresh svg { width: 17px; height: 17px; }
.captcha-refresh:hover { color: #7cc4ff; background: rgba(76, 124, 255, .22); }
.captcha-refresh:active { transform: rotate(180deg); }

/* 生物识别按钮 */
.bio-btn {
  position: relative; width: 100%; display: flex; align-items: center; gap: 13px;
  padding: 13px 15px; border-radius: 12px; cursor: pointer; text-align: left;
  background: linear-gradient(120deg, rgba(47, 92, 255, .16), rgba(124, 92, 255, .13));
  border: 1px solid rgba(120, 160, 255, .3); color: #dbe7ff; overflow: hidden;
  transition: border-color .22s, box-shadow .22s, transform .12s, background .22s;
}
.bio-btn:hover {
  border-color: rgba(96, 165, 250, .72);
  box-shadow: 0 0 22px rgba(59, 130, 246, .3), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.bio-btn:active { transform: translateY(1px); }
.bio-btn:disabled { opacity: .55; cursor: not-allowed; }
.bio-icon {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px;
  background: rgba(12, 20, 46, .75); border: 1px solid rgba(120, 160, 255, .28); color: #7cc4ff;
}
.bio-icon svg { width: 23px; height: 23px; }
.bio-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bio-text b { font-size: 13px; font-weight: 650; letter-spacing: .4px; }
.bio-text small { font-size: 10.5px; color: #7f96c4; letter-spacing: .3px; }
.bio-pulse {
  margin-left: auto; flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); animation: loginPulse 2.1s infinite;
}
.bio-btn.verified .bio-pulse { animation: none; background: #6ee7b7; box-shadow: 0 0 10px #6ee7b7; }
.bio-btn.pending .bio-pulse { background: #ffc978; box-shadow: 0 0 10px #ffc978; animation: none; }

/* 设备指纹 */
.device-fp-row { display: flex; align-items: center; gap: 11px; }
.device-fp-bar {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 11px;
  background: rgba(12, 20, 46, .75); border: 1px solid rgba(120, 160, 255, .28);
}
.device-fp-bar i {
  display: block; width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid #7cc4ff; border-top-color: transparent; border-right-color: transparent;
  animation: loginSpin 1.5s linear infinite;
}
.device-fp-code {
  flex: 1; min-width: 0; font-size: 12px; letter-spacing: 1.4px; color: #9fc0f5;
  background: rgba(8, 14, 32, .7); border: 1px solid rgba(120, 160, 255, .18);
  padding: 9px 12px; border-radius: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 返回上一步 */
.login-back {
  width: 100%; margin-top: 10px; padding: 9px; cursor: pointer; border-radius: 9px;
  background: transparent; border: 1px solid rgba(120, 160, 255, .18);
  color: #8ea6d4; font-size: 12px; letter-spacing: 1px;
  transition: color .2s, background .2s, border-color .2s;
}
.login-back:hover { color: #cfe2ff; background: rgba(76, 124, 255, .12); border-color: rgba(120, 160, 255, .34); }
.login-back[hidden] { display: none !important; }

/* 登录按钮 */
.login-foot { padding: 8px 28px 22px; }
.login-submit {
  position: relative; width: 100%; min-height: 46px; border: 0; border-radius: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px; overflow: hidden;
  color: #fff; font-size: 15px; font-weight: 650; letter-spacing: 4px;
  background: linear-gradient(120deg, #3f7bff, #2f5cff 55%, #6f4bff);
  box-shadow: 0 10px 26px rgba(47, 92, 255, .38), inset 0 1px 0 rgba(255, 255, 255, .24);
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}
.login-submit::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 18%, rgba(255, 255, 255, .32) 50%, transparent 82%);
  transform: translateX(-120%); animation: loginSweep 3.8s ease-in-out infinite;
}
@keyframes loginSweep { 0% { transform: translateX(-120%); } 55%, 100% { transform: translateX(120%); } }
.login-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(47, 92, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .3); }
.login-submit:active { transform: translateY(0); }
.login-submit:disabled { opacity: .6; cursor: default; transform: none; }
.login-submit-label { position: relative; z-index: 1; }

/* 底部状态栏 */
.login-statusbar {
  display: flex; justify-content: space-between; gap: 10px; padding: 10px 28px;
  border-top: 1px solid rgba(120, 160, 255, .12); background: rgba(7, 12, 27, .55);
  font-size: 9.5px; letter-spacing: 1.5px; color: #56719f;
}
.login-statusbar span { display: inline-flex; align-items: center; gap: 6px; }
.dot-online { width: 6px; height: 6px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px #34d399; }

@media (max-width: 480px) {
  .login-head { padding: 26px 20px 18px; }
  .login-body { padding: 20px 20px 4px; }
  .login-foot { padding: 6px 20px 18px; }
  .login-statusbar { padding: 9px 20px; font-size: 8.5px; }
}
/* 视口过矮时允许面板内部滚动，避免内容被裁切 */
@media (max-height: 680px) {
  .login-panel { overflow: hidden auto; max-height: calc(100vh - 24px); }
}
@media (prefers-reduced-motion: reduce) {
  .login-grid, .login-orb, .login-scan, .emblem-ring, .login-pulse, .login-submit::before { animation: none; }
}

/* ---------- 用户管理 ---------- */
.user-role-tag { font-size: 11px; padding: 2px 7px; border-radius: 10px; }
.user-role-tag.admin { background: var(--brand-soft, #eef3ff); color: var(--brand); }
.user-role-tag.member { background: #f2f4f7; color: var(--text-2); }
.user-status-tag { font-size: 11px; padding: 2px 7px; border-radius: 10px; }
.user-status-tag.active { background: #e7f7ee; color: #1a8f4e; }
.user-status-tag.disabled { background: #fdecec; color: var(--danger); }
.row-actions { display: flex; gap: 8px; }
.link-btn { border: 0; background: transparent; color: var(--brand); cursor: pointer; font: inherit; font-size: 12.5px; padding: 0; }
.link-btn.danger { color: var(--danger); }
.link-btn:hover { text-decoration: underline; }
.quick-add-item {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: 9px; background: #fff; cursor: pointer; text-align: left;
}
.quick-add-item:last-child { margin-bottom: 0; }
.quick-add-item:hover { border-color: var(--brand); background: var(--brand-soft); }
.quick-add-item strong { display: block; font-size: 13.5px; }
.quick-add-item p { margin: 2px 0 0; font-size: 11.5px; color: var(--text-2); }
.quick-icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: 16px; }
.quick-icon.c-blue { background: var(--brand-soft); }
.quick-icon.c-green { background: var(--success-soft); }
.quick-icon.c-orange { background: var(--warn-soft); }
.crumb { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.crumb a { color: var(--brand); cursor: pointer; }
.crumb a:hover { text-decoration: underline; }
.chain-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; margin-bottom: 16px; }
.chain-node { background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 6px 11px; }
.chain-node b { color: var(--text); }
.chain-arrow { color: var(--text-3); }
.mini-table { width: 100%; font-size: 12px; }
.mini-table th { padding: 8px 10px; font-size: 11px; }
.mini-table td { padding: 8px 10px; }
.amount-in { color: var(--success); font-weight: 600; }
.amount-out { color: var(--danger); font-weight: 600; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 20px);
  background: #10162a; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: .22s; z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 780px) {
  .sidebar { position: fixed; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: grid; }
  .content { padding: 18px 16px 40px; }
  .topbar { padding: 0 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
  .amount-triple { grid-template-columns: 1fr; }
  .node-row { grid-template-columns: 1fr 1fr 28px; }
  .node-row input:nth-child(3) { grid-column: span 2; }
  /* 顶栏操作区在窄屏收缩：隐藏按钮文字，仅保留图标，避免横向溢出 */
  .topbar-actions { gap: 6px; flex: none; }
  .topbar-actions .btn { padding: 0 10px; min-width: 0; }
  .topbar-actions .btn .btn-text { display: none; }
  .topbar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
  .account-name, .account-role { display: none; }
  .account-btn { padding: 4px 6px; }
}
