/* 二维码解码器特定样式 */

/* 移动端检测 - PC端隐藏相机功能 */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
}

/* 基础样式重置 */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

/* 页面标题样式 */
.page-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
    text-align: center;
    justify-content: center;
}

.page-subtitle {
    text-align: center;
    color: #6b7280;
    font-size: 1.125rem;
    margin: 0 0 2rem 0;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

/* 分类标题样式 */
.category-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f3f4f6;
}

/* 上传区域样式 */
.upload-area {
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
    margin-bottom: 30px;
}

.upload-area:hover {
    border-color: #007bff;
    background: linear-gradient(135deg, #f0f8ff 0%, #ffffff 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15);
}

.upload-area.drag-over {
    border-color: #007bff;
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
    transform: scale(1.02);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-icon {
    font-size: 48px;
    color: #007bff;
    margin-bottom: 16px;
    display: block;
}

.upload-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 14px;
    color: #666;
    margin-bottom: 0;
}

/* 摄像头相关样式 */
.camera-section {
    margin-top: 1rem;
}

.camera-preview {
    margin-top: 1rem;
    text-align: center;
}

.camera-preview video {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.camera-controls {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* 图片预览样式 */
.preview-section {
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

/* 结果显示样式 */
.decode-result {
    text-align: left;
}

.result-content {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.result-text {
    background-color: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.75rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #1f2937;
    word-break: break-all;
    white-space: pre-wrap;
    min-height: 3rem;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    margin: 12px 0;
}

.result-info {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.result-type,
.result-length {
    background-color: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

/* 结果显示区域 */
.result-area {
    transition: all 0.3s ease;
}

.result-area:hover {
    transform: translateY(-2px);
}

.result-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.result-header .icon {
    color: #28a745;
    margin-right: 8px;
    font-size: 20px;
}

.result-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.result-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 14px;
    color: #666;
}

.result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* 按钮样式 */
.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    justify-content: center;
    min-width: 120px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #6366f1;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #5855eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #e5e7eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 加载状态样式 */
.loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* 错误和成功消息样式 */
.error-message,
.success-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    margin: 1rem 0;
}

.error-message {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.success-message {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .upload-area {
        padding: 1.5rem 1rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .result-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .camera-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .camera-controls .btn {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .upload-text {
        font-size: 1rem;
    }
    
    .upload-hint {
        font-size: 0.75rem;
    }
    
    .category-title {
        font-size: 1.125rem;
    }
    
    .result-text {
        font-size: 0.75rem;
    }
}

/* 动画效果 */
.card {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 焦点样式 */
.btn:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.upload-area:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .upload-area {
        border-width: 3px;
    }
    
    .btn {
        border-width: 2px;
    }
    
    .result-text {
        border-width: 2px;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .upload-area.drag-over {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
}