* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* 登录页面的body样式 */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.btn {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #0069d9;
}

/* 导航栏样式 */
.navbar {
    background-color: #343a40;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar h1 {
    margin: 0;
    font-size: 20px;
}

.navbar .user-info {
    display: flex;
    align-items: center;
}

.navbar .user-info span {
    margin-right: 15px;
}

.navbar .logout-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* 侧边栏样式 */
.sidebar {
    width: 200px;
    background-color: #f8f9fa;
    height: calc(100vh - 60px);
    position: fixed;
    left: 0;
    top: 60px;
    border-right: 1px solid #dee2e6;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar li {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
}

.sidebar li a {
    text-decoration: none;
    color: #333;
    display: block;
    transition: background-color 0.3s;
}

.sidebar li a:hover {
    background-color: #e9ecef;
}

.sidebar li.active {
    background-color: #e9ecef;
    border-left: 4px solid #007bff;
}

/* 主内容区域样式 */
.main-content {
    margin-left: 200px;
    padding: 20px;
    min-height: calc(100vh - 60px);
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card h2 {
    margin-bottom: 20px;
    color: #333;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

table tr:hover {
    background-color: #f8f9fa;
}

/* 按钮样式 */
.btn-sm {
    padding: 5px 10px;
    font-size: 14px;
}

.btn-primary {
    background-color: #007bff;
}

.btn-success {
    background-color: #28a745;
}

.btn-danger {
    background-color: #dc3545;
}

.main-content table .btn {
    width: auto;
}

/* 搜索框样式 */
.search-box {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.search-box input {
    flex: 4;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
    min-width: 400px;
}

.search-box input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.search-box button {
    flex: 1;
    padding: 12px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    max-width: 120px;
}

.search-box button:hover {
    background-color: #0069d9;
}

.search-box button:active {
    background-color: #005cbf;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination button {
    padding: 5px 10px;
    margin: 0 5px;
    border: 1px solid #dee2e6;
    background-color: white;
    cursor: pointer;
}

.pagination button.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* 统计卡片样式 */
.stats-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    flex: 1;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
}

.stat-card h3 {
    margin-bottom: 10px;
    color: #6c757d;
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
}

/* 仅主管理员可见的侧栏入口 */
.sidebar .nav-sub-admin-only {
    display: none;
}

body.admin-main .sidebar .nav-sub-admin-only {
    display: list-item;
}

/* 子管理员侧栏仅显示：邀请码、累计拉新 */
body.sub-admin-role .sidebar .nav-main-only,
body.sub-admin-role .sidebar .nav-sub-admin-only {
    display: none !important;
}

body.sub-admin-role .sidebar .nav-sub-core {
    display: list-item !important;
}

.referral-summary-table .referral-detail-cell {
    background: #f8f9fa;
    padding: 12px 16px;
    vertical-align: top;
}

.referral-summary-table .referral-detail-inner {
    max-height: 360px;
    overflow: auto;
}

.referral-summary-table .referral-detail-inner table {
    margin: 0;
    background: #fff;
}