/**
 * 资金与积分（资金日志 / 积分日志 / 签到记录）页面样式
 *
 * 骨架、页头、筛选表单、统计卡片、分页、空态等通用样式复用
 * users.css 与 base.css，本文件只补充这三张日志表特有的部分：
 *   1. 4 列统计卡片栅格
 *   2. 金额 / 积分变动列的正负配色
 *   3. 类型标签、备注列截断、时间列不换行
 */

/* ---------- 统计卡片：本页为 4 张卡 ---------- */

.stat-grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* 统计卡片图标底色（与 users.css 的色彩语义保持一致） */
.stat-card .stat-icon.icon-blue {
    background: #e8f1ff;
}

.stat-card .stat-icon.icon-orange {
    background: #fff2e6;
}

.stat-card .stat-icon.icon-purple {
    background: #f1ecff;
}

/* ---------- 表格：日志表列数多于用户表，适当压缩内边距 ---------- */

.finance-table {
    min-width: 1180px;
}

.finance-table thead th {
    white-space: nowrap;
}

.finance-table tbody td {
    padding: 10px 12px;
    vertical-align: middle;
}

/* 记录序号列：窄列 + 等宽字体 */
.finance-table .col-id {
    width: 84px;
    font-family: Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--color-text-muted);
}

/* 数字列右对齐（表头与单元格共用 text-right） */
.finance-table th.text-right,
.finance-table td.text-right {
    text-align: right;
}

/* 时间列不换行，避免表格宽度抖动 */
.finance-table td.text-muted {
    white-space: nowrap;
}

/* ---------- 金额 / 积分变动的正负配色 ---------- */

/* 收入（余额 / 积分增加） */
.finance-table .amount-in {
    font-family: Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 600;
    color: #0f8a49;
    white-space: nowrap;
}

/* 支出（余额 / 积分减少） */
.finance-table .amount-out {
    font-family: Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 600;
    color: #d93939;
    white-space: nowrap;
}

/* 变动为 0 或空值：弱化展示 */
.finance-table .amount-neutral {
    font-family: Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* ---------- 变动类型 / 备注列 ---------- */

/* 类型标签：与 users.css 的 .badge 视觉一致，独立命名避免语义混淆 */
.type-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-family: Menlo, Consolas, monospace;
    color: var(--color-text-secondary);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

/* 备注列：超长截断，避免撑破表格 */
.finance-table .td-remark {
    max-width: 220px;
    color: var(--color-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- 筛选表单：三个页面共用，宽字段在窄屏自动回落 ---------- */

@media (max-width: 900px) {
    .stat-grid-4 {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 600px) {
    .stat-grid-4 {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .finance-table .td-remark {
        max-width: 140px;
    }
}
