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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
}

main {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.camera-section, .images-section {
    background-color: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.camera-section h2, .images-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.camera-container {
    margin-bottom: 30px;
}

#video {
    width: 100%;
    max-width: 640px;
    height: auto;
    background-color: #000;
    border-radius: 8px;
    margin: 0 auto 20px;
    display: block;
    border: 3px solid #ddd;
}

.camera-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

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

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

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

.btn-success {
    background-color: #2ecc71;
    color: white;
}

.btn-success:hover {
    background-color: #27ae60;
}

.btn-outline {
    background-color: transparent;
    color: #3498db;
    border: 2px solid #3498db;
}

.btn-outline:hover {
    background-color: #3498db;
    color: white;
}

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

.preview-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#capture-preview {
    width: 100%;
    max-width: 320px;
    height: 240px;
    border-radius: 8px;
    background-color: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border: 2px dashed #bdc3c7;
    overflow: hidden;
}

#capture-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.empty-preview {
    color: #7f8c8d;
    font-size: 1rem;
}

.preview-controls {
    display: flex;
    gap: 15px;
}

.no-images {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.no-images i {
    font-size: 4rem;
    margin-bottom: 15px;
    color: #bdc3c7;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.image-card {
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.image-card:hover {
    transform: translateY(-5px);
}

.image-preview {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-card:hover .image-preview img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-card:hover .image-overlay {
    opacity: 1;
}

.view-btn {
    background-color: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.image-info {
    padding: 15px;
}

.image-info h4 {
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 1.1rem;
}

.timestamp {
    color: #7f8c8d;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-all {
    margin-top: 20px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    color: #7f8c8d;
    border-top: 1px solid #e0e0e0;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.wide-modal {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    font-size: 1.8rem;
    cursor: pointer;
    color: #7f8c8d;
}

.close-modal:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

#modal-preview {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    background-color: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#modal-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 25px;
}

/* 所有图片模态框样式 */
.all-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.all-image-item {
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
}

.all-image-preview {
    position: relative;
    height: 150px;
    overflow: hidden;
}

.all-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.all-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.all-image-item:hover .all-image-overlay {
    opacity: 1;
}

.all-image-info {
    padding: 15px;
}

.all-image-info h4 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.filename {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .camera-controls, .preview-controls, .form-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
    }
    
    .image-grid, .all-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .camera-section, .images-section {
        padding: 15px;
    }
    
    .image-grid, .all-images-grid {
        grid-template-columns: 1fr;
    }
}