/* 基础样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    display: flex;
    justify-content: center;
}

.main-container {
    display: flex;
    width: 95%;
    max-width: 1200px;
    margin: 20px;
    gap: 20px;
}

/* 左侧侧边栏 */
.sidebar {
    width: 220px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    height: fit-content;
    max-height: 90vh;
    overflow-y: auto;
}

.sidebar h2 {
    font-size: 1.2rem;
    color: #333;
    margin-top: 0;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

#group-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.group-btn {
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    text-align: left;
}

.group-btn:hover {
    background: #e9ecef;
}

.group-btn.active {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

/* 右侧内容区 */
.content {
    flex: 1;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.select-group label {
    font-weight: bold;
    margin-right: 8px;
}

select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.card-display {
    text-align: center;
    width: 100%;
}

.image-container {
    background: #fafafa;
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 20px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#flashcard-image {
    max-width: 100%;
    max-height: 450px;
    cursor: pointer;
    border-radius: 4px;
}

#next-button {
    padding: 15px 50px;
    font-size: 1.2rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.3s;
}

#next-button:hover {
    background-color: #218838;
}

#card-status {
    margin-top: 20px;
    color: #666;
    font-size: 0.9rem;
}

/* 响应式适配 */
@media (max-width: 800px) {
    .main-container {
        flex-direction: column;
    }
    .sidebar {
        width: auto;
        max-height: 200px;
    }
    #group-buttons-container {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    .group-btn {
        white-space: nowrap;
    }
}