:root {
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --danger-color: #e74c3c;
  --warning-color: #f39c12;
  --text-color: #333;
  --bg-color: #f8f9fa;
  --border-radius: 8px;
  --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  --transition: all 0.3s ease;
}

/* 基础 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--text-color); background-color: var(--bg-color); line-height: 1.6; }

/* 统一卡片容器 */
.section-compact {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  height: 375px;   /* 新增这一行，调整你想要的高度 */

}

/* ========== 三块区域：内部滚动 + 表头吸顶 ========== */
/* 账户管理单独高度 */
#accountsBox .section-content {
  max-height: 240px;       /* 👉 固定 240px */
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;      /* 让 sticky 生效 */
}

/* 债务与还款、还款记录 默认高度 */
#repayBox .section-content,
#logsBox .section-content {
  max-height: 120px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

/* 表头吸顶 */
#accountsBox thead,
#repayBox thead,
#logsBox thead {
  position: sticky;
  top: 0;
  background: #f9fafb;
  z-index: 10;
}

/* 响应式高度调整 */
@media (min-width: 640px) {
  #accountsBox .section-content { max-height: 300px; }   /* 小屏时账户 300px */
  #repayBox .section-content,
  #logsBox .section-content { max-height: 380px; }
}
@media (min-width: 1024px) {
  #accountsBox .section-content { max-height: 360px; }   /* 中屏账户 360px */
  #repayBox .section-content,
  #logsBox .section-content { max-height: 480px; }
}
@media (min-width: 1536px) {
  #accountsBox .section-content { max-height: 420px; }   /* 大屏账户 420px */
  #repayBox .section-content,
  #logsBox .section-content { max-height: 560px; }
}

/* 滚动条美化（可选） */
.section-content::-webkit-scrollbar { width: 8px; }
.section-content::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 8px; }
.section-content::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* 头部辅助 */
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid #eee; background: #fafafa;
}

/* 颜色辅助类（与模板一致） */
.text-brand { color: #4f46e5; } /* indigo-600 */
.bg-brand { background: #4f46e5; }

/* 弹窗层级，确保盖过吸顶表头 */
#acctModal, #metaModal { z-index: 50; }


/* 固定高度滚动容器（可用于分类树） */
.scroll-fixed { height: 520px; overflow-y: auto; padding-right: 8px; }

/* 表头吸顶 */
.sticky-head thead { position: sticky; top: 0; z-index: 10; background: #f9fafb; }

/* 表格数据视口（固定高 + 内部滚动） */
.table-viewport { height: 420px; overflow-y: auto; overflow-x: hidden; }