* {
    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;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

h1 {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 0;
}

.controls {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: #28a745;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.btn-stop {
    background: #dc3545;
}

.btn-stop:hover:not(:disabled) {
    background: #c82333;
}

.camera-select {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    min-width: 200px;
}

.content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

.camera-section, .result-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
}

h2 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

h3 {
    color: #6c757d;
    margin-bottom: 15px;
    font-size: 1.2em;
}

video {
    width: 100%;
    max-width: 400px;
    height: 300px;
    border: 3px solid #667eea;
    border-radius: 8px;
    background: #000;
}

.result-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.image-result img {
    width: 100%;
    max-width: 400px;
    height: auto;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
}

.ocr-text {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 16px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.status {
    padding: 15px 30px;
    background: #e9ecef;
    border-top: 1px solid #dee2e6;
    text-align: center;
}

#status {
    font-weight: 600;
    color: #495057;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .controls {
        justify-content: center;
    }
    
    video, .image-result img {
        max-width: 100%;
    }
}

/* 加载动画 */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.pulse {
    animation: pulse 1s infinite;
}