/* ========== PRTS 主题 (对齐 perseudulcis.com 落地页风格) ========== */
@font-face{font-family:'MiSans';font-style:normal;font-weight:300;font-display:swap;src:url('../fonts/MiSans-Light.sub.woff2') format('woff2');}
@font-face{font-family:'MiSans';font-style:normal;font-weight:400;font-display:swap;src:url('../fonts/MiSans-Regular.sub.woff2') format('woff2');}
@font-face{font-family:'MiSans';font-style:normal;font-weight:600;font-display:swap;src:url('../fonts/MiSans-Demibold.sub.woff2') format('woff2');}
@font-face{font-family:'MiSans';font-style:normal;font-weight:700;font-display:swap;src:url('../fonts/MiSans-Bold.sub.woff2') format('woff2');}
@font-face{font-family:'Orbitron';font-style:normal;font-weight:700;font-display:swap;src:url('../fonts/orbitron-latin-700-normal.woff2') format('woff2');}
@font-face{font-family:'Orbitron';font-style:normal;font-weight:900;font-display:swap;src:url('../fonts/orbitron-latin-900-normal.woff2') format('woff2');}
[data-theme="dark"]{
  --pico-background-color:#1c1c1e;
  --pico-color:#e8e8ea;
  --pico-card-background-color:rgba(30,30,34,.72);  /* 磨砂玻璃 */
  --pico-card-border-color:rgba(166,180,230,.14);
  --pico-border-color:rgba(166,180,230,.12);
  --pico-muted-color:#9aa0b5;
  --pico-muted-border-color:rgba(166,180,230,.12);
  --pico-primary:#4d6bfe;
  --pico-primary-background:#4d6bfe;
  --pico-primary-border:#4d6bfe;
  --pico-primary-underline:#4d6bfe;
  --pico-primary-hover:#6b8aff;
  --pico-primary-hover-background:#6b8aff;
  --pico-form-element-background-color:#27272b;
  --pico-form-element-border-color:#2e2e31;
  --pico-form-element-color:#e8e8ea;
  --pico-form-element-active-background-color:#4d6bfe;
  --pico-form-element-focus-color:#4d6bfe;
  --pico-form-element-placeholder-color:#6b6f76;
  --pico-code-background-color:#27272b;
}
/* 标题字体用 MiSans (中文标题清晰) + 白色突出 */
.sidebar-header h2,
.app-main h1,.app-main h2,.app-main h3{font-family:'MiSans','PingFang SC','Microsoft YaHei',sans-serif;letter-spacing:1px;color:#ffffff;}
.sidebar-header h2{letter-spacing:1px;color:#ffffff;}
.app-main h1{font-size:1.5rem;color:#ffffff;}
.app-main h2{color:#ffffff;}
.app-main h3{color:#f2f2f4;}
.sidebar-header small{color:#c9c9ce;}
.sidebar-header .prts-logo{width:26px;height:26px;vertical-align:-5px;margin-right:7px;filter:drop-shadow(0 0 6px rgba(77,107,254,.5));}
.app-footer{font-family:'MiSans','PingFang SC','Microsoft YaHei',sans-serif;letter-spacing:1px;}
/* Cockpit 自定义样式 */

/* ========== 侧边栏布局 ========== */
body {
  margin: 0;
  padding: 0;
  position: relative;
  background: #1c1c1e;
}
/* ========== PRTS 星空+网格+流星 背景层 ========== */
.cp-grid{
  position:fixed; inset:0; pointer-events:none; z-index:0;
  background:
    linear-gradient(rgba(109,121,220,.05) 1px,transparent 1px),
    linear-gradient(90deg,rgba(109,121,220,.05) 1px,transparent 1px);
  background-size:42px 42px;
}
.cp-stars{position:fixed; inset:0; pointer-events:none; z-index:0; overflow:hidden;}
/* 星空: canvas 一次性画静态星点(零持续开销), 只有少量 .tw 星点在闪
   旧版 90 颗 span 全跑无限 CSS 动画 —— 实测占切标签时主线程开销的 60% */
.cp-stars canvas{position:absolute; inset:0; width:100%; height:100%; display:block;}
.cp-stars span{position:absolute; width:2px; height:2px; border-radius:50%; background:#fff;}
.cp-stars span.tw{animation:cpTwinkle var(--d,4s) ease-in-out var(--dl,0s) infinite;}
/* 渲染/切标签期间暂停闪烁, 不与图表重绘抢主线程 */
.cp-stars.bg-paused span{animation-play-state:paused;}
.cp-stars span:nth-child(3n){background:#6b8aff;}
.cp-stars span:nth-child(4n){background:#ff8c1a;}
@keyframes cpTwinkle{0%,100%{opacity:.2; transform:scale(.8);} 50%{opacity:1; transform:scale(1.25);}}
/* 流星样式已移除 (2026-09-14) */
/* 主内容盖在背景上 */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  width: 220px;
  /* 2026-09-11 性能修复: 原为 rgba(28,30,36,.55) + blur(20px)。侧栏 220x1000 是最大
     单块毛玻璃, 实测 blur(12px)→库存53/流动性49fps、blur(2px) 仍有 7~8 帧抖动,
     完全去掉 → 五个页签全部 60fps / 0 卡帧。背后是深色星空, 磨砂视觉收益极低, 改半透明实底。 */
  background: rgba(24,26,32,.86);
  border-right: 1px solid rgba(180,195,240,.18);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.sidebar-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.sidebar-header small {
  color: var(--pico-muted-color);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  border: none;
  background: transparent;
  color: #cfd3e0;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  margin: 0;
}

.sidebar-item:hover {
  background: var(--pico-muted-border-color);
  color: var(--pico-color);
}

.sidebar-item.active {
  background: rgba(77, 107, 254, 0.12);
  color: #ffffff;
  border-left-color: var(--pico-primary);
  font-weight: 600;
  box-shadow: inset 0 0 12px rgba(77,107,254,.06);
}

.sidebar-icon {
  font-size: 1.1rem;
}

.sidebar-label {
  flex: 1;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--pico-muted-border-color);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.user-info {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
}

.user-name {
  font-weight: 600;
  color: var(--pico-color);
}

.user-role {
  color: var(--pico-muted-color);
  font-size: 0.75rem;
}

.logout-btn {
  display: block;
  text-align: center;
  padding: 0.4rem 0.6rem;
  background: transparent;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 4px;
  color: var(--pico-color);
  text-decoration: none;
  font-size: 0.85rem;
}

.logout-btn:hover {
  background: var(--pico-muted-border-color);
  color: var(--pico-primary);
}

.app-main {
  flex: 1;
  padding: 2rem;
  min-width: 0;
  overflow-x: auto;
}

.app-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--pico-muted-border-color);
  text-align: center;
  color: var(--pico-muted-color);
}

/* ========== 旧导航栏样式 (移除) ========== */
.nav-bar {
  display: none;
}

/* ========== 登录页 ========== */
.login-card {
  max-width: 400px;
  margin: 5rem auto;
}

/* ========== Tab 内容区 ========== */
.tab-panel {
  animation: fadeIn 0.2s ease;
  max-width: 100%;
  overflow-x: hidden;
}

/* 数据库 Tab 内容容器 — 强制不溢出 */
#tab-db {
  max-width: 100%;
  overflow-x: hidden;
  word-wrap: break-word;
}
#tab-db .db-filters-panel,
#tab-db .db-summary,
#db-table-container {
  max-width: 100%;
  overflow-x: auto;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tab-header {
  margin-bottom: 1.5rem;
}

.tab-header h3 {
  margin-bottom: 0.25rem;
}

/* ========== 数据库 Tab ========== */
.db-controls {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.db-select-group {
  flex: 1;
  min-width: 250px;
}

.db-select-label {
  display: block;
  font-size: 0.72rem;
  color: var(--pico-muted-color);
  margin-bottom: 0.15rem;
  line-height: 1;
}

.db-select-group select {
  width: 100%;
  height: 2.6rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
}

.db-controls button {
  margin: 0;
  white-space: nowrap;
  height: 2.5rem;
  padding: 0 1rem;
  display: inline-flex;
  align-items: center;
}

/* ========== 筛选面板 ========== */
.db-filters-panel {
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.db-filters-header {
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--pico-muted-border-color);
}

/* 默认网格布局 (auto-fill 平铺) */
.db-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

/* 分行布局 (自定义 filterRows) */
.filter-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.6rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-row .filter-item {
  flex: 1;
  min-width: 150px;
}

.filter-row .filter-item label {
  display: block;
  font-size: 0.8rem;
  margin: 0;
}

.filter-row .filter-item input {
  width: 100%;
  margin: 0;
}

.filter-item {
  margin: 0;
}

.filter-item label {
  font-size: 0.85rem;
  margin: 0;
  color: var(--pico-muted-color);
}

.filter-input {
  width: 100%;
  margin: 0.25rem 0 0;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
}

.filter-range {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.filter-range input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0.4rem 0.4rem;
  font-size: 0.85rem;
}

.db-summary {
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.db-summary .summary-title {
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--pico-primary);
}

.db-summary .summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.5rem;
}

.db-summary .summary-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0;
  white-space: nowrap;
}

.db-summary .summary-label {
  color: var(--pico-muted-color);
}

.db-summary .summary-value {
  font-weight: bold;
  font-family: monospace;
}

.db-result {
  overflow-x: auto;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 4px;
  margin-bottom: 1rem;
}

.db-result table {
  width: 100%;
  margin: 0;
  font-size: 0.85rem;
  table-layout: auto;
  border-collapse: collapse;
}

.db-result table th {
  position: sticky;
  top: 0;
  background: var(--pico-card-background-color);
  z-index: 1;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--pico-muted-border-color);
}

.db-result table th:hover {
  background: var(--pico-muted-border-color);
  color: var(--pico-primary);
}

.db-result table td {
  white-space: nowrap;        /* 关键: 不换行 */
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;           /* 单格最大宽度 */
  padding: 0.4rem 0.75rem;
}

.db-result .row-count {
  padding: 0.5rem 1rem;
  background: var(--pico-card-background-color);
  border-bottom: 1px solid var(--pico-muted-border-color);
  font-size: 0.85rem;
  color: var(--pico-muted-color);
}

/* 分页控件 */
.db-pagination {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.pagination-controls {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.page-btn {
  padding: 0.4rem 0.75rem;
  margin: 0;
  font-size: 0.85rem;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 3px;
  cursor: pointer;
  color: var(--pico-color);
}

.page-btn:hover:not(:disabled):not(.active) {
  background: var(--pico-muted-border-color);
}

.page-btn.active {
  background: var(--pico-primary);
  color: white;
  border-color: var(--pico-primary);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-ellipsis {
  padding: 0.4rem 0.5rem;
  color: var(--pico-muted-color);
}

.page-info {
  margin-left: 0.5rem;
  font-size: 0.85rem;
  color: var(--pico-muted-color);
}

/* ========== Flatpickr 日历修复 (v4 性能优化) ========== */
/* Pico CSS 把 .day 的 z-index 设为较低, 这里强制覆盖 */
.flatpickr-calendar {
  z-index: 9999 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* 范围选择颜色 (v4 优化: 删除 box-shadow 拼接, 用纯 background 减少重绘) */
.flatpickr-day.inRange {
  background: rgba(77, 107, 254, 0.3) !important;
  color: var(--pico-color) !important;
  box-shadow: none !important;
}

.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--pico-primary) !important;
  color: white !important;
  box-shadow: none !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected.inRange {
  background: var(--pico-primary) !important;
  color: white !important;
  border-color: var(--pico-primary) !important;
  box-shadow: none !important;
}

/* 容器不能 hidden overflow */
.filter-item,
.db-filters-panel,
.db-filters-grid {
  overflow: visible !important;
}

/* ========== 释放规则卡片 ========== */
.release-rules-panel {
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-primary);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.release-rules-panel h4 {
  margin-top: 0;
  color: var(--pico-primary);
}

.release-rules-panel .rules-table {
  width: 100%;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.release-rules-panel .rules-table th {
  background: var(--pico-muted-border-color);
  padding: 0.5rem;
  text-align: left;
}

.release-rules-panel .rules-table td {
  padding: 0.5rem;
  border-bottom: 1px dashed var(--pico-muted-border-color);
}

/* ========== 驾驶舱 Tab ========== */
.cockpit-summary {
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 4px;
  padding: 1.5rem;
}

#cockpit-data {
  margin-top: 1rem;
}

.cockpit-bank-row {
  display: grid;
  grid-template-columns: 200px 1fr 1fr 1fr;
  gap: 1rem;
  padding: 0.5rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
  align-items: center;
}

.cockpit-bank-row:hover {
  background: var(--pico-muted-border-color);
}

.cockpit-bank-name {
  font-weight: bold;
}

.cockpit-bank-value {
  text-align: right;
  font-family: monospace;
}

/* ========== 通用 ========== */
mark {
  background: var(--pico-del-color);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: block;
  margin-bottom: 1rem;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* ========== 驾驶舱 Tab ========== */
.cockpit-bank-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 1rem;                                  /* 与边框留距: 选项不再顶到边角 */
  background: var(--pico-card-background-color);  /* 与图表区域同款透明度/样式 */
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 4px;
}
/* 银行/时间 选项 = 玻璃小方块 */
.cockpit-bank-tabs .bank-tab,
.cockpit-controls .preset-btn{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(180,195,240,.18);
  border-radius: 6px;
  color: #d7dae6;
}
.cockpit-bank-tabs .bank-tab:hover,
.cockpit-controls .preset-btn:hover{
  background: rgba(255,255,255,.13) !important;
  color: #ffffff;
}
.cockpit-bank-tabs .bank-tab.active,
.cockpit-controls .preset-btn.active{
  background: var(--pico-primary) !important;
  border-color: var(--pico-primary) !important;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(77,107,254,.45);
}

.bank-tab {
  padding: 0.5rem 1rem;
  border: 1px solid var(--pico-muted-border-color);
  background: var(--pico-card-background-color);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--pico-muted-color);
  margin: 0;
  transition: all 0.15s;
}

.bank-tab:hover {
  border-color: var(--pico-primary);
  color: var(--pico-primary);
}

.bank-tab.active {
  background: var(--pico-primary);
  color: white;
  border-color: var(--pico-primary);
  font-weight: 600;
}

.cockpit-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  padding: 1rem;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 4px;
}

.date-presets {
  display: flex;
  gap: 0.3rem;
}

.preset-btn {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--pico-muted-border-color);
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--pico-muted-color);
  margin: 0;
  transition: all 0.15s;
}

.preset-btn:hover {
  border-color: var(--pico-primary);
  color: var(--pico-primary);
}

.preset-btn.active {
  background: var(--pico-primary);
  color: white;
  border-color: var(--pico-primary);
  font-weight: 600;
}

.preset-btn small {
  font-size: 0.7rem;
  opacity: 0.8;
}

/* 清空按钮（内联在日期框右侧） */
.date-clear-inline {
  display: none;
  cursor: pointer;
  color: var(--pico-muted-color);
  font-size: 0.9rem;
  padding: 0 6px;
  user-select: none;
  line-height: 1;
}
#cockpit-date-range:not(:placeholder-shown) ~ .date-clear-inline {
  display: inline;
}
.date-clear-inline:hover {
  color: var(--pico-primary);
}

.date-range-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin: 0;
  color: var(--pico-muted-color);
}

.date-range-label input {
  margin: 0;
  padding: 0.4rem 0.6rem;
  width: 280px;
  font-size: 0.9rem;
}

.current-bank-display {
  margin-left: auto;
  padding: 0.4rem 0.8rem;
  background: var(--pico-muted-border-color);
  border-radius: 4px;
  font-size: 0.9rem;
}

.chart-wrapper {
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 4px;
  padding: 1rem;
  height: 500px;
  margin-bottom: 1rem;
}

.chart-wrapper canvas {
  max-height: 100%;
}

.cockpit-stats {
  width: 100%;
}

/* 合计模式 — 各家银行汇总表格 */
.cockpit-summary-table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

.cockpit-summary-range {
  font-size: 0.8rem;
  color: var(--pico-muted-color);
  margin-bottom: 0.5rem;
}
.cockpit-summary-range strong {
  color: var(--pico-color);
}

.cockpit-range-info {
  font-size: 0.8rem;
  color: var(--pico-muted-color);
  margin-bottom: 0.4rem;
  padding: 0 0.2rem;
}
.cockpit-range-info strong {
  color: var(--pico-primary);
}

.cockpit-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 4px;
}

