/* 用户管理界面样式 */

.admin-users-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 页面标题 */
.page-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e5e9;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.page-description {
    font-size: 14px;
    color: #718096;
    margin: 0;
}

/* 搜索筛选区域 */
.search-filter-section {
    margin-bottom: 24px;
}

.filter-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.filter-header {
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.filter-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.filter-form {
    padding: 20px;
}

.form-row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 控制区域 */
.controls-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.controls-left {
    display: flex;
    gap: 12px;
}

.controls-right {
    display: flex;
    align-items: center;
}

.page-size-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-size-control label {
    font-size: 14px;
    color: #4a5568;
    font-weight: 500;
}

/* 表格容器 */
.users-table-container {
    margin-bottom: 24px;
}

.table-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.users-table th {
    background: #f8fafc;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
}

.users-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
}

.users-table tr:hover {
    background-color: #f8fafc;
}

.users-table tr.hover {
    background-color: #f1f5f9;
}

/* 表格列宽度 */
.checkbox-column {
    width: 60px;
}

.id-column {
    width: 80px;
}

.username-column {
    width: 120px;
}

.name-column {
    width: 120px;
}

.phone-column {
    width: 140px;
}

.role-column {
    width: 100px;
}

.permission-column {
    width: 120px;
}

.created-column {
    width: 160px;
}

.actions-column {
    width: 300px;
}

/* 自定义复选框 */
.checkbox-wrapper {
    position: relative;
    display: inline-block;
}

.custom-checkbox {
    opacity: 0;
    position: absolute;
    cursor: pointer;
}

.checkbox-wrapper label {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-checkbox:checked + label {
    background-color: #4299e1;
    border-color: #4299e1;
}

.custom-checkbox:checked + label::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox:disabled + label {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 徽章样式 */
.user-role-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    min-width: 80px;
}

.badge-super-admin {
    background-color: #667eea;
    color: white;
}

.badge-admin {
    background-color: #48bb78;
    color: white;
}

.badge-user {
    background-color: #ed8936;
    color: white;
}

.permission-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    min-width: 80px;
}

.badge-allowed {
    background-color: #48bb78;
    color: white;
}

.badge-denied {
    background-color: #e53e3e;
    color: white;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-form {
    display: inline;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-primary {
    background-color: #4299e1;
    color: white;
}

.btn-primary:hover {
    background-color: #3182ce;
}

.btn-success {
    background-color: #48bb78;
    color: white;
}

.btn-success:hover {
    background-color: #38a169;
}

.btn-danger {
    background-color: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background-color: #c53030;
}

.btn-secondary {
    background-color: #718096;
    color: white;
}

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

.btn-outline {
    background-color: transparent;
    color: #4a5568;
    border: 1px solid #cbd5e0;
}

.btn-outline:hover {
    background-color: #f7fafc;
    border-color: #a0aec0;
}

/* 空状态 */
.empty-row {
    height: 300px;
}

.empty-message {
    text-align: center;
    vertical-align: middle;
}

.empty-state {
    padding: 60px 20px;
}

.empty-icon {
    font-size: 48px;
    color: #a0aec0;
    margin-bottom: 16px;
}

.empty-state h4 {
    font-size: 18px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: #718096;
    margin: 0;
}

/* 分页 */
.pagination-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 16px;
}

.pagination-info {
    font-size: 14px;
    color: #718096;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-link {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #4a5568;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.page-link:hover {
    background-color: #f7fafc;
    border-color: #a0aec0;
}

.page-link.active {
    background-color: #4299e1;
    color: white;
    border-color: #4299e1;
}

.page-ellipsis {
    padding: 8px 12px;
    color: #718096;
    font-size: 14px;
}

/* 图标样式 */
.icon-lock::before {
    content: '🔒';
    margin-right: 4px;
}

.icon-user::before {
    content: '👤';
    margin-right: 4px;
}

.icon-key::before {
    content: '🔑';
    margin-right: 4px;
}

.icon-trash::before {
    content: '🗑️';
    margin-right: 4px;
}

.icon-user::before {
    content: '👥';
    margin-right: 4px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .admin-users-container {
        padding: 10px;
    }
    
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-group {
        min-width: 100%;
    }
    
    .form-actions {
        justify-content: center;
    }
    
    .controls-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls-left,
    .controls-right {
        justify-content: center;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    .pagination-section {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .pagination-info {
        order: 2;
    }
    
    .pagination-controls {
        order: 1;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-card,
.table-card {
    animation: fadeIn 0.3s ease-out;
}

.user-row {
    animation: fadeIn 0.2s ease-out;
}

/* 表单输入样式 */
.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
    color: #2d3748;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.form-input:disabled {
    background-color: #f7fafc;
    border-color: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
}
