/* 全局样式 */
body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0.5rem;
    margin: 1rem;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 0.75rem;
    margin: 0 1rem;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Upload页面专用样式 */
.container-fluid {
    padding: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* 拍照上传按钮区域 */
.upload-section {
    margin-bottom: 1.5rem;
}

.upload-btn {
    width: 100%;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.upload-btn i {
    font-size: 1.5rem;
}

/* 使用说明区域 */
.tips-section {
    margin-bottom: 1.5rem;
}

.tips-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tips-card h5 {
    margin-bottom: 1rem;
    color: #495057;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.tip-dot {
    color: #667eea;
    font-weight: bold;
}

.tip-text {
    color: #6c757d;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* 记录列表区域 */
.records-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: #495057;
}

.refresh-btn {
    background: none;
    border: none;
    color: #667eea;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background-color: #f8f9fa;
}

/* 加载状态 */
.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: #6c757d;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 记录表格 */
.record-table {
    width: 100%;
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-bottom: 2px solid #e9ecef;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    gap: 0.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-row:hover {
    background-color: #f8f9fa;
}

.cell {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #495057;
}

/* 状态样式 */
.status-pending {
    color: #f39c12;
    font-weight: 600;
}

.status-processing {
    color: #3498db;
    font-weight: 600;
}

.status-completed {
    color: #27ae60;
    font-weight: 600;
}

/* 空状态 */
.empty-container {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-hint {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* ===== CAMERA 页面样式 ===== */
.camera-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #000;
    overflow: hidden;
}

.camera-preview {
    position: relative;
    width: 100%;
    height: 100vh;
}

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

.guide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.guide-frame {
    width: 80%;
    height: 60%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.1);
}

.guide-text {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-size: 0.9rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.camera-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.photo-preview {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.photo-count {
    width: 24px;
    height: 24px;
    background: #6c757d;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.capture-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    border: 4px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.capture-btn:hover {
    transform: scale(1.05);
}

.capture-inner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    border: 2px solid #333;
}

.done-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
}

.camera-toolbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    backdrop-filter: blur(10px);
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.toolbar-info {
    text-align: right;
    color: white;
}

.customer-info {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.report-type {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
}

.permission-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.permission-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    max-width: 300px;
    margin: 1rem;
}

.permission-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-secondary, .btn-primary {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.photo-list {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    padding: 1rem;
}

.photo-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    margin-bottom: 1rem;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-actions {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
}

.delete-photo-btn {
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.photo-number {
    position: absolute;
    bottom: 0.25rem;
    left: 0.25rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

/* ===== PHOTO EDITOR 页面样式 ===== */
.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.main-preview {
    height: 40vh;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.preview-container {
    position: relative;
    max-width: 100%;
    max-height: 100%;
}

.main-image {
    max-width: 100%;
    max-height: 35vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.image-counter {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.thumbnail-section {
    height: 140px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
}

.thumbnail-scroll {
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.thumbnail-list {
    display: flex;
    gap: 0.5rem;
    padding: 0 1rem;
    height: 100%;
}

.thumbnail-item {
    flex-shrink: 0;
    width: 120px;
    height: 100px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid transparent;
}

.thumbnail-item.active {
    border-color: #667eea;
    transform: scale(1.05);
}

.thumbnail-item.dragging {
    opacity: 0.7;
    transform: scale(0.95);
    z-index: 1000;
}

.thumbnail-item.error {
    border: 2px solid #dc3545;
    opacity: 0.7;
}

.thumbnail-item.error img {
    filter: grayscale(100%);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.thumbnail-item:hover .thumbnail-overlay {
    opacity: 1;
}

.delete-thumbnail-btn {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-number {
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
}

.add-btn {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px dashed #dee2e6;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.submit-btn {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.drag-hint {
    text-align: center;
    padding: 1rem;
    color: #6c757d;
    font-size: 0.9rem;
    background: #f8f9fa;
}

/* 上传进度模态框 */
.upload-progress-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
}

.upload-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.upload-header h4 {
    margin-bottom: 0.5rem;
    color: #495057;
}

.progress-text {
    color: #6c757d;
    font-size: 0.9rem;
}

.upload-progress {
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-percentage {
    text-align: center;
    font-weight: 600;
    color: #495057;
}

/* 图片预览模态框 */
.image-preview-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: black;
    border-radius: 12px;
    overflow: hidden;
}

.close-preview-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
}

.preview-image {
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
}

.preview-controls {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
}

.preview-btn {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preview-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* 模态框样式 */
.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

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

.modal-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #495057;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 表单样式 */
.form-container {
    padding: 1.5rem;
}

.form-item {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 选择器样式 */
.picker-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.picker-container:hover {
    border-color: #667eea;
}

.picker-text {
    color: #495057;
}

.picker-arrow {
    color: #6c757d;
}

/* 按钮样式 */
.modal-buttons {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.cancel-btn, .confirm-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.cancel-btn {
    background-color: #f8f9fa;
    color: #6c757d;
}

.cancel-btn:hover {
    background-color: #e9ecef;
}

.confirm-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* 选择器模态框 */
.picker-content {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    max-width: 300px;
    width: 90%;
}

.picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.picker-options {
    padding: 0;
}

.picker-option {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
}

.picker-option:hover {
    background-color: #f8f9fa;
}

.picker-option:last-child {
    border-bottom: none;
}

/* Action Sheet 样式 */
.action-sheet {
    background: white;
    border-radius: 12px 12px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    transform: translateY(100%);
    animation: slideUp 0.3s ease forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
    }
}

.action-sheet-header {
    text-align: center;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f8f9fa;
}

.action-btn {
    width: 100%;
    padding: 1rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background-color: #f8f9fa;
}

.action-btn.cancel {
    color: #dc3545;
    border-color: #dc3545;
}

.action-btn.cancel:hover {
    background-color: #dc3545;
    color: white;
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    z-index: 2000;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0.5rem;
    }
    
    .upload-btn {
        height: 70px;
        font-size: 1.1rem;
    }
    
    .tips-card, .records-section {
        padding: 1rem;
    }
    
    .table-header, .table-row {
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
        font-size: 0.8rem;
    }
    
    .cell {
        font-size: 0.75rem;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .form-container {
        padding: 1rem;
    }
    
    /* Camera 响应式 */
    .camera-controls {
        padding: 0 1rem;
        height: 100px;
    }
    
    .capture-btn {
        width: 70px;
        height: 70px;
    }
    
    .capture-inner {
        width: 50px;
        height: 50px;
    }
    
    /* Photo Editor 响应式 */
    .main-preview {
        height: 35vh;
    }
    
    .main-image {
        max-height: 30vh;
    }
    
    .thumbnail-section {
        height: 120px;
    }
    
    .thumbnail-item {
        width: 100px;
        height: 80px;
    }
    
    .action-buttons {
        padding: 1rem;
        flex-direction: column;
    }
    
    .add-btn {
        order: 2;
        margin-top: 1rem;
    }
} 