.cockpit-summary-table th {
  background: var(--pico-muted-border-color);
  color: var(--pico-color);
  font-weight: 600;
  padding: 0.65rem 1rem;
  text-align: right;
  white-space: nowrap;
  border-bottom: 2px solid var(--pico-muted-border-color);
}

.cockpit-summary-table th:first-child {
  text-align: left;
}

.cockpit-summary-table td {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.cockpit-summary-table td.bank-name {
  font-weight: 600;
  color: var(--pico-color);
  text-align: left;
}

.cockpit-summary-table td.num {
  text-align: right;
  font-family: monospace;
  white-space: nowrap;
}

.cockpit-summary-table td.positive {
  color: rgb(34, 197, 94);
}

.cockpit-summary-table td.negative {
  color: rgb(239, 68, 68);
}

.cockpit-summary-table tr.total-row {
  border-top: 2px solid var(--pico-primary);
  font-weight: 700;
  background: rgba(77, 107, 254, 0.08);
}

.cockpit-summary-table tr.total-row td {
  border-bottom: none;
}

/* 单银行模式 — 统计卡片行 */
.cockpit-single-stats {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.cockpit-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem 0.3rem;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 6px;
  text-align: center;
}

.supplement-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem 0.3rem;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-primary);
  border-radius: 6px;
  text-align: center;
  grid-column: auto;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--pico-muted-color);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.stat-value {
  font-size: 0.9rem;
  font-weight: 700;
  font-family: monospace;
  color: var(--pico-color);
}

