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

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

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

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

.controls {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

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

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.filter-group select, .filter-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-box {
    flex: 2;
    min-width: 250px;
}

.progress-summary {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    padding: 20px;
}

.progress-summary h3 {
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

.progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.progress-item {
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 12px;
    background-color: #fafafa;
}

.progress-header {
    font-weight: bold;
    margin-bottom: 8px;
    color: #555;
}

.progress-bar-container {
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #74b9ff, #0984e3);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: #666;
    text-align: right;
}

.audio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.audio-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.audio-card.progress-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: rgba(116, 185, 255, 0.1);
    z-index: 0;
    width: var(--progress-percent, 0%);
}

.audio-card.completed {
    background-color: #f8fff8;
}

.audio-card.completed::before {
    background-color: rgba(0, 184, 148, 0.1);
}

.audio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
    padding: 15px;
    position: relative;
    z-index: 1;
}

.completed .card-header {
    background: linear-gradient(135deg, #00b894 0%, #009670 100%);
}

.card-body {
    padding: 15px;
    position: relative;
    z-index: 1;
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.card-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.grade, .term {
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.grade {
    background: #ffeaa7;
}

.term {
    background: #fd79a8;
    color: white;
}

.playback-info {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.playback-info.completed {
    color: #00b894;
    font-weight: bold;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stats {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    color: #666;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 8px 12px;
    background-color: #74b9ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.pagination button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.pagination span {
    align-self: center;
    font-weight: bold;
}

.loading {
    text-align: center;
    padding: 20px;
    font-weight: bold;
}

.error {
    color: red;
    text-align: center;
    padding: 20px;
    font-weight: bold;
}

.server-info {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    display: none; /* 默认隐藏，只有在加载失败时显示 */
}

.file-upload {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    text-align: center;
}

.file-upload input {
    margin: 10px;
    padding: 5px;
}

.file-upload button {
    background-color: #74b9ff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.file-upload button:hover {
    background-color: #0984e3;
}

.custom-audio-player {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.play-btn {
    background-color: #74b9ff;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-btn:hover {
    background-color: #0984e3;
}

.progress-container {
    flex: 1;
    height: 5px;
    background-color: #ddd;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #74b9ff, #0984e3);
    border-radius: 3px;
    width: 0%;
}

.time-display {
    font-size: 12px;
    color: #666;
    min-width: 80px;
    text-align: right;
}

.audio-player {
    display: none;
}

footer {
    background-color: #f8f9fa;
    padding: 20px;
    text-align: center;
    margin-top: 40px;
    border-top: 1px solid #e9ecef;
}

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

footer p {
    color: #6c757d;
    margin: 0 0 10px 0;
}

footer p:nth-child(2) {
    font-size: 0.9em;
}

footer p:nth-child(3),
footer p:nth-child(4),
footer p:nth-child(5) {
    font-size: 0.8em;
}

footer a {
    color: #007bff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .audio-grid {
        grid-template-columns: 1fr;
    }
    
    .custom-audio-player {
        flex-wrap: wrap;
    }
    
    .time-display {
        min-width: auto;
        margin-left: 10px;
    }
}