/* 成员管理页面样式 */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    margin-bottom: 20px;
    padding: 20px;
}

.header-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.header-section h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.5rem;
    font-weight: 600;
}

.subtitle {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 统计面板样式 */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.total {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.stat-icon.members {
    background: linear-gradient(135deg, #11998e, #38ef7d);
}

.stat-icon.admins {
    background: linear-gradient(135deg, #ffecd2, #fcb69f);
}

.stat-icon.super-admins {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: #718096;
    font-size: 0.9rem;
}

/* 操作面板样式 */
.action-panel {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1.5rem;
    align-items: center;
}

.search-section {
    display: flex;
    gap: 0.5rem;
}

.search-box {
    position: relative;
    flex: 1;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.filter-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-section label {
    color: #4a5568;
    font-weight: 500;
    white-space: nowrap;
}

.filter-section select {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #4a5568;
    font-size: 0.9rem;
    min-width: 120px;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* 按钮样式 */
.btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-success {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
}

.btn-success:hover {
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-info:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #feca57, #ff9ff3);
    color: #2d3748;
}

.btn-warning:hover {
    box-shadow: 0 4px 15px rgba(254, 202, 87, 0.4);
}

/* 成员列表样式 */
.members-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.table-header {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.table-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.25rem;
}

.table-container {
    overflow-x: auto;
}

.members-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.members-table th,
.members-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.members-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
    position: sticky;
    top: 0;
}

.members-table td {
    color: #2d3748;
    font-weight: 500;
}

.passed-levels {
    color: #2d3748;
    font-size: 0.9rem;
    line-height: 1.4;
}

.members-table tr:hover {
    background: #f7fafc;
}

/* 权限标签样式 */
.role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    display: inline-block;
}

.role-badge.user {
    background: #e0f7fa;
    color: #004d40;
    font-weight: 600;
}

.role-badge.admin {
    background: #fff8e1;
    color: #d84315;
    font-weight: 600;
}

.role-badge.super_admin {
    background: #fce4ec;
    color: #880e4f;
    font-weight: 600;
}

/* 进度条样式 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #11998e, #38ef7d);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.8rem;
    color: #718096;
}

/* 操作按钮样式 */
.action-btn {
    padding: 0.5rem;
    margin: 0 0.2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    transform: translateY(-1px);
}

.action-btn.view {
    background: #e6f3ff;
    color: #0052a3;
    font-weight: 600;
}

.action-btn.edit {
    background: #fff3e0;
    color: #d84315;
    font-weight: 600;
}

.action-btn.delete {
    background: #ffebee;
    color: #c62828;
    font-weight: 600;
}

.action-btn.view:hover {
    background: #cce7ff;
    color: #003d7a;
}

.action-btn.edit:hover {
    background: #ffe0b2;
    color: #bf360c;
}

.action-btn.delete:hover {
    background: #ffcdd2;
    color: #b71c1c;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    gap: 0.5rem;
}

.pagination button {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    background: white;
    color: #4a5568;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover {
    background: #f7fafc;
}

.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 8% auto;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-content.large {
    max-width: 800px;
}

.modal-content.small {
    max-width: 400px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #2d3748;
}

.close {
    color: #a0aec0;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: #4a5568;
}

.modal-body {
    padding: 1.5rem;
    color: #2d3748;
}

.modal-body p {
    color: #2d3748;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

/* 删除确认消息特殊样式 */
#deleteMessage {
    color: #1a202c !important;
    font-weight: 500;
    text-align: center;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #4a5568;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #718096;
    line-height: 1.4;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-container {
        padding: 0 1rem;
        max-width: 100%;
    }
    
    /* 头部区域 */
    .header-section {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
        text-align: center;
    }
    
    .header-section h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    /* 统计面板 */
    .stats-container {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .stat-card {
        padding: 1rem;
        text-align: center;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    /* 操作面板 */
    .action-panel {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    /* 搜索区域 */
    .search-section {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .search-input {
        width: 100%;
        padding: 0.8rem 1rem;
        font-size: 16px; /* 防止iOS缩放 */
        min-height: 44px;
        border-radius: 8px;
    }
    
    /* 操作按钮 */
    .action-buttons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .action-buttons .btn {
        flex: 1;
        min-width: 120px;
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        min-height: 44px;
        text-align: center;
    }
    
    /* 表格容器 */
    .table-container {
        margin: 0 -0.5rem;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .members-table {
        min-width: 700px;
        font-size: 0.8rem;
    }
    
    .members-table th,
    .members-table td {
        padding: 0.6rem 0.4rem;
        white-space: nowrap;
    }
    
    .members-table th {
        font-size: 0.75rem;
    }
    
    /* 成员卡片视图（替代表格） */
    .members-card-view {
        display: block;
    }
    
    .member-card {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        padding: 1rem;
        margin-bottom: 1rem;
        transition: all 0.3s ease;
    }
    
    .member-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .member-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.8rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .member-name {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-primary);
    }
    
    .member-role {
        padding: 0.25rem 0.5rem;
        border-radius: 12px;
        font-size: 0.7rem;
        font-weight: 500;
    }
    
    .member-card-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .member-info-item {
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
    }
    
    .member-info-label {
        font-size: 0.7rem;
        color: var(--text-secondary);
        font-weight: 500;
    }
    
    .member-info-value {
        font-size: 0.9rem;
        color: var(--text-primary);
    }
    
    .member-card-actions {
        display: flex;
        gap: 0.5rem;
        justify-content: flex-end;
        flex-wrap: wrap;
    }
    
    .member-card-actions .btn {
        flex: 1;
        min-width: 80px;
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        text-align: center;
    }
    
    /* 分页 */
    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
        justify-content: center;
        padding: 1rem 0;
    }
    
    .pagination button {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-width: 40px;
        min-height: 40px;
    }
    
    /* 模态框 */
    .modal-content {
        width: 95%;
        margin: 1rem;
        padding: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer button {
        width: 100%;
        min-height: 44px;
        padding: 0.8rem 1rem;
    }
    
    /* 表单优化 */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
        font-weight: 500;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 0.8rem;
        font-size: 16px;
        min-height: 44px;
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.05);
        color: var(--text-primary);
    }
    
    .form-group textarea {
        min-height: 100px;
        resize: vertical;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 0 0.5rem;
    }
    
    .header-section {
        padding: 1rem 0.8rem;
        margin-bottom: 1rem;
    }
    
    .header-section h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    /* 统计卡片 */
    .stats-container {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .stat-card {
        padding: 0.8rem;
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    /* 操作面板 */
    .action-panel {
        padding: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .search-input {
        padding: 0.6rem 0.8rem;
        font-size: 16px;
    }
    
    .action-buttons .btn {
        min-width: 100px;
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
    
    /* 成员卡片 */
    .member-card {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
    }
    
    .member-name {
        font-size: 1rem;
    }
    
    .member-role {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    .member-card-body {
        gap: 0.6rem;
    }
    
    .member-info-label {
        font-size: 0.65rem;
    }
    
    .member-info-value {
        font-size: 0.8rem;
    }
    
    .member-card-actions .btn {
        min-width: 70px;
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
    }
    
    /* 表格进一步压缩 */
    .members-table {
        min-width: 600px;
        font-size: 0.7rem;
    }
    
    .members-table th,
    .members-table td {
        padding: 0.4rem 0.3rem;
    }
    
    /* 分页 */
    .pagination button {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
        min-width: 36px;
        min-height: 36px;
    }
    
    /* 模态框 */
    .modal {
        padding: 0.5rem;
    }
    
    .modal-content {
        width: calc(100% - 1rem);
        margin: 0.5rem;
        padding: 0.8rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.8rem;
    }
    
    .modal-footer button {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
    
    /* 表单 */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.6rem;
        font-size: 16px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .header-section h1 {
        font-size: 1.3rem;
    }
    
    .stats-container {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .member-card-body {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .member-card-actions {
        flex-direction: column;
    }
    
    .member-card-actions .btn {
        min-width: auto;
    }
    
    .pagination button {
        padding: 0.3rem 0.5rem;
        font-size: 0.65rem;
        min-width: 32px;
        min-height: 32px;
    }
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: #718096;
}

.loading i {
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #718096;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
    font-size: 1.1rem;
}

/* 成员详情样式 */
.member-detail {
    color: #2d3748;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section h4 {
    color: #2d3748;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    font-size: 1.1rem;
    font-weight: 600;
}

.detail-section h4 i {
    color: #667eea;
    margin-right: 0.5rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.detail-item label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.detail-item span {
    color: #2d3748;
    font-size: 1rem;
    font-weight: 500;
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge.user {
    background: #e6fffa;
    color: #00695c;
}

.role-badge.admin {
    background: #fff3e0;
    color: #e65100;
}

.role-badge.super_admin {
    background: #f3e5f5;
    color: #6a1b9a;
}

.level-progress {
    color: #2d3748;
}

.level-progress p {
    margin-bottom: 1rem;
    font-weight: 600;
    color: #4a5568;
}

.passed-levels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.level-tag {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
}

.prizes-list {
    color: #2d3748;
}

.prize-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    align-items: center;
}

.prize-name {
    font-weight: 600;
    color: #2d3748;
}

.prize-code {
    font-family: monospace;
    background: #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: #4a5568;
    font-size: 0.9rem;
}

.prize-date {
    color: #718096;
    font-size: 0.9rem;
}

.prize-status {
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.prize-status.redeemed {
    background: #c6f6d5;
    color: #22543d;
}

.prize-status.pending {
    background: #fed7d7;
    color: #742a2a;
}

.no-data {
    color: #718096;
    font-style: italic;
    text-align: center;
    padding: 2rem;
    background: #f7fafc;
    border-radius: 8px;
}

.user-id {
    font-family: monospace;
    background: #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: #4a5568 !important;
    font-size: 0.9rem;
}

.other-info {
    color: #2d3748;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .prize-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }
}