/* 225班班费登记管理系统 - 简洁办公风 · 视觉打磨版 */
:root {
  --primary: #3565e0;
  --primary-dark: #2851bd;
  --primary-soft: #eef4ff;
  --primary-border: #d7e4fb;
  --danger: #d92d20;
  --danger-soft: #fef3f2;
  --success: #067647;
  --success-soft: #ecfdf3;
  --text: #101828;
  --text-sub: #667085;
  --text-mute: #98a2b3;
  --border: #e9edf3;
  --border-strong: #d6dbe3;
  --bg: #f6f8fb;
  --card: #ffffff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
  --ring: 0 0 0 4px rgba(53, 101, 224, .12);
  --ease: cubic-bezier(.25, .6, .3, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* 页面顶部渐变细线 */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3565e0, #5b8def 45%, #7cc6f0);
  z-index: 999;
}

a { color: var(--primary); text-decoration: none; }

::selection { background: rgba(53, 101, 224, .16); }

/* 细滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d3d9e2; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #b9c2cf; }

/* ---------- 顶部导航 ---------- */
.topbar {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16.5px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: .2px;
}
.brand-logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3565e0, #5b8def);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  box-shadow: 0 4px 10px rgba(53, 101, 224, .28);
}
.nav {
  display: flex;
  gap: 4px;
  background: #f2f4f8;
  padding: 4px;
  border-radius: 12px;
}
.nav a {
  padding: 7px 20px;
  border-radius: 9px;
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .1);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 28px 48px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  overflow: hidden;
}
.card-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title {
  font-size: 15.5px;
  font-weight: 650;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: .2px;
}
.card-title::before {
  content: "";
  width: 4px; height: 16px;
  background: linear-gradient(180deg, #3565e0, #5b8def);
  border-radius: 3px;
}
.card-body { padding: 24px; }

/* ---------- 统计区 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}
.stat-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
  overflow: hidden;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(16, 24, 40, .12);
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -34px; top: -34px;
  width: 130px; height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, currentColor, transparent 70%);
  opacity: .06;
  pointer-events: none;
}

/* 三张卡片三种底色：极淡彩底 + 深色数字
   （蓝=总班费 / 橙=已支出 / 绿=剩余，超支时剩余转红） */
.stat-total {
  background: linear-gradient(150deg, #f6f9ff 0%, #eaf1fd 100%);
  border-color: #dbe6fa;
}
.stat-total::after { color: #3565e0; }

.stat-spent {
  background: linear-gradient(150deg, #fffaf3 0%, #fdefdc 100%);
  border-color: #f6e2c9;
}
.stat-spent::after { color: #d96f1f; }

.stat-remain {
  background: linear-gradient(150deg, #f1faf5 0%, #e3f4ea 100%);
  border-color: #cde8d8;
}
.stat-remain::after { color: #0fa968; }

.stat-remain.negative {
  background: linear-gradient(150deg, #fdf6f5 0%, #fbe9e7 100%);
  border-color: #f0cfcc;
}
.stat-remain.negative::after { color: #d63c31; }

/* 浅色卡片：深色文字 + 彩色数字 */
.stat-total .stat-label { color: #3a5db8; }
.stat-spent .stat-label { color: #a8561d; }
.stat-remain .stat-label { color: #0b7a4a; }
.stat-remain.negative .stat-label { color: #c4342a; }
.stat-total .stat-sub { color: #6b7fae; }
.stat-spent .stat-sub { color: #a87848; }
.stat-remain .stat-sub { color: #4c8f6d; }
.stat-remain.negative .stat-sub { color: #b0655e; }
.stat-total .stat-value { color: #1d4fd8; }
.stat-spent .stat-value { color: #d45d17; }
.stat-remain .stat-value { color: #067a47; }
.stat-remain.negative .stat-value { color: #d92d20; }
.stat-total .stat-value .unit { color: #8fa3cc; }
.stat-spent .stat-value .unit { color: #c99a6a; }
.stat-remain .stat-value .unit { color: #7fb99b; }
.stat-remain.negative .stat-value .unit { color: #cf8b84; }
.stat-card .badge {
  background: rgba(255, 255, 255, .72);
  color: inherit;
  border: 1px solid rgba(120, 130, 150, .14);
}

.stat-label {
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
}
.stat-label::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: .55;
  flex: none;
}
.stat-value {
  font-size: 30px;
  font-weight: 700;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.8px;
  line-height: 1.25;
}
.stat-value .unit {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-mute);
  margin-left: 4px;
  letter-spacing: 0;
}
.stat-sub { font-size: 12.5px; color: var(--text-mute); margin-top: 6px; }

.stat-remain .stat-value { font-size: 34px; }

/* 统计卡数字：悬停出现"可编辑"提示，点击变输入框 */
.stat-value.clickable {
  cursor: text;
  display: inline-block;
  border-radius: 8px;
  padding: 0 2px;
  transition: background .18s var(--ease);
}
.stat-value.clickable:hover { background: rgba(255, 255, 255, .75); }
.stat-value.clickable::after {
  content: " ✎";
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mute);
  opacity: 0;
  transition: opacity .18s var(--ease);
}
.stat-card:hover .stat-value.clickable::after { opacity: .85; }

/* 统计卡内联编辑输入框 */
.stat-inline-input {
  width: 190px;
  height: 40px;
  font-size: 21px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.4px;
  color: inherit;
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  padding: 0 12px;
  outline: none;
  font-family: inherit;
  box-shadow: var(--ring);
  background: #fff;
}

/* 副文本中的"结转金额"可点击修改 */
.stat-edit-link {
  color: inherit;
  font-weight: 650;
  cursor: pointer;
  border-bottom: 1.5px dashed currentColor;
  padding-bottom: 1px;
  transition: opacity .15s;
}
.stat-edit-link:hover { opacity: .7; }

/* 汇总句 */
.summary-sentence {
  margin-bottom: 22px;
  padding: 15px 20px;
  background: linear-gradient(90deg, var(--primary-soft), #f7faff);
  border: 1px solid var(--primary-border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  color: #344054;
}
.summary-sentence b { font-weight: 700; font-variant-numeric: tabular-nums; }
.summary-sentence .sum-total { color: #1d4fd8; }
.summary-sentence .sum-carry { color: #5b8def; }
.summary-sentence .sum-spent { color: #d45d17; }
.summary-sentence .sum-remain { color: #067a47; }
.summary-sentence .sum-remain.negative { color: #d92d20; }

/* ---------- 学期切换条 ---------- */
.term-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 20px;
  margin-bottom: 22px;
}
.term-switch .ts-label {
  font-size: 13px;
  color: var(--text-sub);
  font-weight: 500;
}
.term-switch select {
  width: auto;
  min-width: 150px;
  font-weight: 600;
  color: var(--primary);
  border-color: var(--primary-border);
  background: var(--primary-soft);
}
.term-switch select:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.term-switch .spacer { flex: 1; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: .2px;
}
.badge-ghost {
  background: #f2f4f8;
  color: var(--text-sub);
  font-weight: 500;
}
.badge-lg {
  padding: 3px 12px;
  font-size: 13px;
}

/* ---------- 表单 ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
}
.field { display: flex; flex-direction: column; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}
.field label .req { color: var(--danger); margin-left: 2px; }
.field label .hint {
  color: var(--text-mute);
  font-weight: 400;
  font-size: 12px;
  margin-left: 6px;
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
  background: #fdfeff;
}
input:hover, select:hover { border-color: #b8c1cf; }
input::placeholder { color: var(--text-mute); }
input.amount-input {
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
input.amount-input.is-expense { color: var(--danger); }
input.amount-input.is-refund { color: var(--success); }

.form-actions {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.form-tip { font-size: 12.5px; color: var(--text-mute); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s var(--ease), border-color .18s var(--ease),
              color .18s var(--ease), transform .12s var(--ease), box-shadow .18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, #3a6ce4, #2851bd);
  color: #fff;
  box-shadow: 0 4px 12px rgba(53, 101, 224, .26);
}
.btn-primary:hover { box-shadow: 0 6px 16px rgba(53, 101, 224, .36); filter: brightness(1.04); }
.btn-default { background: #fff; border-color: var(--border-strong); color: #344054; }
.btn-default:hover { border-color: #aab4c3; background: #f8fafc; }
.btn-ghost { background: transparent; color: var(--text-sub); }
.btn-ghost:hover { background: #f2f4f8; color: var(--text); }
.btn-danger { background: #fff; border-color: #f2c1bd; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: #e8a9a3; }
.btn-sm { height: 33px; padding: 0 16px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* 凭证上传 */
.uploader { display: flex; align-items: flex-start; gap: 14px; }
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border: 1.5px dashed #c2ccdb;
  border-radius: var(--radius-sm);
  background: #fafbfd;
  color: var(--text-sub);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  transition: border-color .18s, color .18s, background .18s;
}
.upload-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.uploader input[type="file"] { display: none; }
.preview-box {
  position: relative;
  width: 96px; height: 96px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f8fafc;
  display: none;
  cursor: zoom-in;
  box-shadow: var(--shadow-sm);
}
.preview-box.show { display: block; }
.preview-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(16, 24, 40, .58);
  color: #fff;
  border: none;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.preview-remove:hover { background: rgba(16, 24, 40, .8); }

/* ---------- 筛选 ---------- */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.filter-bar .field { min-width: 150px; }
.filter-bar .field label { font-size: 12.5px; }
.filter-bar .field input, .filter-bar .field select { height: 38px; }
.filter-bar .grow { flex: 1; min-width: 200px; }

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  margin: 0 24px;
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data-table th {
  background: linear-gradient(180deg, #f8fafd, #f2f5fa);
  text-align: left;
  font-weight: 650;
  color: #55617a;
  font-size: 12.5px;
  letter-spacing: .4px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.data-table th:first-child { border-top-left-radius: 0; }
table.data-table th:last-child { border-top-right-radius: 0; }
table.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #eef1f6;
  vertical-align: middle;
}
table.data-table tbody tr {
  transition: background .15s var(--ease), box-shadow .15s var(--ease);
}
table.data-table tbody tr:nth-child(even) { background: #fcfdff; }
table.data-table tbody tr:hover { background: var(--primary-soft); }
table.data-table tbody tr:last-child td { border-bottom: none; }
.col-amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
th.col-amount { text-align: right; }
.amount-expense { color: var(--danger); font-weight: 700; }
.amount-refund { color: var(--success); font-weight: 700; }
.col-date { white-space: nowrap; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.col-ops { white-space: nowrap; text-align: right; }
th.col-ops { text-align: right; }
.cell-purpose { max-width: 340px; word-break: break-all; color: var(--text); line-height: 1.5; }
.cell-payer { white-space: nowrap; font-weight: 550; color: #3c4758; }

.thumb {
  width: 44px; height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  cursor: zoom-in;
  display: block;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .08);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.thumb:hover { transform: scale(1.1); box-shadow: var(--shadow); }
.thumb-empty { color: var(--text-mute); font-size: 12px; }

.empty {
  padding: 64px 20px;
  text-align: center;
  color: var(--text-mute);
}
.empty-icon {
  font-size: 38px;
  display: block;
  margin-bottom: 10px;
  opacity: .45;
}

.ops-link {
  background: #f2f5fa;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  padding: 4px 10px;
  border-radius: 7px;
  transition: background .15s, color .15s;
}
.ops-link:hover { background: var(--primary); color: #fff; }
.ops-link.danger { color: var(--danger); background: var(--danger-soft); }
.ops-link.danger:hover { background: var(--danger); color: #fff; }
.ops-sep { display: none; }

.table-foot {
  margin: 0 24px;
  padding: 13px 4px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-sub);
  background: #fff;
}

/* 总览表 */
.overview-table td.num,
.overview-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.overview-table.tbl-mt { margin-top: 6px; }
.overview-table tbody tr { cursor: pointer; }
.overview-table tbody tr:hover { background: var(--primary-soft); }
.overview-table tbody tr.active-row { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.overview-table tbody tr.active-row td:first-child { font-weight: 650; color: var(--primary); }

.head-ops {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.card-title .badge { font-weight: 500; }

/* 设置卡片折叠（默认收起，点标题展开） */
.fold-title { cursor: pointer; user-select: none; }
.fold-title:hover .fold-hint { color: var(--primary); }
.fold-arrow {
  font-size: 12px;
  color: var(--text-mute);
  transition: transform .22s var(--ease);
  line-height: 1;
}
.fold-title.open .fold-arrow { transform: rotate(180deg); }
.fold-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-mute);
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 20px;
  padding: 2px 10px;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.fold-title.open .fold-hint { border-color: transparent; background: var(--primary-soft); color: var(--primary); }
.card-body.collapsed { display: none; }

/* 更多操作下拉 */
.more-wrap { position: relative; display: inline-block; }
.more-menu {
  position: absolute;
  right: 0; top: calc(100% + 6px);
  min-width: 170px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .14);
  padding: 6px;
  z-index: 50;
  display: none;
  animation: fade-in .16s var(--ease);
}
.more-menu.open { display: block; }
.more-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
}
.more-menu button:hover { background: var(--primary-soft); color: var(--primary); }
.more-menu button.more-danger { color: var(--danger); }
.more-menu button.more-danger:hover { background: var(--danger-soft); color: var(--danger); }

.warn-text { color: var(--danger); font-size: 12px; margin-top: 6px; }
.hint-text { color: var(--text-mute); font-size: 12px; margin-top: 6px; }

/* ---------- 高级设置折叠（上学期结转） ---------- */
.adv-block {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-strong);
}
.adv-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  font-family: inherit;
  padding: 7px 12px;
  margin-left: -12px;
  border-radius: 9px;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.adv-toggle:hover { color: var(--primary); background: var(--primary-soft); }
.adv-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #cbd5e4;
  transition: background .15s var(--ease);
}
.adv-toggle:hover .adv-dot { background: var(--primary); }
.adv-arrow {
  font-size: 11px;
  transition: transform .22s var(--ease);
}
.adv-toggle.open .adv-arrow { transform: rotate(180deg); }
.adv-panel {
  display: none;
  margin-top: 16px;
  animation: fadeIn .18s var(--ease);
}
.adv-panel.open { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .46);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-mask.show { display: flex; animation: fade-in .18s var(--ease); }
.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
  animation: pop-in .22s var(--ease);
}
.modal-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 650; }
.modal-close {
  background: #f2f4f8;
  border: none;
  width: 30px; height: 30px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1;
  color: var(--text-sub);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.modal-close:hover { background: #e8ecf2; color: var(--text); }
.modal-body { padding: 24px; }
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #fcfdfe;
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 图片放大 */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .86);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 32px;
  cursor: zoom-out;
  animation: fade-in .18s var(--ease);
}
.lightbox.show { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}

/* ---------- 提示条 ---------- */
.toast-box {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(16, 24, 40, .92);
  backdrop-filter: blur(6px);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in .22s var(--ease);
}
.toast-success { background: rgba(6, 118, 71, .94); }
.toast-error { background: rgba(217, 45, 32, .94); }
.toast-out { opacity: 0; transform: translateY(-8px); transition: .26s var(--ease); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 最近录入 ---------- */
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px dashed #eef1f6;
  font-size: 13.5px;
}
.recent-list li:last-child { border-bottom: none; }
.recent-date { color: var(--text-mute); white-space: nowrap; font-variant-numeric: tabular-nums; }
.recent-purpose { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-amount { font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .container { padding: 18px 16px 40px; }
  .topbar-inner { padding: 0 16px; }
  .brand span.brand-text { display: none; }
  .summary-sentence { font-size: 13.5px; }
}

/* ---------- 访问口令层（云端部署） ---------- */
.pass-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eef3fb 0%, #f7f9fc 100%);
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}
.pass-card {
  width: min(340px, 88vw);
  background: #fff;
  border-radius: 16px;
  padding: 34px 30px 30px;
  box-shadow: 0 18px 50px rgba(30, 55, 90, 0.14);
  text-align: center;
}
.pass-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2f6fed, #4c8dff);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(47, 111, 237, 0.3);
}
.pass-title { font-size: 17px; font-weight: 700; color: #1a2b4a; }
.pass-sub { margin: 8px 0 18px; font-size: 13px; color: #7a8aa5; }
.pass-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1px solid #d8e0ee;
  border-radius: 10px;
  font-size: 15px;
  color: #1a2b4a;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: center;
  letter-spacing: 2px;
}
.pass-input:focus { border-color: #4c8dff; box-shadow: 0 0 0 3px rgba(76, 141, 255, 0.16); }
.pass-err { min-height: 20px; margin-top: 8px; font-size: 12.5px; color: #e5484d; }
.pass-btn {
  width: 100%;
  margin-top: 4px;
  padding: 11px 0;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #2f6fed, #4c8dff);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.pass-btn:hover { opacity: 0.9; }
.pass-btn:disabled { opacity: 0.55; cursor: default; }
