/**
 * 币种汇总区域高度修复
 * 调整高度支持4行币种显示，平均分配高度
 */

/* 币种汇总容器 - 调整为90px高度，支持四行币种显示 */
#currencySummary,
#currencySummary.currency-summary,
.currency-summary {
    min-height: 90px !important; /* 增加到90px，支持四行币种 */
    max-height: 90px !important; /* 固定高度90px */
    height: 90px !important; /* 强制固定高度90px */
    padding: 3px !important; /* 增加内边距，让字体离边框有距离 */
    margin-top: 6px !important; /* 保持上边距 */
    overflow: hidden !important; /* 隐藏溢出内容 */
    box-sizing: border-box !important;
}

/* 币种汇总内容区域 - 垂直布局 */
#currencySummary .d-flex,
.currency-summary .d-flex {
    display: flex !important;
    flex-direction: column !important; /* 垂直排列 */
    align-items: flex-end !important; /* 靠右对齐 */
    width: 100% !important;
    height: 84px !important; /* 减去上下内边距：90px - 6px = 84px */
    gap: 0px !important; /* 无行间距，紧密排列 */
    overflow: hidden !important; /* 确保不超出容器 */
}

/* 币种项 - 平均分配高度为21px */
#currencySummary .currency-item,
.currency-summary .currency-item {
    padding: 0px 8px !important; /* 增加左右内边距，让字体离边框有距离 */
    box-sizing: border-box !important;
    text-align: right !important;
    height: 21px !important; /* 重新计算：84px / 4 = 21px */
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important; /* 靠右对齐 */
}

/* 币种值 - 进一步增大字体大小 */
#currencySummary .currency-value,
.currency-summary .currency-value {
    font-size: 1rem !important; /* 进一步增大字体到1rem */
    font-weight: 600 !important;
    line-height: 1 !important; /* 保持行高 */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 账户表格容器 - 增加最大高度40px */
.account-table-container > div {
    max-height: calc(100vh - 240px) !important; /* 从280px减少到240px，增加40px高度 */
    overflow-y: auto !important;
}

/* 确保在小屏幕上也能正常显示 */
@media (max-width: 350px) {
    #currencySummary,
    .currency-summary {
        min-height: 80px !important; /* 小屏幕适当减小高度 */
        max-height: 80px !important; 
        height: 80px !important; 
        padding: 2px !important; /* 小屏幕减小内边距 */
    }
    
    #currencySummary .d-flex,
    .currency-summary .d-flex {
        height: 76px !important; /* 80px - 4px内边距 = 76px */
    }
    
    #currencySummary .currency-item,
    .currency-summary .currency-item {
        height: 19px !important; /* 小屏幕币种项高度：76px / 4 = 19px */
        padding: 0px 6px !important; /* 小屏幕减小左右内边距 */
    }
    
    #currencySummary .currency-value,
    .currency-summary .currency-value {
        font-size: 0.9rem !important; /* 小屏幕适当减小字体 */
    }
}

/* 覆盖其他可能冲突的样式 */
body #leftSidebar #currencySummary,
body #leftSidebar .currency-summary,
body .card-body #currencySummary,
body .card-body .currency-summary {
    min-height: 90px !important; /* 固定高度90px */
    max-height: 90px !important; 
    height: 90px !important; 
    padding: 3px !important; /* 保持内边距 */
}

/* 移除账户表格下方的空白区域 */
.account-table-container > div {
    height: auto !important;
    min-height: auto !important;
}

/* 完全移除空行 */
.account-table tbody tr.empty-row,
.account-table tbody tr:empty,
.account-table tbody tr:not([data-account-id]):not(.currency-summary-row):not(.currency-summary-separator):not(:first-child):not(:nth-child(2)):not(:nth-child(3)):not(:nth-child(4)) {
    display: none !important;
    height: 0 !important;
    visibility: hidden !important;
    position: absolute !important;
    opacity: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 确保只有实际数据行可见 */
.account-table tbody tr:not(.currency-summary-row):not(.currency-summary-separator) {
    height: auto !important;
}

/* 确保表格容器完全贴合内容高度 */
#leftSidebar .table-responsive {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    border-bottom: none !important; /* 移除底部边框 */
}

/* 确保左侧边栏高度与右侧内容区域匹配 */
#leftSidebar {
    height: auto !important;
    min-height: calc(100vh - 150px) !important; /* 设置最小高度 */
}

#leftSidebar .card {
    height: auto !important;
    min-height: calc(100vh - 160px) !important; /* 设置最小高度 */
}

/* 移除所有额外的表格行 */
.account-table tbody tr:not(:has(td:first-child:not(:empty))) {
    display: none !important;
}

/* 处理表格底部边框 */
#leftSidebar .table-responsive::after {
    content: '';
    display: block;
    height: 1px;
    background-color: #dee2e6;
    margin-top: -1px;
    position: relative;
}

/* 移除底部多余空白区域 */
#leftSidebar .table-responsive .account-table tbody::after {
    display: none !important;
} 