/* 全局样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

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

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #4a90e2;
    font-size: 28px;
}

main {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* 面板样式 */
.panel {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    flex: 1;
    min-width: 300px;
}

.panel h2 {
    color: #4a90e2;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.panel h3 {
    color: #555;
    margin: 15px 0 10px;
    font-size: 18px;
}

/* 按钮样式 */
.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s, transform 0.2s;
}

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

.primary-btn {
    background-color: #4a90e2;
    color: white;
}

.primary-btn:hover {
    background-color: #3a80d2;
}

.secondary-btn {
    background-color: #f0f0f0;
    color: #333;
}

.secondary-btn:hover {
    background-color: #e0e0e0;
}

.record-btn {
    background-color: #5cb85c;
    color: white;
}

.record-btn:hover {
    background-color: #4cae4c;
}

.stop-btn {
    background-color: #d9534f;
    color: white;
}

.stop-btn:hover {
    background-color: #c9433f;
}

/* 学生管理面板 */
.student-panel {
    flex: 1;
    min-width: 300px;
}

.class-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.class-selector select {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.import-section {
    margin-bottom: 20px;
}

.file-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.file-input {
    display: none;
}

.file-input-label {
    padding: 8px 15px;
    background-color: #f0f0f0;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.file-input-label:hover {
    background-color: #e0e0e0;
}

.student-list-container {
    margin-bottom: 20px;
}

.student-list-header {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 1fr;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 4px 4px 0 0;
    font-weight: bold;
}

.student-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 0 0 4px 4px;
}

.student-item {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 1fr;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

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

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

.random-selection {
    text-align: center;
}

.selected-student-info {
    margin-top: 15px;
    padding: 10px;
    background-color: #f0f8ff;
    border-radius: 4px;
    border-left: 4px solid #4a90e2;
}

/* 问答交互面板 */
.qa-panel {
    flex: 2;
    min-width: 400px;
}

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

.voice-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recording-status {
    margin-left: 10px;
    font-size: 14px;
}

.qa-type-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.qa-type-selector label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.current-qa {
    margin-bottom: 20px;
}

.qa-content {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 15px;
    min-height: 100px;
}

.qa-text {
    line-height: 1.6;
}

.teacher-controls {
    background-color: #f0f8ff;
    padding: 15px;
    border-radius: 8px;
}

.evaluation-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.understanding-selector, .score-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.understanding-selector select, .score-selector input {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.follow-up-controls {
    display: flex;
    gap: 10px;
}

.qa-history {
    margin-top: 30px;
}

.qa-history-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.qa-history-list {
    max-height: 500px;
    overflow-y: auto;
}

.qa-session {
    margin-bottom: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
}

.qa-session-header {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background-color: #eee;
    font-weight: bold;
}

.qa-history-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

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

.qa-history-header {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.qa-history-type {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: white;
}

.qa-history-type.teacher_question {
    background-color: #5bc0de;
}

.qa-history-type.student_answer {
    background-color: #5cb85c;
}

.qa-history-type.student {
    background-color: #f0ad4e;
}

.qa-history-type.teacher {
    background-color: #4a90e2;
}

.qa-history-time, .qa-history-score, .qa-history-understanding {
    font-size: 12px;
    color: #666;
}

.qa-history-content {
    line-height: 1.6;
}

.empty-list {
    padding: 20px;
    text-align: center;
    color: #999;
}

footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px 0;
    color: #999;
    font-size: 14px;
}

/* 主题输入框样式 */
.topic-container {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f0f8ff;
    border-radius: 5px;
    border-left: 4px solid #4a90e2;
}

.topic-label {
    font-weight: bold;
    margin-right: 10px;
    color: #333;
}

.topic-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/* 主题列表样式 */
.course-list-view {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.course-list-title {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #4a90e2;
    padding-bottom: 10px;
}

.course-item {
    margin: 10px 0;
    padding: 15px;
    border-radius: 5px;
    background-color: #f5f5f5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

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

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topic-info h4 {
    margin: 0 0 5px 0;
    color: #333;
}

.topic-time {
    font-size: 12px;
    color: #666;
    margin: 0;
}

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

.topic-actions button {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
}

.edit-topic-btn {
    background-color: #f0ad4e;
    color: white;
}

.view-qa-btn {
    background-color: #5bc0de;
    color: white;
}

.topic-edit-input {
    width: 100%;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 5px;
}

/* 响应式布局 */
@media (max-width: 768px) {
    main {
        flex-direction: column;
    }
    
    .panel {
        width: 100%;
    }
    
    .qa-controls, .evaluation-row, .follow-up-controls, .qa-history-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .student-list-header, .student-item {
        grid-template-columns: 1fr 1fr;
    }
    
    .student-list-header span:nth-child(3), 
    .student-list-header span:nth-child(4),
    .student-item span:nth-child(3),
    .student-item span:nth-child(4) {
        display: none;
    }
}