.stat-value.positive {
  color: rgb(34, 197, 94);
}

.stat-value.negative {
  color: rgb(239, 68, 68);
}

.supplement-item .stat-value {
  color: var(--pico-primary);
}

/* ─── 选中日期补充余额信息卡 ─── */
#cockpit-selected-info {
  background: linear-gradient(135deg, rgba(77,107,254,0.12), rgba(34,197,94,0.08));
  border: 1px solid rgba(77,107,254,0.3);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
.sel-info-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.sel-label {
  font-size: 0.78rem;
  color: #94a3b8;
  white-space: nowrap;
}
.sel-value {
  font-size: 0.9rem;
  color: #e2e8f0;
  font-family: 'Courier New', monospace;
  font-weight: 600;
}
.sel-value.positive { color: #22c55e; }
.sel-value.negative { color: #ef4444; }

/* ========== 两列布局 (余额左 + 授信右) ========== */
.cockpit-layout {
  display: flex;
  gap: 2mm;
  position: relative;
  min-height: 600px;
}

.cockpit-left {
  flex: 1;
  min-width: 0;
  transition: flex 0.3s ease, max-width 0.3s ease;
}

.cockpit-right {
  width: 0;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  transition: width 0.3s ease, padding 0.3s ease;
  background: var(--pico-card-background-color);
}

.cockpit-right.open {
  width: 540px;
  padding: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--pico-muted-border-color);
}

.cockpit-right.open .credit-panel {
  flex: 1;
  min-height: 0;
  width: 540px;
}

/* 切换按钮 */
.credit-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  cursor: pointer;
  background: var(--pico-card-background-color);
  border: 2px solid var(--pico-primary);
  border-radius: 6px 0 0 6px;
  color: var(--pico-primary);
  font-size: 0.9rem;
  font-weight: bold;
  user-select: none;
  transition: all 0.15s;
  flex-shrink: 0;
}

.credit-toggle:hover {
  background: var(--pico-primary);
  color: white;
}

/* ========== 授信圆环面板 ========== */
#cockpit-right.credit-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100%;
}

.credit-header {
  padding: 1rem 1rem 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.credit-controls {
  padding: 0 1rem;
  display: flex;
  gap: 0.3rem;
}

.credit-close-btn:hover {
  background: var(--pico-muted-border-color);
  color: var(--pico-color);
}

/* 银行 Tab */
.credit-bank-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.credit-bank-tab {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--pico-muted-border-color);
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--pico-muted-color);
  margin: 0;
  transition: all 0.15s;
}

.credit-bank-tab:hover {
  border-color: var(--pico-primary);
  color: var(--pico-primary);
}

.credit-bank-tab.active {
  background: var(--pico-primary);
  color: white;
  border-color: var(--pico-primary);
}

/* 区间筛选 */
.credit-controls {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  align-items: center;
}

.credit-preset {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--pico-muted-border-color);
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--pico-muted-color);
  margin: 0;
  transition: all 0.15s;
}

.credit-preset:hover {
  border-color: var(--pico-primary);
  color: var(--pico-primary);
}

.credit-preset.active {
  background: var(--pico-primary);
  color: white;
  border-color: var(--pico-primary);
}

.credit-date-input {
  width: 140px;
  margin: 0;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 4px;
  background: transparent;
  color: var(--pico-color);
  cursor: pointer;
}

/* 圆环图容器 */
.credit-chart-wrap {
  position: relative;
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
  padding: 10px 0;
}

.credit-chart-wrap canvas {
  width: 100% !important;
  height: auto !important;
}

.credit-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.credit-center-label {
  font-size: 0.7rem;
  color: var(--pico-muted-color);
  margin-bottom: 0.15rem;
}

.credit-center-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--pico-color);
  font-family: monospace;
  line-height: 1.2;
}

