/* 后台管理样式 */

.admin-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* 后台头部 */
.admin-header {
    background: linear-gradient(135deg, #343a40 0%, #495057 100%);
    color: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-logo i {
    font-size: 2rem;
    color: #4dabf7;
}

.admin-logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.admin-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 15px;
}

.admin-nav {
    display: flex;
    gap: 15px;
}

.nav-link {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* 主内容区域 */
.admin-main {
    display: flex;
    min-height: calc(100vh - 80px);
    padding: 20px;
    gap: 20px;
}

/* 侧边栏 */
.admin-sidebar {
    width: 250px;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-item {
    background: transparent;
    border: none;
    color: #495057;
    padding: 15px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.menu-item:hover {
    background: #f8f9fa;
    color: #1971c2;
}

.menu-item.active {
    background: #e7f5ff;
    color: #1971c2;
    box-shadow: 0 2px 8px rgba(25, 113, 194, 0.2);
}

.menu-item i {
    font-size: 1.2rem;
    width: 24px;
}

.stats-summary {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1971c2;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
}

/* 内容区域 */
.admin-content {
    flex: 1;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* 部分头部 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #343a40;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #4dabf7;
    box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.2);
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #4dabf7 0%, #1971c2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #339af0 0%, #1864ab 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 113, 194, 0.3);
}

.btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.btn-secondary:hover {
    background: #dee2e6;
    transform: translateY(-2px);
}

.btn-danger {
    background: #fa5252;
    color: white;
}

.btn-danger:hover {
    background: #e03131;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(250, 82, 82, 0.3);
}

/* 会员表格 */
.members-table-container {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.members-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.members-table thead {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.members-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.members-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.members-table tbody tr {
    transition: background-color 0.2s ease;
}

.members-table tbody tr:hover {
    background-color: #f8f9fa;
}

.loading-cell {
    text-align: center;
    padding: 40px !important;
    color: #6c757d;
}

.loading-cell i {
    margin-right: 10px;
}

/* 性别标签 */
.gender-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.gender-male {
    background: #e3f2fd;
    color: #1976d2;
}

.gender-female {
    background: #fce4ec;
    color: #c2185b;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.action-btn.edit {
    background: #e7f5ff;
    color: #1971c2;
}

.action-btn.edit:hover {
    background: #d0ebff;
    transform: scale(1.1);
}

.action-btn.delete {
    background: #ffe3e3;
    color: #fa5252;
}

.action-btn.delete:hover {
    background: #ffc9c9;
    transform: scale(1.1);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.stat-icon.male {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
}

.stat-icon.age {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #f57c00;
}

.stat-icon.income {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #388e3c;
}

.stat-icon.location {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    color: #7b1fa2;
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 15px;
}

/* 图表容器 */
.gender-chart,
.age-distribution,
.income-stats,
.location-stats {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-style: italic;
}

/* 设置表单 */
.settings-form {
    max-width: 600px;
    margin-top: 20px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.form-group label i {
    color: #4dabf7;
    width: 20px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #4dabf7;
    box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.2);
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #6c757d;
}

.input-with-unit {
    position: relative;
}

.input-with-unit .unit {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* 编辑模态框 */
.edit-modal {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 25px 30px 15px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #343a40;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .admin-main {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .sidebar-menu {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .stats-summary {
        flex-direction: row;
        width: auto;
    }
    
    .stat-item {
        min-width: 100px;
    }
}

@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .section-actions {
        width: 100%;
    }
    
    .search-box {
        flex: 1;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .admin-sidebar {
        flex-direction: column;
    }
    
    .stats-summary {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        width: 32px;
        height: 32px;
    }
}