/* 积分分发页面样式 - 与其他管理页面保持一致 */

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    margin-bottom: 20px;
    padding: 20px;
}

.header-section {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 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;
}

/* 操作面板样式 */
.action-panel {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.action-panel h3 {
    margin: 0 0 1.5rem 0;
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.panel-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* 搜索表单 */
.search-form {
    margin-bottom: 1.5rem;
}

.input-group {
    display: flex;
    gap: 1rem;
}

.form-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

/* 用户信息卡片 */
.user-info-card {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.user-info-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-avatar i {
    font-size: 3rem;
    color: #4facfe;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.user-id {
    font-size: 0.95rem;
    color: #718096;
    margin-bottom: 0.5rem;
}

.user-points {
    font-size: 1.1rem;
    font-weight: 600;
    color: #38a169;
}

.user-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* 关卡网格 */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.level-card {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.level-card:hover {
    border-color: #4facfe;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.15);
}

.level-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.level-points {
    font-size: 1.1rem;
    font-weight: 700;
    color: #38a169;
    margin-bottom: 0.75rem;
}

.level-description {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.level-award-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    font-weight: 600;
}

/* 已完成关卡样式 */
.level-card.level-completed {
    background: linear-gradient(135deg, #f0f8f0, #e8f5e8);
    border-color: #68d391;
    position: relative;
    opacity: 0.8;
}

.level-card.level-completed:hover {
    border-color: #48bb78;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.15);
}

.level-card.level-completed .level-name {
    color: #2f855a;
}

.level-card.level-completed .level-points {
    color: #38a169;
    text-decoration: line-through;
    opacity: 0.7;
}

.level-card.level-completed .level-description {
    color: #68d391;
    font-style: italic;
}

.level-completed-badge {
    background: linear-gradient(135deg, #38a169, #48bb78);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(56, 161, 105, 0.3);
}

.level-completed-badge i {
    font-size: 0.9rem;
    color: #ffd700;
}

/* 禁用按钮样式 */
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.level-card.level-completed .btn {
    background: #a0aec0;
    border-color: #a0aec0;
    color: #ffffff;
}

.level-card.level-completed .btn:hover {
    background: #a0aec0;
    border-color: #a0aec0;
    transform: none;
}

/* 表单样式 */
.points-form {
    margin-top: 1.5rem;
}

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

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* 权限标识 */
.permission-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.permission-badge.admin {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

.permission-badge.super-admin {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

/* 按钮样式 - 与其他管理页面统一 */
.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, #4facfe, #00f2fe);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(79, 172, 254, 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);
}

.btn-outline {
    background: transparent;
    color: #4facfe;
    border: 2px solid #e2e8f0;
}

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

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

/* 历史记录 */
.history-list {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}

.no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #a0aec0;
    text-align: center;
}

.no-data i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.no-data p {
    margin: 0;
    font-size: 1.1rem;
}

/* 历史记录项 */
.history-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s;
}

.history-item:hover {
    background-color: #f7fafc;
}

.history-item:last-child {
    border-bottom: none;
}

.history-icon {
    margin-right: 1rem;
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7fafc;
    border-radius: 50%;
    flex-shrink: 0;
}

.history-details {
    flex: 1;
}

.history-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.history-type {
    font-weight: 600;
    color: #2d3748;
}

.history-target {
    color: #4a5568;
    font-size: 0.9rem;
}

.history-points {
    font-weight: 600;
    font-size: 0.9rem;
}

.history-sub {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.history-reason {
    color: #718096;
    font-size: 0.85rem;
    flex: 1;
}

.history-time {
    color: #a0aec0;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* 文字颜色 */
.text-success {
    color: #38a169 !important;
}

.text-danger {
    color: #e53e3e !important;
}

.text-warning {
    color: #d69e2e !important;
}

.text-primary {
    color: #4facfe !important;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header.success {
    background: #d4edda;
    color: #0a3622;
}

.modal-header.error {
    background: #f8d7da;
    color: #2c0b0e;
}

.modal-header.warning {
    background: #fff3cd;
    color: #332701;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.close-btn:hover {
    opacity: 0.7;
}

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

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

/* 加载状态 */
.loading {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.loading i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* 错误信息 */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-container {
        padding: 0 1rem;
        max-width: 100%;
    }
    
    .header-section {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
        border-radius: 8px;
    }
    
    .header-section h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    /* 搜索区域 */
    .search-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .search-form {
        flex-direction: column;
        gap: 1rem;
    }
    
    .input-group {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .input-group input {
        width: 100%;
        padding: 0.8rem 1rem;
        font-size: 16px; /* 防止iOS缩放 */
        min-height: 44px;
        border-radius: 8px;
    }
    
    .input-group button {
        width: 100%;
        padding: 0.8rem 1rem;
        font-size: 1rem;
        min-height: 44px;
        border-radius: 8px;
    }
    
    /* 关卡网格 */
    .levels-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .level-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .level-header h3 {
        font-size: 1.1rem;
    }
    
    .level-stats {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .stat-item {
        min-width: auto;
    }
    
    /* 操作面板 */
    .action-panel {
        padding: 1rem;
        margin: 0 0.5rem 1.5rem;
    }
    
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .panel-header h2 {
        font-size: 1.2rem;
    }
    
    /* 用户信息 */
    .user-info {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .user-info-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .user-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.2rem;
    }
    
    .user-details h3 {
        font-size: 1.1rem;
    }
    
    .user-stats {
        gap: 1rem;
        justify-content: center;
    }
    
    /* 表单网格 */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 0.8rem;
        font-size: 16px;
        min-height: 44px;
        border-radius: 8px;
    }
    
    .form-group textarea {
        min-height: 100px;
        resize: vertical;
    }
    
    /* 操作按钮 */
    .form-actions {
        justify-content: center;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-actions button {
        width: 100%;
        padding: 0.8rem 1rem;
        font-size: 1rem;
        min-height: 44px;
        border-radius: 8px;
    }
    
    /* 历史记录 */
    .history-section {
        margin: 1.5rem 0.5rem;
        padding: 1rem;
    }
    
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .history-controls {
        width: 100%;
        justify-content: center;
    }
    
    /* 表格响应式 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.5rem;
    }
    
    table {
        min-width: 600px;
        font-size: 0.8rem;
    }
    
    th, td {
        padding: 0.5rem !important;
        white-space: nowrap;
    }
    
    /* 分页 */
    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
        justify-content: center;
    }
    
    .pagination button {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-width: 40px;
    }
    
    /* 模态框 */
    .modal-content {
        width: 95%;
        margin: 1rem;
        padding: 1rem;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer button {
        width: 100%;
        min-height: 44px;
    }
}

@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;
    }
    
    /* 搜索优化 */
    .search-section {
        padding: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .input-group input {
        padding: 0.6rem 0.8rem;
        font-size: 16px;
    }
    
    .input-group button {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    
    /* 关卡卡片 */
    .level-card {
        padding: 0.8rem;
    }
    
    .level-header h3 {
        font-size: 1rem;
    }
    
    .level-description {
        font-size: 0.8rem;
    }
    
    /* 操作面板 */
    .action-panel {
        padding: 0.8rem;
        margin: 0 0.25rem 1rem;
    }
    
    .panel-header h2 {
        font-size: 1.1rem;
    }
    
    .user-info {
        padding: 0.8rem;
    }
    
    .user-avatar {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    
    .user-details h3 {
        font-size: 1rem;
    }
    
    .user-details p {
        font-size: 0.8rem;
    }
    
    /* 表单优化 */
    .form-group label {
        font-size: 0.8rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.6rem;
        font-size: 16px;
    }
    
    .form-actions button {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    
    /* 历史记录 */
    .history-section {
        margin: 1rem 0.25rem;
        padding: 0.8rem;
    }
    
    .history-header h2 {
        font-size: 1.1rem;
    }
    
    table {
        font-size: 0.7rem;
        min-width: 550px;
    }
    
    th, td {
        padding: 0.4rem !important;
    }
    
    .pagination button {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
        min-width: 36px;
    }
    
    /* 模态框优化 */
    .modal {
        padding: 0.5rem;
    }
    
    .modal-content {
        width: calc(100% - 1rem);
        margin: 0.5rem;
        padding: 0.8rem;
    }
    
    .modal-header {
        padding: 0.8rem;
    }
    
    .modal-body {
        padding: 0.8rem;
    }
    
    .modal-footer {
        padding: 0.8rem;
    }
    
    .modal-footer button {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .header-section h1 {
        font-size: 1.3rem;
    }
    
    .level-header h3 {
        font-size: 0.9rem;
    }
    
    .panel-header h2 {
        font-size: 1rem;
    }
    
    .user-avatar {
        width: 45px;
        height: 45px;
        font-size: 0.9rem;
    }
    
    table {
        font-size: 0.65rem;
        min-width: 500px;
    }
    
    .pagination button {
        padding: 0.3rem 0.5rem;
        font-size: 0.65rem;
        min-width: 32px;
    }
}

/* 积分历史记录新增样式 */
.history-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background: white;
    transition: all 0.3s ease;
}

.history-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.history-item.revoked-record {
    opacity: 0.6;
    background: #f7fafc;
}

.history-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.history-details {
    flex: 1;
    min-width: 0;
}

.history-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.history-type {
    font-weight: 600;
    color: #2d3748;
}

.history-points {
    font-weight: 700;
    font-size: 1.1rem;
}

.revoked-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: #fed7d7;
    color: #c53030;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.history-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: #718096;
}

.history-reason {
    flex: 1;
    min-width: 0;
}

.history-time,
.history-operator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.history-revoke-info {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #fff5f5;
    border-left: 3px solid #fc8181;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #c53030;
}

.history-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.text-success {
    color: #48bb78;
}

.text-danger {
    color: #f56565;
}

.text-warning {
    color: #ed8936;
}

.text-primary {
    color: #4299e1;
}

/* 奖品相关样式 (info页面使用) */
.redeem-info {
    color: #68d391;
    font-weight: 500;
}

/* 按钮样式 */
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.btn-warning {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-info {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-info:hover {
    background: #2563eb;
}

@media (max-width: 768px) {
    .history-item {
        flex-direction: column;
    }
    
    .history-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .history-sub {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .history-actions {
        width: 100%;
    }
    
    .history-actions button {
        width: 100%;
    }
}