/* 图例 */
.credit-legend {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--pico-color);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-avail { background: #22C55E; }
.dot-occ { background: #EF4444; }
.dot-interval { background: #F97316; }

/* 银行明细表 */
.credit-bank-detail {
  margin-top: 0.3rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.credit-bank-table-wrap {
  overflow-x: auto;
}

.credit-bank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.65rem;
}

.credit-bank-table th {
  background: var(--pico-muted-border-color);
  padding: 0.25rem 0.3rem;
  text-align: right;
  white-space: nowrap;
  font-weight: 600;
  border-bottom: 2px solid var(--pico-muted-border-color);
  font-size: 0.65rem;
}

.credit-bank-table th:first-child { text-align: left; }

.credit-bank-table td {
  padding: 0.2rem 0.3rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.credit-bank-table td.bn {
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  font-size: 0.6rem;
}

.credit-bank-table td.num {
  text-align: right;
  font-family: monospace;
  white-space: nowrap;
  font-size: 0.6rem;
}

.credit-bank-table td.occ { color: #F97316; }
.credit-bank-table td.rel { color: #22C55E; }
.credit-bank-table td.avail { color: #3B82F6; font-weight: 700; }

/* 授信明细合计行 */
.credit-total-row td {
  border-top: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
}
.credit-total-row strong {
  color: #e2e8f0;
}

/* 授信导出按钮 */
.credit-export-bar {
  text-align: right;
  margin-top: 0.6rem;
}
.credit-export-btn {
  padding: 0.4rem 1rem;
  border: 1px solid rgba(77,107,254,0.4);
  background: rgba(77,107,254,0.1);
  color: #6b8aff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}
.credit-export-btn:hover {
  background: rgba(77,107,254,0.2);
  border-color: rgba(77,107,254,0.6);
}

/* 本日/昨日余额列 — 2026-09-11 用户要求: 改为橙色(与蓝字区分, 当日口径突出) */
.cockpit-summary-table td.today-bal {
  color: #ffa53d;
  font-weight: 700;
}

/* 用信余额 (未结清票据) — 参考列, 灰字 */
.cockpit-summary-table td.credit-used {
  color: #aab6c8;
}

.cockpit-summary-table tr.total-row td.credit-used {
  color: #cbd4e0;
}

/* 余额占比列 (账户余额 / 用信余额) — 独立列, 冷色与橙色余额区分 */
.cockpit-summary-table td.ratio-cell {
  color: #7fb0f0;
  font-weight: 600;
  white-space: nowrap;
}

.cockpit-summary-table tr.total-row td.ratio-cell {
  color: #a8c8ff;
}

/* 列宽分配: 银行/占比收窄, 金额列等宽, 数字用等宽字形保证竖向对齐 */
.cockpit-summary-table {
  table-layout: fixed;
  min-width: 960px;
}

.cockpit-summary-table th:nth-child(1) { width: 16%; }   /* 银行 */
.cockpit-summary-table th:nth-child(2) { width: 15%; }   /* 用信余额 */
.cockpit-summary-table th:nth-child(3) { width: 8%; }    /* 占比 */
.cockpit-summary-table th:nth-child(4) { width: 15%; }   /* 余额 */
.cockpit-summary-table th:nth-child(5) { width: 15%; }   /* 期末余额 */
.cockpit-summary-table th:nth-child(6) { width: 15.5%; } /* 期间扣款合计 */
.cockpit-summary-table th:nth-child(7) { width: 15.5%; } /* 期间变化 */

.cockpit-summary-table td.num {
  font-variant-numeric: tabular-nums;
}

/* 会话过期遮罩: 401 时明确告知"登录过期"，避免图表静默空白 */
#session-expired-mask {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 10, 16, 0.62);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}

#session-expired-mask .se-card {
  min-width: 300px; max-width: 420px;
  padding: 26px 28px 22px;
  border: 1px solid rgba(126, 176, 240, 0.28);
  border-radius: 14px;
  background: rgba(24, 28, 38, 0.94);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  text-align: center;
  color: #e6ebf5;
}

#session-expired-mask .se-icon { font-size: 1.6rem; color: #ffa53d; }

#session-expired-mask .se-title {
  margin: 0.5rem 0 0.35rem;
  font-size: 1.12rem; font-weight: 700; color: #fff;
}

#session-expired-mask .se-desc {
  font-size: 0.86rem; line-height: 1.6; color: #a8b2c4;
}

#session-expired-mask .se-btn {
  display: inline-block; margin-top: 16px; padding: 8px 22px;
  border-radius: 8px; background: #ff8c1a; color: #1b1200;
  font-weight: 700; text-decoration: none;
}

#session-expired-mask .se-btn:hover { background: #ffa53d; }

.balance-date-label {
  font-size: 0.75rem;
  color: var(--pico-primary);
  margin-bottom: 0.3rem;
  font-weight: 600;
}

/* ========== 库存看板 Tab ========== */

.inv-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.inv-stat-card {
  background: rgba(33,33,36,0.92);
  border: 1px solid #2e2e31;
  border-radius: 10px;
  padding: 0.8rem 1rem;
}
.inv-label {
  font-size: 0.7rem;
  color: #64748b;
  margin-bottom: 0.2rem;
}
/* 库存看板 KPI 标签(在库台数/在库金额/银票在库/现金在库)改白色 —— 只作用于 #inv-stats-grid,
   不影响流动性预测 Tab 里同样用 .inv-label 的标签 (2026-09-14) */
#inv-stats-grid .inv-label { color: #ffffff; }
.inv-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #e2e8f0;
}
.inv-value.blue { color: #6b8aff; }
.blue { color: #6b8aff; }
.inv-value.orange { color: #fb923c; }
.inv-value.green { color: #4ade80; }

.inv-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 1000px) {
  .inv-grid { grid-template-columns: 1fr; }
}

.inv-left-col {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-width: 0;
  overflow: hidden;
}

.inv-chart-card {
  background: rgba(33,33,36,0.92);
  border: 1px solid #2e2e31;
  border-radius: 12px;
  padding: 1rem;
}
.inv-chart-toolbar {
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.inv-chart-subtitle {
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
}
.inv-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.78rem;
  color: #94a3b8;
  user-select: none;
}
.inv-toggle input { display: none; }
.inv-toggle-slider {
  position: relative;
  width: 36px; height: 20px;
  background: rgba(77,107,254,0.25);
  border-radius: 10px;
  transition: background 0.2s;
}
.inv-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #94a3b8;
  border-radius: 50%;
  transition: all 0.2s;
}
.inv-toggle input:checked + .inv-toggle-slider {
  background: rgba(77,107,254,0.6);
}
.inv-toggle input:checked + .inv-toggle-slider::after {
  left: 18px;
  background: #6b8aff;
}
.inv-chart-wrap {
  position: relative;
  height: 350px;
}

.inv-table-card {
  background: rgba(33,33,36,0.92);
  border: 1px solid #2e2e31;
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}
.inv-table-header {
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.inv-table-header > span:first-child { color: #ffffff; }
.inv-sheet1-export-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  margin-left: auto;
  padding: 0.42rem 0.95rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #eaf2ff;
  background: linear-gradient(180deg, rgba(77,107,254,0.5), rgba(59,84,210,0.68));
  border: 1px solid rgba(107,138,255,0.5);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 2px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.10);
  transition: all 0.18s ease;
}
.inv-sheet1-export-btn svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  stroke: currentColor;
  transition: transform 0.18s ease;
}
.inv-sheet1-export-btn:hover {
  color: #fff;
  background: linear-gradient(180deg, rgba(107,138,255,0.92), rgba(77,107,254,0.96));
  border-color: rgba(143,166,255,0.95);
  box-shadow: 0 0 0 3px rgba(77,107,254,0.28), 0 5px 14px rgba(77,107,254,0.35);
  transform: translateY(-1px);
}
.inv-sheet1-export-btn:hover svg { transform: translateY(1px); }
.inv-sheet1-export-btn:active {
  transform: translateY(0) scale(0.97);
  background: rgba(29,78,216,0.98);
  box-shadow: 0 0 0 3px rgba(77,107,254,0.20), inset 0 2px 4px rgba(0,0,0,0.3);
}
.inv-sheet1-export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  background: rgba(77,107,254,0.12);
  color: rgba(231,241,255,0.6);
  border-color: rgba(107,138,255,0.3);
  box-shadow: none;
}
.inv-sheet1-export-btn:disabled svg { transform: none; }
.inv-table-scroll {
  overflow-y: auto;
  flex: 1;
}
.inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.inv-table th {
  text-align: center;
  padding: 0.5rem 0.6rem;
  color: #ffffff;   /* 2026-09-10 用户要求：汇总表表头（品牌/未结清余额/库存余额/台数）改白 */
  font-weight: 600;
  border-bottom: 1px solid #2e2e31;
  position: sticky;
  top: 0;
  background: #242428;
  z-index: 1;
}
.inv-table td {
  padding: 0.4rem 0.6rem;
  color: #f1f5f9;   /* 2026-09-11 提亮: 对比度不足 */
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.inv-table td.num { text-align: center; font-family: 'Courier New', monospace; }

/* 合计行 — 居中 */
.inv-group-header td:first-child {
  text-align: center;
  font-weight: 600;
  color: #ffffff;   /* 2026-09-11 提亮 */
  cursor: pointer;
  user-select: none;
}
.inv-group-header td:first-child:hover {
  color: #ffa53d;   /* 2026-09-11 蓝->橙 */
}
.inv-arrow {
  display: inline-block;
  width: 1.2rem;
  font-size: 0.65rem;
  color: #94a3b8;   /* 2026-09-11 提亮 */
  cursor: pointer;
  transition: color 0.2s;
}
.inv-group-header:hover .inv-arrow {
  color: #ffa53d;   /* 2026-09-11 蓝->橙 */
}
.inv-group-label {
  margin-left: 0.2rem;
}

/* 细项行 — 居中, 用颜色区分 */
.inv-detail-row td:first-child {
  text-align: center;
  color: #cbd5e1;   /* 2026-09-11 提亮: 原 #94a3b8 在玻璃底上看不清 */
  font-size: 0.82rem;
}
.inv-detail-row td.num {
  color: #e8eefc;   /* 2026-09-11 提亮: 原 #cbd5e1 */
  font-size: 0.82rem;
  font-weight: 500;
}

/* 汇总行 — 加粗, 居中 */
.inv-grand-total td {
  border-top: 2px solid #3a3a3f;
  font-weight: 700;
  font-size: 0.88rem;
}
.inv-grand-total td:first-child {
  text-align: center;
}

/* section 间分隔线 */
.inv-group-sep td {
  border-top: 1px solid #2e2e31;
  padding: 0;
  height: 4px;
}
.inv-sec-divider td {
  border-bottom: none;
  padding: 0.6rem 0.6rem 0.2rem;
  color: #cbd5e1;   /* 2026-09-11 提亮 */
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 1px;
  text-align: center;
}

.inv-section {
  background: rgba(33,33,36,0.92);
  border: 1px solid #2e2e31;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.8rem;
}
.inv-section-title {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.inv-note {
  margin-bottom: 0.5rem;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.78rem;
  color: #86efac;
  background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.2);
}
.inv-note.warn {
  color: #fdba74;
  background: rgba(249,115,22,0.08);
  border-color: rgba(249,115,22,0.25);
}
.inv-note strong { color: #e2e8f0; }

/* ========== 上传区 (数据库 Tab) ========== */
/* ═══════════════════════════════════════════════
   上传区 (数据库 Tab)
   ═══════════════════════════════════════════════ */

.db-upload-details {
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 8px;
  padding: 0.5rem 1rem;
}

.db-upload-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--pico-primary);
  padding: 0.3rem 0;
  user-select: none;
}

.db-upload-summary:hover {
  opacity: 0.85;
}

.db-upload-inner {
  padding: 0.8rem 0;
}

.db-upload-desc {
  font-size: 0.82rem;
  color: var(--pico-muted-color);
  margin: 0 0 0.8rem 0;
}

.db-upload-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.db-upload-input {
  flex: none;
  width: auto;
  height: 2.5rem;
  padding: 0;
  font-size: 0.85rem;
  border: none;
  background: transparent;
  color: transparent;
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.db-upload-input::file-selector-button {
  padding: 0 0.8rem;
  border: 1px solid var(--pico-primary);
  background: transparent;
  border-radius: 4px;
  color: var(--pico-primary);
  font-size: 0.8rem;
  cursor: pointer;
  height: 2rem;
  line-height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.db-upload-input::file-selector-button:hover {
  background: var(--pico-primary);
  color: white;
}

/* 上传按钮与文件选择按钮等高 */
.db-upload-row button {
  height: 2.5rem;
  padding: 0 1rem;
  margin: 0;
  display: inline-flex;
  align-items: center;
}

/* 发票对账区 */
.db-invoice-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.db-upload-submit-row {
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* 文件列表显示区 — 在选择按钮右侧 */
.db-upload-files {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow: hidden;
  min-width: 0;
  padding: 0 0.3rem;
}

.db-upload-placeholder {
  font-size: 0.82rem;
  color: var(--pico-muted-color);
  white-space: nowrap;
}

.db-upload-file-item {
  font-size: 0.78rem;
  background: rgba(77, 107, 254, 0.12);
  color: #8fa6ff;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  flex-shrink: 1;
}

.db-upload-file-more {
  font-size: 0.75rem;
  color: var(--pico-muted-color);
  white-space: nowrap;
  flex-shrink: 0;
}

/* 清除按钮 — 红灰色 */
#db-upload-clear-btn {
  flex: none;
  width: 2.2rem;
  min-width: auto;
  padding: 0;
  height: 2.2rem;
  border-radius: 4px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  background: transparent;
  cursor: pointer;
}
#db-upload-clear-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.5);
}

.db-upload-progress {
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--pico-muted-color);
}

.db-upload-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--pico-muted-border-color);
  border-top-color: var(--pico-primary);
  border-radius: 50%;
  animation: db-spin 0.8s linear infinite;
}

@keyframes db-spin {
  to { transform: rotate(360deg); }
}

.db-upload-result {
  margin-top: 0.8rem;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.6;
}

.db-upload-result.success {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #86efac;
}

.db-upload-result.error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.db-upload-result.warn,
.db-upload-result.warning {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  color: #fde68a;
}

.db-upload-result strong {
  color: #e2e8f0;
}

.db-upload-detail {
  margin-top: 0.4rem;
  font-size: 0.8rem;
}

.db-upload-detail summary {
  cursor: pointer;
  color: var(--pico-muted-color);
}

.db-upload-detail pre {
  font-size: 0.75rem;
  background: rgba(0,0,0,0.3);
  padding: 0.5rem;
  border-radius: 4px;
  margin-top: 0.3rem;
  max-height: 200px;
  overflow-y: auto;
  color: #94a3b8;
}

/* ========== 票据号多选级联 (note-multi) ========== */
.note-multi-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
}
.note-multi-wrap .filter-text {
  width: 100%;
  margin: 0;
  height: 2.2rem;
  font-size: 0.82rem;
}
.note-multi-select {
  width: 100%;
  min-height: 140px;
  max-height: 200px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 0.78rem;
  font-family: 'Courier New', monospace;
  padding: 0.2rem;
}
.note-multi-select option {
  padding: 0.25rem 0.4rem;
  white-space: nowrap;
}
.note-multi-select option:checked {
  background: rgba(77, 107, 254, 0.35);
  color: #6b8aff;
}
.note-multi-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.note-multi-export-btn {
  padding: 0.3rem 0.8rem;
  height: 2.2rem;
  font-size: 0.82rem;
  border: 1px solid var(--pico-primary);
  background: transparent;
  color: var(--pico-primary);
  border-radius: 4px;
  cursor: pointer;
  align-self: flex-start;
}
.note-multi-export-btn:hover:not(:disabled) {
  background: var(--pico-primary);
  color: white;
}
.note-multi-export-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── 流动性预测 Tab (2026-08-04) ── */
.liq-chart-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.liq-chart-toolbar {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}
.liq-chart-subtitle {
  font-weight: 600;
  color: #e2e8f0;
  font-size: 0.9rem;
}
.liq-section {
  margin-bottom: 1.2rem;
}
.liq-section-title {
  font-weight: 600;
  color: #e2e8f0;
  margin: 0.8rem 0 0.5rem;
  font-size: 0.95rem;
}
.liq-cf-table th, .liq-cf-table td,
.liq-notes-table th, .liq-notes-table td,
.liq-ratio-table th, .liq-ratio-table td {
  white-space: nowrap;
}
.liq-row-p td {
  background: rgba(107, 138, 255, 0.05);
  color: #8fa6ff;
}

