* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

header h1 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 300;
}

.subheader {
    text-align: center;
    margin-top: 0.3rem;
    opacity: 0.9;
    font-size: 0.95rem;
}

.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

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

.filter-section {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.filter-group label {
    font-weight: 600;
    color: #555;
    margin-bottom: 0.5rem;
}

.filter-group select {
    padding: 0.8rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    background-color: white;
    transition: border-color 0.3s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: #667eea;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-exchange {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-danger {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

.btn-success {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.chart-container {
    height: 400px;
    margin: 2rem 0;
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
    scroll-behavior: smooth;
}

.chart-container::-webkit-scrollbar {
    height: 8px;
}

.chart-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chart-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.chart-container::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

.student-list {
    max-height: 600px;
    overflow-y: auto;
}

.student-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e1e8ed;
    transition: background-color 0.3s ease;
    gap: 15px;
}

.student-item:hover {
    background-color: #f8f9fa;
}

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

.student-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.student-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: #2c3e50;
}

.student-id {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.exchange-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.student-score {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.score-badge {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    min-width: 60px;
    text-align: center;
}

.score-high {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.score-medium {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.score-low {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: white;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    animation: slideUp 0.3s ease;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

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

.modal-header h3 {
    color: #2c3e50;
    font-size: 1.5rem;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s ease;
}

.close:hover {
    color: #e74c3c;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
    color: #155724;
}

.alert-error {
    background: linear-gradient(135deg, #feb692 0%, #ea5455 100%);
    color: white;
}

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

.stat-card {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-number {
    font-size: 1.6rem;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    color: #7f8c8d;
    margin-top: 0.3rem;
    font-size: 0.9rem;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

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

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .subheader {
        font-size: 0.85rem;
    }

    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }

    .student-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .student-score {
        width: 100%;
        justify-content: space-between;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.8rem;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }
}