/* 班级积分管理 CSS */
:root {
    --primary-color: #4caf50;
    --secondary-color: #2196f3;
    --accent-color: #ff9800;
    --danger-color: #f44336;
    --light-color: #f5f5f5;
    --dark-color: #333;
    --border-color: #ddd;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --gold-color: #ffd700;
    --silver-color: #c0c0c0;
    --bronze-color: #cd7f32;
}

/* 主容器 */
.container {
    display: flex;
    height: calc(100vh - 120px);
    margin: 20px;
    background-color: #fff;
    box-shadow: 0 2px 10px var(--shadow-color);
    border-radius: 10px;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    background-color: var(--light-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--primary-color);
    color: white;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

/* 班级列表 */
.class-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.class-item {
    padding: 10px 15px;
    margin-bottom: 5px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 1px 3px var(--shadow-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.class-item:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

.class-item.active {
    background-color: var(--primary-color);
    color: white;
}

.class-name {
    font-weight: bold;
}

.class-count {
    font-size: 0.8rem;
    color: #666;
}

.class-item.active .class-count {
    color: #e0e0e0;
}

.add-class {
    padding: 15px;
    border-top: 1px solid var(--border-color);
}

.add-class button {
    width: 100%;
    padding: 8px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.add-class button:hover {
    background-color: #1976d2;
}

/* 内容区域 */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background-color: #f9f9f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-header h2 {
    margin: 0;
    color: var(--dark-color);
}

.actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 8px 12px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.action-btn:hover {
    background-color: #1976d2;
}

.action-btn.add {
    background-color: var(--primary-color);
}

.action-btn.add:hover {
    background-color: #388e3c;
}

.action-btn.exchange {
    background-color: var(--accent-color);
}

.action-btn.exchange:hover {
    background-color: #f57c00;
}

/* 搜索和过滤 */
.search-filter {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    background-color: #f9f9f9;
}

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

.search-box input {
    width: 100%;
    padding: 8px 12px;
    padding-left: 35px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.search-box::before {
    content: "🔍";
    position: absolute;
    top: 8px;
    left: 10px;
    color: #999;
}

.filter-dropdown select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    background-color: white;
}

/* 积分表格 */
.points-table-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

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

.points-table th, .points-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.points-table th {
    background-color: #f5f5f5;
    font-weight: bold;
    color: var(--dark-color);
    position: sticky;
    top: 0;
    z-index: 1;
}

.points-table tr:hover {
    background-color: #f9f9f9;
}

.student-name {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.student-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: var(--dark-color);
}

.points-value {
    font-weight: bold;
}

.positive {
    color: var(--primary-color);
}

.negative {
    color: var(--danger-color);
}

.coins-value {
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 5px;
}

.coin-icon {
    color: var(--gold-color);
}

.action-icons {
    display: flex;
    gap: 8px;
}

.action-icon {
    padding: 5px;
    cursor: pointer;
    color: #777;
    border-radius: 4px;
    transition: all 0.2s;
}

.action-icon:hover {
    background-color: #f0f0f0;
    color: var(--dark-color);
}

.edit-icon:hover {
    color: var(--secondary-color);
}

.delete-icon:hover {
    color: var(--danger-color);
}

.add-icon:hover {
    color: var(--primary-color);
}

/* 排名标识 */
.rank {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
}

.rank-1 {
    background-color: var(--gold-color);
}

.rank-2 {
    background-color: var(--silver-color);
}

.rank-3 {
    background-color: var(--bronze-color);
}

/* 积分历史 */
.points-history {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    background-color: #f9f9f9;
}

.history-title {
    font-weight: bold;
    margin-bottom: 10px;
}

.history-items {
    max-height: 150px;
    overflow-y: auto;
    background-color: white;
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

.history-item {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

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

.history-info {
    display: flex;
    flex-direction: column;
}

.history-student {
    font-weight: bold;
}

.history-details {
    font-size: 0.9rem;
    color: #777;
}

.history-points {
    font-weight: bold;
}

/* 对话框 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.dialog {
    background-color: white;
    width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.dialog-header {
    padding: 15px;
    background-color: var(--primary-color);
    color: white;
}

.dialog-header h3 {
    margin: 0;
}

.dialog-body {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.dialog-footer {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cancel {
    padding: 8px 16px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.btn-primary {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-danger {
    background-color: var(--danger-color);
}

/* 积分兑换对话框 */
.exchange-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.exchange-option {
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.exchange-option:hover {
    border-color: var(--primary-color);
    background-color: #f5f5f5;
}

.exchange-option.selected {
    border-color: var(--primary-color);
    background-color: rgba(76, 175, 80, 0.1);
}

.exchange-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.exchange-name {
    font-weight: bold;
}

.exchange-value {
    color: #666;
    font-size: 0.9rem;
}

/* 排序指示器 */
.sort-indicator {
    margin-left: 5px;
}

/* 空状态提示 */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #999;
    text-align: center;
    padding: 20px;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.3;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        height: auto;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .actions {
        width: 100%;
    }
    
    .search-filter {
        flex-direction: column;
    }
    
    .points-table th, .points-table td {
        padding: 10px 8px;
    }
    
    .action-btn {
        padding: 6px 10px;
        font-size: 0.9rem;
    }
} 