/* ── 流动性预测 Tab v2 (2026-08-04) ── */
.liq-cf-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
  font-size: 0.82rem;
}
.liq-cf-tool-label {
  color: #94a3b8;
  font-weight: 600;
}
.liq-cf-tool-sep {
  width: 1px;
  height: 1.2rem;
  background: rgba(148, 163, 184, 0.25);
  margin: 0 0.2rem;
}
.liq-cf-hint {
  color: #64748b;
  font-size: 0.75rem;
}
.liq-month-filter {
  display: flex;
  gap: 0.3rem;
}
.liq-month-filter .preset-btn {
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
}
.liq-col-hide {
  margin-left: 0.35rem;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 0.65rem;
  padding: 0 0.15rem;
  opacity: 0.55;
}
.liq-col-hide:hover {
  opacity: 1;
  color: #f87171;
}
.liq-cf-table th {
  position: relative;
  white-space: nowrap;
}
.liq-details {
  margin: 0.5rem 0 1rem;
  background: rgba(30, 41, 59, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  padding: 0.6rem 1rem;
}
.liq-details summary {
  cursor: pointer;
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.3rem 0;
  user-select: none;
}
.liq-details summary:hover {
  color: #8fa6ff;
}

/* 关键列底色 (一般户余额/可用资金) */
.liq-col-key {
  background: rgba(45, 212, 191, 0.10) !important;
}
.liq-cf-table th.liq-col-key {
  background: rgba(45, 212, 191, 0.16) !important;
  color: #5eead4;
}
.liq-row-p td.liq-col-key {
  background: rgba(45, 212, 191, 0.14) !important;
}

/* ── 流动性预测 v3 子 Tab + 模拟 (2026-08-05) ── */
.liq-subtabs {
  display: flex;
  gap: 0.4rem;
  margin: 0.6rem 0 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 0.5rem;
}
.liq-subtab {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: all 0.15s;
}
.liq-subtab:hover { color: #e2e8f0; border-color: rgba(148, 163, 184, 0.5); }
.liq-subtab.active {
  background: rgba(107, 138, 255, 0.15);
  color: #8fa6ff;
  border-color: rgba(107, 138, 255, 0.5);
}
.liq-sim-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
}
.liq-sim-toggle input { accent-color: #6b8aff; cursor: pointer; }
.liq-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem;
  max-width: 860px;
}
.liq-config-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 600;
}
.liq-config-input {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  color: #e2e8f0;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  width: 100%;
  box-sizing: border-box;
}
.liq-config-input:focus { border-color: #6b8aff; outline: none; }
.liq-config-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.8rem;
}
.liq-sim-form {
  background: rgba(30, 41, 59, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.8rem;
}
.liq-sim-form-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.liq-sim-form-row label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 600;
  min-width: 130px;
  flex: 0 0 auto;
}
.liq-sim-table td, .liq-sim-table th { white-space: nowrap; }
.liq-sim-repay-cell { font-size: 0.78rem; color: #94a3b8; white-space: pre-line; }
.liq-sim-del {
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #f87171;
  border-radius: 6px;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
}
.liq-sim-del:hover { background: rgba(248, 113, 113, 0.12); }
.liq-sim-edit {
  background: transparent;
  border: 1px solid rgba(107, 138, 255, 0.4);
  color: #8fa6ff;
  border-radius: 6px;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  margin-right: 0.3rem;
}
.liq-sim-edit:hover { background: rgba(107, 138, 255, 0.12); }
.liq-sim-out { color: #f87171; }
.liq-sim-in { color: #4ade80; }

/* ── 流动性预测 v3.1 对齐 + 月度计划 (2026-08-05) ── */
.liq-sim-form-row label {
  flex: 1 1 0;
  min-width: 140px;
}
.liq-config-input {
  height: 2.4rem;
  resize: vertical;
}
textarea.liq-config-input {
  height: 2.4rem;
  min-height: 2.4rem;
}
.liq-sim-gen {
  margin-top: 0.35rem;
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #4ade80;
  border-radius: 6px;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  align-self: flex-start;
}
.liq-sim-gen:hover { background: rgba(74, 222, 128, 0.15); }
.liq-plans-input {
  width: 90px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 5px;
  color: #e2e8f0;
  padding: 0.3rem 0.45rem;
  font-size: 0.8rem;
  text-align: right;
  box-sizing: border-box;
}
.liq-plans-input:focus { border-color: #6b8aff; outline: none; }
.liq-plans-table th, .liq-plans-table td { white-space: nowrap; }
.liq-plans-toolbar { margin-bottom: 0.5rem; }

/* ── 对齐强化: 覆盖 Pico 表单控件差异 (2026-08-05) ── */
.liq-config-input {
  height: 2.4rem !important;
  min-height: 2.4rem !important;
  max-height: none !important;
  padding: 0.3rem 0.6rem !important;
  font-size: 0.85rem !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
}
textarea.liq-config-input {
  height: 2.4rem !important;
  min-height: 2.4rem !important;
  resize: vertical;
}

/* ── 流动性预测 v3.2 模拟表单三行 + 只读列 (2026-08-05) ── */
#sim-repay, #sim-note {
  height: 5rem !important;
  min-height: 5rem !important;
}
.liq-sim-form-row label {
  align-items: flex-start;
}
.liq-plans-ro {
  color: #94a3b8;
  font-style: italic;
  font-weight: 600;
}
.liq-plans-scope {
  display: flex;
  gap: 0.3rem;
}
.liq-sim-repay-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.35rem;
  width: 100%;
}
.liq-sim-repay-foot .liq-sim-gen {
  margin-top: 0;
}

/* ── 流动性预测 v3.3 UI 微调 (2026-08-05) ── */
/* 1. 标题/名称白色更明显 */
.liq-section-title { color: #ffffff; }
/* lucide 小图标通用 (区块标题/按钮内) */
.sec-ico{width:15px;height:15px;vertical-align:-2px;margin-right:5px;color:#6b8aff;flex-shrink:0;}
.liq-subtab .sec-ico,.preset-btn .sec-ico{color:inherit;}
.liq-subtab { color: #e2e8f0; }
.liq-plans-table th, .liq-cf-table th, .liq-notes-table th, .liq-ratio-table th {
  color: #f1f5f9;
}
.liq-plans-scope .preset-btn { color: #f1f5f9; }
/* 2. 业务计划行高缩小 */
.liq-plans-table td { padding: 0.18rem 0.4rem; }
.liq-plans-input {
  height: 1.9rem;
  padding: 0.18rem 0.45rem;
  font-size: 0.78rem;
}
/* 3. 表格宽度按内容自适应 (不铺满, 正常比例) */
.liq-plans-table { width: auto; }
/* 4. 自动生成按钮在标题右侧 */
.liq-sim-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}
.liq-sim-label-row .liq-sim-gen {
  margin-top: 0;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
}
.liq-sim-repay-hint {
  display: block;
  margin-top: 0.3rem;
  font-weight: normal;
  color: #64748b;
}
.liq-plans-input {
  height: 1.9rem !important;
  min-height: 1.9rem !important;
  max-height: none !important;
  padding: 0.18rem 0.45rem !important;
  font-size: 0.78rem !important;
  line-height: 1.2 !important;
}
.liq-sim-label-row {
  display: grid !important;
  grid-template-columns: 1fr auto;
  align-items: center !important;
  gap: 0.5rem;
  width: 100%;
}
.liq-sim-label-row > span { line-height: 1.6; }
/* ── 流动性预测 v3.4 月度计划列宽整理 (2026-08-05) ── */
.liq-plans-total {
  color: #f1f5f9 !important;
  font-style: normal !important;
  font-weight: 700 !important;
}
/* 预测采购额列: span 撑列宽, input 绝对定位覆盖 (避免 input 撑宽列) */
.liq-plans-fb {
  position: relative;
}
.liq-plans-fb-sp {
  display: inline-block;
  width: 74px;
  height: 1.9rem;
}
.liq-plans-fb-input {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 74px !important;
  max-width: 74px !important;
  margin: 0 !important;
}
/* 表头字号统一小号, 避免 th 文字把列撑宽 (Pico th 默认 16.4px) */
.liq-plans-table th {
  font-size: 0.82rem !important;
}
#plans-head th:nth-child(2) {
  padding-left: 8px !important;
  padding-right: 8px !important;
}
.liq-plans-input {
  width: 74px !important;
}
#plans-head th {
  font-size: 0.82rem !important;
}
/* ── v3.5 模拟表单对称对齐 (2026-08-05) ── */
.liq-sim-label-row {
  height: 2rem;
  overflow: visible;
}
.liq-sim-label-row .liq-sim-gen {
  height: 1.7rem;
  line-height: 1;
}

/* ── 回款统计 Tab (2026-08-07) ── */
.hk-period-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.hk-period-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #94a3b8;
}
.hk-select {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}
.hk-input {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  width: 140px;
}
.hk-btn {
  background: rgba(107, 138, 255, 0.15);
  color: #8fa6ff;
  border: 1px solid rgba(107, 138, 255, 0.4);
  border-radius: 6px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.hk-btn:hover { background: rgba(107, 138, 255, 0.3); }
.hk-btn:disabled { opacity: 0.5; cursor: wait; }
.hk-period-info {
  font-size: 0.8rem;
  color: #64748b;
}
.hk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: 0.4rem;
}
.hk-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  padding: 0.8rem 1rem;
}
.hk-card-title {
  font-weight: 600;
  color: #e2e8f0;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.hk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}
.hk-table th, .hk-table td {
  padding: 0.35rem 0.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  white-space: nowrap;
}
.hk-table th {
  color: #94a3b8;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.06);
}
.hk-table td.num {
  font-variant-numeric: tabular-nums;
}
.hk-total td {
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.08);
}
.hk-transition-form {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}
.hk-link-btn {
  background: none;
  border: none;
  color: #f87171;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.1rem 0.3rem;
}
.hk-link-btn:hover { text-decoration: underline; }
.hk-btn-sm {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
}
.hk-unmatched-ops {
  white-space: nowrap;
}
.hk-unmatched-target {
  font-size: 0.78rem;
  text-align: left;
  white-space: nowrap;
}
.hk-detail-table {
  margin: 0.4rem 0 0.2rem 1.5rem;
  width: calc(100% - 1.5rem);
  font-size: 0.78rem;
}
.hk-detail-table th {
  background: rgba(148, 163, 184, 0.04);
}
.hk-detail-row > td {
  background: rgba(30, 41, 59, 0.35);
  padding: 0.2rem 0.5rem;
}
.hk-amt-in { color: #4ade80; }
.hk-amt-out { color: #f87171; }
/* 票据补充列宽: 金额×2 / 备注×1.5 (需 !important 压过 .liq-plans-input 74px !important) */
#tr-batch-table .tr-batch-amount { width: 180px !important; }
#tr-batch-table .tr-batch-note { width: 135px !important; }

/* ========== 磨砂玻璃质感 v2 (2026-09-09) ==========
   2026-09-11 性能修复: 原实现给 16 个容器(含整页容器 #hk-view 1296x2440、
   #liq-view 1296x1547)全套 backdrop-filter: blur(24px)。实测毛玻璃面积与帧率成反比:
     库存 1.5M px²→20fps / 流动性 3.9M→13.5fps / 回款 8.3M→14fps / 底表 0.46M→33.6fps
     关闭全部 blur 后 → 五个页签全部稳定 60fps
   现改为: 大面积/嵌套容器 → 半透明底(无 blur, 底色加深补偿可读性);
           小面积玻璃面 → 保留磨砂但半径减半。 */
.tab-panel .inv-chart-card,
.tab-panel .liq-chart-card,
.tab-panel .credit-panel,
.tab-panel .cockpit-right,
.tab-panel .liq-section,
.tab-panel .db-card,
.tab-panel .hk-card,
.tab-panel .db-summary,
.tab-panel .liq-plans-card,
.tab-panel .inv-table-card,
.tab-panel .db-filters-panel,
.tab-panel .liq-subpanel,
.tab-panel .db-upload-summary{
  background: rgba(30,32,40,.72) !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(180,195,240,.22);
  box-shadow: 0 10px 40px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.06);
  transform: translateZ(0);
}
/* 小面积玻璃面: 保留磨砂质感(半径从 24px 降到 10px, 成本约降 6 成) */
.tab-panel .inv-stat-card,
.tab-panel .credit-controls,
.tab-panel .liq-month-filter{
  background: rgba(30,32,40,.5) !important;
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  border: 1px solid rgba(180,195,240,.22);
  box-shadow: 0 10px 40px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.06);
  transform: translateZ(0);
}
/* 表单/控件玻璃化 v2 (仅半透明底, 不加 blur — blur 只留给主卡片, 避免切换卡顿)
   注: 银行页签框/时间页签框 走与图表区域同款样式(见 .cockpit-bank-tabs / .cockpit-controls), 不在此列表 */
.tab-panel input, .tab-panel select, .tab-panel textarea,
.tab-panel .liq-subtab,
.tab-panel .db-controls,
.tab-panel .db-filters, .tab-panel button:not(.logout-btn),
.tab-panel .flatpickr-input, .tab-panel .date-range-label,
.tab-panel .current-bank-display{
  background: rgba(44,46,56,.55) !important;
  border-color: rgba(180,195,240,.18);
}
.tab-panel button:hover:not(.logout-btn):not(:disabled){
  background: rgba(70,80,120,.5) !important;
}
/* 表格半透明底(不 blur) */
.tab-panel table{
  background: rgba(30,32,40,.42) !important;
}

/* 图表加载遮罩 (切换银行/日期即时反馈) */
.chart-wrapper{position:relative;}
.chart-loading-mask{
  position:absolute; inset:0; z-index:5; display:flex; align-items:center; justify-content:center;
  background:rgba(20,22,28,.42); backdrop-filter:blur(3px); border-radius:10px;
}
.cl-spinner{width:34px;height:34px;border:3px solid rgba(107,138,255,.3);border-top-color:#6b8aff;border-radius:50%;animation:clspin .8s linear infinite;}
@keyframes clspin{to{transform:rotate(360deg);}}
/* tab 切换淡入 */
.tab-panel{animation:cpFade .22s ease-out;}
@keyframes cpFade{from{opacity:.35; transform:translateY(4px);} to{opacity:1; transform:none;}}

/* ═══════════════════════════════════════════════
   装饰件 v1 (2026-09-10) — 手法参考 DataV(MIT) 的边框/装饰组件
   全部纯 CSS: 不新增 DOM、零 JS、零动画 → 无持续重绘开销(不碰性能)
   ═══════════════════════════════════════════════ */
/* 1) 标题下渐变装饰线 + 橙色菱形尖角 */
.tab-header h3{position:relative;padding-bottom:.5rem;}
.tab-header h3::after{content:'';position:absolute;left:0;bottom:0;width:132px;height:2px;
  background:linear-gradient(90deg,#4d6bfe,#8fa6ff 55%,rgba(255,140,26,.9) 88%,rgba(255,140,26,0));}
.tab-header h3::before{content:'';position:absolute;left:136px;bottom:-2px;width:6px;height:6px;
  background:#ff8c1a;transform:rotate(45deg);box-shadow:0 0 7px rgba(255,140,26,.85);}

/* 2) 四角 L 形描边 (DataV border-box 风格): 8 层背景渐变画 4 个角, 不占 DOM */
.chart-wrapper,.credit-panel,.inv-chart-card,.inv-table-card,.liq-chart-card,.hk-card{position:relative;}
.chart-wrapper::after,.credit-panel::after,.inv-chart-card::after,.inv-table-card::after,
.liq-chart-card::after,.hk-card::after{
  content:'';position:absolute;inset:0;z-index:1;pointer-events:none;border-radius:inherit;opacity:.8;
  background-image:
    linear-gradient(90deg,#4d6bfe,rgba(107,138,255,.25)),linear-gradient(180deg,#4d6bfe,rgba(107,138,255,.25)),
    linear-gradient(270deg,#4d6bfe,rgba(107,138,255,.25)),linear-gradient(180deg,#4d6bfe,rgba(107,138,255,.25)),
    linear-gradient(90deg,rgba(255,140,26,.95),rgba(255,140,26,.2)),linear-gradient(0deg,rgba(255,140,26,.95),rgba(255,140,26,.2)),
    linear-gradient(270deg,rgba(255,140,26,.95),rgba(255,140,26,.2)),linear-gradient(0deg,rgba(255,140,26,.95),rgba(255,140,26,.2));
  background-size:18px 2px,2px 18px,18px 2px,2px 18px,18px 2px,2px 18px,18px 2px,2px 18px;
  background-position:left top,left top,right top,right top,left bottom,left bottom,right bottom,right bottom;
  background-repeat:no-repeat;
}

/* ══════════════════════════════════════════════════════════════════════════
   流动性预测 · 表格排版优化 v1  (2026-09-14)
   ① 数字右对齐 + 等宽数字（三张明细表统一, 原来居中位数对不齐）
   ② 冻结列: 左「月份+口径」常驻 / 右「可用资金」常驻（横滚不丢上下文）
   ③ 月份合并两行 + 月份分组分隔线 + 口径彩色小标签
   ④ 列头 ✕ 默认隐形, 悬停才显形（absolute 不再占列宽）
   ══════════════════════════════════════════════════════════════════════════ */

/* ① 右对齐 + 等宽数字 */
#tab-liquidity .liq-cf-table th.num, #tab-liquidity .liq-notes-table th.num,
#tab-liquidity .liq-ratio-table th.num,
#tab-liquidity .liq-cf-table td.num, #tab-liquidity .liq-notes-table td.num,
#tab-liquidity .liq-ratio-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* 折叠表的文字列表头改为左对齐, 与左对齐的数据成列（原来表头居中/数据靠左, 看着错位） */
#tab-liquidity .liq-notes-table th:not(.num),
#tab-liquidity .liq-ratio-table th:not(.num) { text-align: left; }

/* ② 冻结列 — 左侧 月份 / 口径 */
#tab-liquidity .liq-cf-table th[data-col="__m"], #tab-liquidity .liq-cf-table td[data-col="__m"],
#tab-liquidity .liq-cf-table th[data-col="__r"], #tab-liquidity .liq-cf-table td[data-col="__r"] {
  position: sticky;
  z-index: 3;
  background: #212124;                 /* 卡片底色: sticky 单元格必须不透明 */
}
#tab-liquidity .liq-cf-table th[data-col="__m"], #tab-liquidity .liq-cf-table td[data-col="__m"] { left: 0; }
#tab-liquidity .liq-cf-table th[data-col="__r"], #tab-liquidity .liq-cf-table td[data-col="__r"] {
  left: 3.9rem;                        /* JS applySticky() 按实测宽度精修 */
  box-shadow: 5px 0 8px -5px rgba(0,0,0,0.75);
}
#tab-liquidity .liq-cf-table th[data-col="__m"], #tab-liquidity .liq-cf-table th[data-col="__r"] { z-index: 6; }
#tab-liquidity .liq-cf-table tr.liq-row-p td[data-col="__m"],
#tab-liquidity .liq-cf-table tr.liq-row-p td[data-col="__r"] { background: #25262f; }  /* 与 P行 5% 蓝底对齐 */

/* ② 冻结列 — 右侧 可用资金（关键列, 横滚到底也看得见） */
#tab-liquidity .liq-cf-table th[data-col="r_available"], #tab-liquidity .liq-cf-table td[data-col="r_available"] {
  position: sticky;
  right: 0;
  z-index: 4;
  background: #223333 !important;    /* !important: 压过 .liq-col-key 的半透明底, 否则下层内容会透出来 */
  box-shadow: -5px 0 8px -5px rgba(0,0,0,0.75);
}
#tab-liquidity .liq-cf-table th[data-col="r_available"] { z-index: 7; background: #1d3335 !important; }
#tab-liquidity .liq-cf-table tr.liq-row-p td[data-col="r_available"] { background: #233a3a !important; }

/* ③ 月份合并单元格 + 分组分隔线 + 口径标签 */
#tab-liquidity .liq-cf-table td.liq-month-cell {
  vertical-align: middle;
  text-align: center;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.02em;
}
#tab-liquidity .liq-cf-table tr.liq-mrow-start td { border-top: 1px solid rgba(148,163,184,0.22); }
#tab-liquidity .liq-cf-table tr.liq-mrow-start:first-child td { border-top: none; }
#tab-liquidity .liq-scope {
  display: inline-block;
  padding: 0.02rem 0.34rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
}
#tab-liquidity .liq-scope.p { color: #8fa6ff; background: rgba(107,138,255,0.16); }
#tab-liquidity .liq-scope.a { color: #fb923c; background: rgba(251,146,60,0.14); }

/* ④ 列头 ✕ 按钮: 默认隐形 + 不占列宽（悬停给个底色, 不与列头文字打架） */
#tab-liquidity .liq-col-hide {
  position: absolute;
  right: 0.18rem;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 0;
  padding: 0 0.15rem;
  border-radius: 3px;
  background: rgba(20,20,24,0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
#tab-liquidity .liq-cf-table th:hover .liq-col-hide { opacity: 0.9; pointer-events: auto; }


/* ═══════════════════════════════════════════════════
   数据库 Tab — 底色统一 + 去多余框线 v2 (2026-09-20)
   ① 底色 5 档并存: 控件行(39,41,51) / 上传区(30,31,38 · 30,30,34) / 卡片(28,28,30) / 表头(25,26,31)
   ② 框线过多: Pico 默认给每个 th/td 加 1px 底线, 表头另有 3px 线; 上传区 details(外框)+summary(内框) 套框
   ③ 关键坑: 表格容器是 <div id="db-result"> (无 class!) — 原 CSS 中的 `.db-result table th/td`
      规则从未匹配 → Pico 默认格线全露 + 单元格丢失 nowrap(表头撑到 149px 高)
   做法: 统一 surface token; 只留「卡片外框 1 条 + 表头 1 条细线」; 行分隔改用斑马纹; 选择器 #db-result/.db-result 双匹配
   ═══════════════════════════════════════════════════ */
#tab-db{
  --db-surface: rgba(30,32,40,.72);
  --db-surface-solid: #1e2028;          /* 表头 sticky 需不透明 */
  --db-line: rgba(180,195,240,.16);
  --db-radius: 10px;                    /* 与流动性/库存卡片圆角(10-12px)对齐 */
}
/* ① 底色统一: 面板 + 卡片 + 上传区 + 表格容器 同一个 surface */
#tab-db .db-filters-panel,
#tab-db .db-summary,
#tab-db .db-upload-details,
#tab-db .db-upload-summary,
#tab-db #db-result,
#tab-db .db-result{
  background: var(--db-surface) !important;
  border-color: var(--db-line) !important;
  border-radius: var(--db-radius) !important;
}
/* 控件行不再整条铺一块浅色板, 只有控件本身有色(与其它 Tab 一致) */
#tab-db .db-controls{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
/* ② 去框线: 干掉 Pico 的逐格格线, 表头只留 1 条细线 */
#tab-db #db-result table th, #tab-db .db-result table th,
#tab-db #db-result table td, #tab-db .db-result table td{
  border: 0 !important;
  background: transparent !important;
}
#tab-db #db-result table thead th, #tab-db .db-result table thead th{
  background: var(--db-surface-solid) !important;   /* sticky 表头不透明 */
  border-bottom: 1px solid var(--db-line) !important;
  box-shadow: none !important;
}
#tab-db #db-result table tbody tr:nth-child(even) td,
#tab-db .db-result table tbody tr:nth-child(even) td{
  background: rgba(255,255,255,.022) !important;    /* 行分隔用斑马纹替代格线 */
}
#tab-db #db-result table tbody tr:hover td,
#tab-db .db-result table tbody tr:hover td{
  background: rgba(107,138,255,.10) !important;
}
/* 表格卡片: 只保留一层外框, 行数条不再画第二条线 */
#tab-db #db-result, #tab-db .db-result{ border: 1px solid var(--db-line) !important; overflow-x: auto !important; }
#tab-db #db-result .row-count, #tab-db .db-result .row-count{
  border-bottom: 0 !important; background: transparent !important;
}
/* 补回原本从未生效的那组表格规则 (原选择器 .db-result 与本页 DOM 不匹配) */
#tab-db #db-result table, #tab-db .db-result table{
  width: 100%; margin: 0; font-size: .85rem; table-layout: auto; border-collapse: collapse;
}
#tab-db #db-result table thead th, #tab-db .db-result table thead th{
  position: sticky; top: 0; z-index: 1; cursor: pointer; user-select: none;
  white-space: nowrap; padding: .5rem .75rem;
}
#tab-db #db-result table tbody td, #tab-db .db-result table tbody td{
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; padding: .4rem .75rem;
}
/* 上传区: 去掉 details 外框, 只留 summary 一层框 */
#tab-db .db-upload-details{ border: 0 !important; padding: 0 !important; }
#tab-db .db-upload-summary{
  border: 1px solid var(--db-line) !important;
  border-radius: var(--db-radius) !important;
  padding: .55rem .9rem !important;
}
#tab-db .db-upload-inner{ padding: .8rem .9rem !important; }
/* 筛选面板内分隔线统一细线 */
#tab-db .db-filters-header{ border-bottom: 1px solid var(--db-line) !important; }
/* 分页按钮圆角/描边对齐 */
#tab-db .page-btn{ border-radius: 6px !important; border: 1px solid var(--db-line) !important; }
#tab-db .page-btn.active{
  background: rgba(107,138,255,.22) !important;
  border-color: rgba(107,138,255,.55) !important;
  color: #fff !important;
}
/* 表格本体不再自带底色(全局 .tab-panel table 是 .42), 让它与卡片同一个 surface */
#tab-db #db-result table, #tab-db .db-result table{ background: transparent !important; }
