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

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-top: 50px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

h2 {
    color: #34495e;
    margin-bottom: 20px;
    font-size: 20px;
}

h3 {
    color: #7f8c8d;
    margin-bottom: 15px;
    font-size: 16px;
}

.form-group {
    margin-bottom: 15px;
}

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

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.btn {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
}

.btn:hover {
    background-color: #2980b9;
}

.btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.error {
    color: #e74c3c;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #fdecea;
    border-radius: 4px;
}

/* 主题选择页面样式 */
.topics-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.topic-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
}

.topic-item:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.topic-item input[type="checkbox"] {
    margin-right: 15px;
    transform: scale(1.3);
    margin-top: 5px;
    flex-shrink: 0;
}

.topic-name {
    font-weight: bold;
    font-size: 16px;
    color: #343a40;
    margin-bottom: 5px;
}

.topic-description {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
    margin-top: 3px;
}

.topic-item label {
    cursor: pointer;
    flex: 1;
    margin-bottom: 0;
    font-weight: normal;
}

/* 录音录像页面样式 */
.record-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-preview {
    width: 100%;
    height: 400px;
    background-color: #000;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
    position: relative; /* 添加相对定位，使绝对定位的子元素相对于此容器定位 */
}

#videoElement {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.control-btn {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#startBtn {
    background-color: #27ae60;
    color: white;
}

#startBtn:hover {
    background-color: #229954;
}

#stopBtn {
    background-color: #e74c3c;
    color: white;
}

#stopBtn:hover {
    background-color: #c0392b;
}

#uploadBtn {
    background-color: #3498db;
    color: white;
}

#uploadBtn:hover {
    background-color: #2980b9;
}

/* 禁用状态样式 */
.control-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* 确保禁用状态覆盖ID选择器 */
#startBtn:disabled,
#stopBtn:disabled,
#uploadBtn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

#timer {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #e74c3c;
    margin: 10px 0;
}

/* 摄像头选择器样式 */
.camera-selector {
    text-align: center;
    margin: 15px 0;
}

.camera-selector label {
    margin-right: 10px;
    font-weight: normal;
    display: inline-block;
    margin-bottom: 0;
}

.camera-selector select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

.videos-list {
    margin-top: 30px;
}

.videos-list h3 {
    margin-bottom: 15px;
}

.video-item {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-item:hover {
    background-color: #e9ecef;
}

.video-info {
    flex: 1;
}

.video-id {
    font-weight: bold;
    color: #3498db;
    margin-bottom: 5px;
}

.video-time {
    font-size: 14px;
    color: #7f8c8d;
}

.play-btn {
    padding: 8px 16px;
    background-color: #f39c12;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
    }
    
    .topics-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .video-preview {
        height: 300px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .control-btn {
        width: 100%;
    }
}