* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 控制区域样式 */
.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.control-group select,
.control-group .btn {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.control-group select:focus,
.control-group .btn:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 按钮样式 */
.btn {
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    padding: 12px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4190);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ff5a5a, #dd4b4b);
}

.btn-warning {
    background: linear-gradient(135deg, #ffa726, #ff9800);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #ff9100, #f57c00);
}

.btn-secondary {
    background: linear-gradient(135deg, #78909c, #607d8b);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #6a808c, #506d7b);
}

/* 预览区域样式 */
.preview-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.preview-container {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.preview-container h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.3rem;
}

.preview-box {
    position: relative;
    width: 100%;
    height: 300px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
}

#previewVideo, #previewCanvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.no-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
    font-style: italic;
}

.preview-controls {
    display: flex;
    gap: 10px;
}

/* 录制状态样式 */
.recording-status {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(255,255,255,0.9);
    border-radius: 25px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.pulse {
    width: 12px;
    height: 12px;
    background: #ff6b6b;
    border-radius: 50%;
    position: relative;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.recording-indicator span {
    font-weight: 600;
    color: #333;
}

#timer {
    font-family: 'Courier New', monospace;
    color: #ff6b6b;
}

/* 录制文件列表样式 */
.recordings-section {
    margin-bottom: 30px;
}

.recordings-section h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.recordings-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.recording-item {
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.recording-item:hover {
    transform: translateY(-5px);
}

.recording-item h4 {
    margin-bottom: 10px;
    color: #333;
}

.recording-item .recording-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.recording-item .recording-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.recording-actions .btn {
    padding: 8px 12px;
    font-size: 0.8rem;
}

/* 设置面板样式 */
.settings-section {
    margin-bottom: 30px;
}

details {
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

details summary {
    cursor: pointer;
    font-weight: 600;
    color: #333;
    padding: 10px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

details summary:hover {
    background: rgba(102, 126, 234, 0.1);
}

details[open] summary {
    margin-bottom: 15px;
}

.settings-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.setting-group label {
    font-weight: 500;
    color: #555;
    cursor: pointer;
}

.setting-group input[type="range"] {
    flex: 1;
    accent-color: #667eea;
}

.setting-group span {
    font-weight: 600;
    color: #667eea;
    min-width: 80px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .controls {
        grid-template-columns: 1fr;
    }
    
    .preview-section {
        grid-template-columns: 1fr;
    }
    
    .recordings-list {
        grid-template-columns: 1fr;
    }
    
    .settings-content {
        grid-template-columns: 1fr;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recording-item {
    animation: fadeIn 0.5s ease-out;
}

/* 全屏模式样式 */
.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-mode .preview-box {
    width: 90vw;
    height: 90vh;
    background: #1a1a1a;
}

.fullscreen-mode #previewVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 加载动画 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
}

.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); }
}
