/* 公共样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 0.9rem; /* 基础字体大小，适配移动端 */
}

.container {
    padding: 20px;
    flex: 1;
    box-sizing: border-box;
    margin-bottom: 60px; /* 预留底部导航栏高度 */
}

.form-group {
    margin-bottom: 15px;
}

.table {
    background-color: white;
    margin-top: 20px;
    border-collapse: collapse; /* 表格边框合并 */
}

.date-picker {
    margin-bottom: 15px;
}

/* 底部导航栏样式 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    z-index: 999;
    transition: transform 0.3s ease;
    border-top: 1px solid #e9ecef; /* 顶部边框分隔线 */
}

.bottom-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px; /* 导航文字大小 */
    color: #6c757d;
    text-decoration: none;
    padding: 5px 10px;
    transition: color 0.3s ease;
    min-width: 60px; /* 防止导航项挤压 */
}

.bottom-nav .nav-link.active {
    color: #0d6efd;
}

.bottom-nav .nav-link i {
    font-size: 20px;
    margin-bottom: 5px;
}

.bottom-nav .nav-link:hover {
    color: #0d6efd;
}

/* 表格容器样式 */
.table-container {
    overflow-x: auto; /* 强制横向滚动 */
    max-width: 100%;
    margin: 0 -20px; /* 抵消container内边距 */
    padding: 0 20px; /* 保持内容内边距 */
    border-radius: 8px; /* 容器圆角 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); /* 轻阴影 */
}

.table-container table {
    min-width: 800px; /* 表格最小宽度，确保滚动 */
    margin-top: 0;
    table-layout: auto; /* 关键：自动调整列宽 */
}

/* 表格字体与边框 */
.table th,
.table td {
    padding: 8px 12px;
    text-align: left;
    vertical-align: middle;
    border: 1px solid #e9ecef; /* 表格边框 */
    white-space: nowrap; /* 不换行 */
    overflow: hidden; /* 超出部分隐藏 */
    text-overflow: ellipsis; /* 超出部分显示省略号 */
    max-width: 150px; /* 最大宽度限制 */
}

.table thead th {
    background-color: #f8f9fa; /* 表头背景色 */
    font-weight: 500; /* 表头半粗体 */
    position: sticky; /* 表头固定 */
    top: 0;
    z-index: 1;
}

/* 表格列宽优化 */
.table th:nth-child(1), /* 门店名称 */
.table th:nth-child(2), /* 用户名称 */
.table th:nth-child(3), /* 奖励 */
.table th:nth-child(5) { /* 日期 */
    width: 15%; /* 占比15% */
}

.table th:nth-child(4), /* 排名 */
.table th:nth-child(7) { /* 毛利 */
    width: 8%; /* 占比8% */
}

.table th:nth-child(6) { /* 实收金额 */
    width: 14%; /* 占比14% */
}

/* 移动端字体优化 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin-bottom: 56px;
    }

    .table th,
    .table td {
        font-size: 0.8rem; /* 12.8px */
        padding: 6px 8px;
        max-width: 100px; /* 移动端更紧凑 */
    }

    .bottom-nav {
        padding: 8px 0;
    }

    .bottom-nav .nav-link {
        font-size: 10px;
        padding: 5px 8px;
        min-width: 50px;
    }

    .bottom-nav .nav-link i {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .table th,
    .table td {
        font-size: 0.75rem; /* 12px */
    }


}

/* 滚动条样式（Webkit内核） */
.table-container::-webkit-scrollbar {
    height: 6px; /* 滚动条高度 */
}

.table-container::-webkit-scrollbar-track {
    background-color: #f0f0f0; /* 轨道颜色 */
}

.table-container::-webkit-scrollbar-thumb {
    background-color: #d0d0d0; /* 滑块颜色 */
    border-radius: 3px; /* 滑块圆角 */
}

/* 防止键盘弹出时导航栏被顶起 */
body.keyboard-open .bottom-nav {
    transform: translateY(100%);
}