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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.2rem;
}

.input-section {
    margin-bottom: 20px;
    text-align: center;
}

.input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

#authorInput {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

#authorInput:focus {
    border-color: #667eea;
}

#fetchBtn, #refreshBtn, #downloadAllBtn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

#fetchBtn:hover, #refreshBtn:hover, #downloadAllBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

#authorSelect {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
}

.audio-list-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.table-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 1fr; /* 标题更宽，其他列更窄 */
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-cell {
    padding: 15px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-cell:hover {
    background: #e9ecef;
}

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

.audio-item {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 1fr; /* 标题更宽，其他列更窄 */
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

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

.audio-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.audio-meta {
    font-size: 0.9em;
    color: #666;
}

.audio-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.play-btn, .download-btn, .generate-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    margin: 0 2px;
}

.play-btn {
    background: #28a745;
    color: white;
}

.download-btn {
    background: #007bff;
    color: white;
}

.generate-btn {
    background: #ffc107;
    color: #212529;
}

.play-btn:hover, .download-btn:hover, .generate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-style: italic;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

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

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

/* 手机端适配 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    #authorInput {
        min-width: auto;
        margin-bottom: 10px;
    }
    
    #fetchBtn {
        width: 100%;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    #authorSelect {
        min-width: auto;
        margin-bottom: 10px;
    }
    
    #refreshBtn {
        width: 100%;
    }
    
    .table-header {
        grid-template-columns: 3fr 1fr 1fr 1fr 1fr; /* 在移动设备上保持比例 */
        font-size: 0.9em;
        padding: 10px 5px;
    }
    
    .header-cell {
        padding: 10px 5px;
    }
    
    .audio-item {
        grid-template-columns: 3fr 1fr 1fr 1fr 1fr; /* 在移动设备上保持比例 */
        font-size: 0.9em;
        padding: 10px 5px;
    }
    
    .audio-title {
        font-size: 0.95em;
        word-break: break-word;
    }
    
    .audio-meta {
        font-size: 0.8em;
    }
    
    .play-btn, .download-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .header-cell {
        justify-content: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .audio-title, .audio-meta {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 480px) {
    .table-header, .audio-item {
        grid-template-columns: 2.5fr 1fr 1fr 1fr 1fr; /* 更适合小屏幕的比例 */
        font-size: 0.8em;
    }
    
    .header-cell, .audio-item {
        padding: 8px 3px;
    }
    
    .audio-title {
        font-size: 0.85em;
    }
    
    .play-btn, .download-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
}