/**
 * MatorrIMG 前台样式
 * 现代化图片上传界面
 */

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* 容器 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* 标题区域 */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    color: white;
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header p {
    color: rgba(255,255,255,0.9);
    font-size: 18px;
    margin-bottom: 8px;
}

.header .subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}

/* 上传区域 */
.upload-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.upload-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 拖拽上传区域 */
.upload-area {
    border: 3px dashed #e5e7eb;
    border-radius: 16px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    background: #fafbfc;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8faff;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #667eea;
    background: #f0f4ff;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.2);
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 20px;
    color: #9ca3af;
    transition: color 0.3s;
}

.upload-area:hover .upload-icon {
    color: #667eea;
}

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

.upload-hint {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 20px;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

#fileInput {
    display: none;
}

/* 上传进度 */
.upload-progress {
    display: none;
    margin-top: 30px;
}

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

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

.progress-text {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

/* 上传结果 */
.upload-result {
    margin-top: 30px;
    background: #f9fafb;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb;
}

.result-success {
    border-color: #22c55e;
    background: #f0f9f4;
}

.result-error {
    border-color: #ef4444;
    background: #fef2f2;
}

.result-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #374151;
}

.result-success .result-title {
    color: #166534;
}

.result-error .result-title {
    color: #991b1b;
}

/* 图片预览 */
.image-preview {
    margin-bottom: 20px;
    text-align: center;
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

/* 链接输出 */
.link-group {
    margin-bottom: 16px;
}

.link-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.link-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    font-family: 'Monaco', 'Menlo', monospace;
    color: #374151;
}

.copy-btn {
    background: #6b7280;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: #4b5563;
}

.copy-btn.copied {
    background: #22c55e;
}

/* 图片信息 */
.image-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.info-item {
    text-align: center;
}

.info-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.info-value {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

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

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

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

.btn-secondary:hover {
    background: #4b5563;
}

/* 文件格式提示 */
.format-hint {
    margin-top: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 12px;
}

.format-hint strong {
    color: #374151;
}

/* 粘贴区域 */
.paste-area {
    margin-top: 20px;
    padding: 20px;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    transition: all 0.3s;
}

.paste-area.active {
    border-color: #667eea;
    background: #f8faff;
    color: #667eea;
}

/* 历史记录 */
.history-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.history-title {
    font-size: 24px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 20px;
    text-align: center;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.history-item {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s;
    cursor: pointer;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.history-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

.history-name {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-date {
    font-size: 12px;
    color: #6b7280;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }
    
    .header h1 {
        font-size: 36px;
    }
    
    .upload-container {
        padding: 24px;
    }
    
    .upload-area {
        padding: 40px 16px;
    }
    
    .upload-icon {
        font-size: 48px;
    }
    
    .upload-text {
        font-size: 18px;
    }
    
    .image-info {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 28px;
    }
    
    .header p {
        font-size: 16px;
    }
    
    .upload-container {
        padding: 20px;
    }
    
    .history-section {
        padding: 20px;
    }
    
    .image-info {
        grid-template-columns: 1fr;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upload-result {
    animation: fadeInUp 0.5s ease;
}

/* 加载状态 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 文件信息卡片样式 */
.file-info-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.file-info-card h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #dee2e6;
}

.info-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.info-row .label {
    font-weight: 500;
    color: #6c757d;
}

.info-row .value {
    color: #495057;
    font-family: monospace;
}

/* 压缩统计卡片样式 */
.compression-stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.compression-stats-card h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
}

.stat-label {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
}

.stat-value.positive {
    color: #28a745;
    background: rgba(40, 167, 69, 0.2);
    padding: 5px 8px;
    border-radius: 15px;
}

.stat-value.negative {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.2);
    padding: 5px 8px;
    border-radius: 15px;
}

/* 图片预览卡片样式 */
.preview-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.preview-card h4 {
    margin: 0 0 15px 0;
    color: #495057;
    text-align: center;
    font-size: 16px;
}

.preview-image-container {
    text-align: center;
    max-height: 400px;
    overflow: hidden;
    border-radius: 8px;
}

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

/* 上传消息样式 */
.upload-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.upload-message.info {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1565c0;
}

.upload-message.error {
    background: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

.upload-message.success {
    background: #e8f5e8;
    border-color: #4caf50;
    color: #2e7d32;
}

.message-content h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.message-content p {
    margin: 0;
    font-size: 14px;
}

/* 拖拽状态样式 */
.dragover {
    border-color: #667eea !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%) !important;
    transform: scale(1.02);
}

/* 压缩预览增强样式 */
.compression-preview.enabled .preview-enabled {
    color: #28a745;
}

.compression-preview.disabled .preview-disabled {
    color: #6c757d;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-info-card,
.compression-stats-card,
.preview-card,
.upload-message {
    animation: fadeIn 0.5s ease-out;
}

/* 现代化上传成功界面样式 */
.upload-success-modern {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-top: 30px;
    max-width: 100%;
    animation: fadeInUp 0.5s ease;
}

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

.success-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
}

.success-icon {
    margin-bottom: 20px;
    display: inline-block;
    animation: bounce 1s ease;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.success-header h3 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.success-subtitle {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
    font-weight: 400;
}

.success-content {
    padding: 30px;
}

.uploaded-preview {
    text-align: center;
    margin-bottom: 30px;
}

.uploaded-preview img {
    max-width: 300px;
    max-height: 200px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 3px solid #f8f9fa;
}

.links-section {
    margin-bottom: 30px;
}

.link-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.link-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.link-icon {
    margin-right: 10px;
    font-size: 18px;
}

.link-title {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.link-content {
    display: flex;
    gap: 10px;
    align-items: center;
}

.link-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: white;
    color: #495057;
    transition: border-color 0.3s ease;
}

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

.copy-btn {
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
}

.copy-btn:hover {
    background: #5a6fd8;
    transform: scale(1.05);
}

.copy-btn.copied {
    background: #28a745;
    transform: scale(1.1);
}

.file-details {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
    word-break: break-all;
}

.compressed-yes {
    color: #28a745;
    font-weight: 600;
}

.compressed-no {
    color: #6c757d;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: center;
}

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

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

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

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .success-content {
        padding: 20px;
    }
    
    .success-header {
        padding: 30px 20px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .link-content {
        flex-direction: column;
        gap: 12px;
    }
    
    .link-input {
        width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* 复制成功动画 */
@keyframes copySuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.copy-btn.success-animation {
    animation: copySuccess 0.3s ease;
} 