/* 图片格式转换工具样式 */

/* 区域样式 */
.upload-section,
.format-section,
.convert-section {
    margin-bottom: 32px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.3s ease;
}

.upload-section:hover,
.format-section:hover,
.convert-section:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.section-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
}

.section-header h2 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

/* 上传区域样式 */
.upload-section {
    background: white;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.upload-section:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.upload-content {
    display: block;
}

.upload-left {
    flex: 1;
}

.upload-right {
    flex: 0 0 320px;
}

/* 上传区域优化 */
.img-dropzone {
    margin: 24px auto;
    padding: 48px 24px;
    border: 3px dashed #d1d5db;
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
    position: relative;
    overflow: hidden;
    max-width: 600px;
}

.img-dropzone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(59, 130, 246, 0.05) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.img-dropzone:hover::before {
    transform: translateX(100%);
}

.img-dropzone:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

.upload-icon {
    margin-bottom: 16px;
    color: #6b7280;
    transition: all 0.3s ease;
}

.img-dropzone:hover .upload-icon {
    color: #3b82f6;
    transform: scale(1.1);
}

.img-dropzone-content h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.img-dropzone-content p {
    margin: 0 0 16px 0;
    color: #6b7280;
    font-size: 16px;
}

.upload-link {
    color: #3b82f6;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.upload-tips {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.tip-item {
    font-size: 14px;
    color: #6b7280;
    background: rgba(255, 255, 255, 0.8);
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
}

/* 格式选择器区域 */
/* 已移动到转换区域右侧，移除独立的格式选择器区域样式 */

/* 格式选择器紧凑版 */
/* 已移除，现在使用内联格式选择器 */

/* 下拉框样式 */
/* 已移除，现在在内联格式选择器中定义 */

/* 格式信息 */
/* 已移除，不再显示 */

/* 显示更多按钮 */
/* 已移除 */

/* 转换区域 */
.convert-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

/* 转换内容区域 - 左右布局 */
/* 已移除，不再使用左右布局 */

/* 左侧文件展示区域 */
/* 已移除，不再使用左右布局 */

/* 右侧格式选择器区域 */
/* 已移除，不再使用左右布局 */

/* 转换列表区域 */
.convert-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

/* 转换列表 */
.convert-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.convert-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.convert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 20px;
}

.convert-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.convert-preview {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.convert-details h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.convert-meta {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

/* 内联格式选择器 */
.format-selector-inline {
    flex: 0 0 auto;
    max-width: 200px;
    margin: 0 15px;
}

.format-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.format-select-wrapper {
    position: relative;
}

.format-select {
    width: 100%;
    padding: 8px 30px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    appearance: none;
    transition: all 0.2s ease;
}

.format-select:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.format-select:hover:not(:disabled) {
    border-color: #007AFF;
}

/* 禁用状态样式 */
.format-select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    border-color: #e0e0e0;
}

.format-select:disabled + .format-select-icon {
    color: #999;
}

/* 当格式选择器被禁用时，整个包装器的样式 */
.format-selector-inline.disabled {
    opacity: 0.6;
}

.format-selector-inline.disabled .format-label {
    color: #999;
}

.format-select-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #666;
    transition: color 0.2s ease;
}

.convert-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    flex: 0 0 auto;
}

/* 当状态包含错误信息时，调整布局 */
.convert-status.status-error {
    flex-direction: column;
    align-items: flex-start;
}

/* 当有错误信息时，调整布局 */
.convert-status.has-error-message {
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 12px;
}

.convert-status .status-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-waiting {
    background: #fef3c7;
    color: #92400e;
}

.status-converting {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-error {
    background: #fee2e2;
    color: #dc2626;
}

/* 错误信息样式 */
.error-message {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    border-left: 3px solid #dc2626;
}

.convert-progress {
    margin-bottom: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.convert-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.convert-actions button,
.convert-actions a {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-convert {
    background: linear-gradient(135deg, #007AFF, #0056CC);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 10px;
}

.btn-convert:hover {
    background: linear-gradient(135deg, #0056CC, #003D99);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

/* 转换中的按钮禁用状态 */
.btn-convert:disabled,
.btn-convert.disabled {
    background: #d1d5db !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.btn-download {
    background: #10b981;
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-download:hover {
    background: #059669;
}

.btn-link {
    background: #6b7280;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-link:hover {
    background: #4b5563;
    color: white;
    text-decoration: none;
}

.btn-remove {
    background: #ef4444;
    color: white;
}

.btn-remove:hover {
    background: #dc2626;
}

.btn-remove:disabled {
    background: #d1d5db !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
}

/* 重试按钮样式 */
.btn-retry {
    background: linear-gradient(135deg, #FF9500, #CC7700) !important;
}

.btn-retry:hover {
    background: linear-gradient(135deg, #CC7700, #994400) !important;
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3) !important;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* 拖拽状态 */
.img-dropzone.dragover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.img-dropzone.dragover .img-dropzone-content {
    color: #3b82f6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tool-content {
        padding: 16px;
        margin: 16px;
    }

    .section-header {
        padding: 20px 20px 12px 20px;
    }

    .section-header h2 {
        font-size: 18px;
    }

    .section-header p {
        font-size: 13px;
        line-height: 1.4;
    }

    .upload-section {
        padding: 20px;
        margin-bottom: 16px;
    }

    .img-dropzone {
        margin: 16px auto;
        padding: 32px 16px;
    }

    .convert-list {
        padding: 20px;
    }

    .convert-item {
        padding: 16px;
    }

    .convert-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .convert-info {
        order: 1;
    }

    .format-selector-inline {
        order: 2;
        max-width: none;
        margin: 0;
    }

    .convert-status {
        order: 3;
        align-self: flex-end;
    }

    .convert-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .convert-actions button,
    .convert-actions a {
        flex: 1;
        min-width: 80px;
        text-align: center;
    }

    /* 移动端错误信息样式调整 */
    .convert-status.has-error-message {
        align-self: stretch;
        order: 3;
    }

    .error-message {
        font-size: 12px;
        margin-top: 6px;
    }
}

@media (max-width: 480px) {
    .upload-section {
        padding: 16px;
    }

    .section-header {
        padding: 16px;
    }

    .section-header h2 {
        font-size: 16px;
    }

    .section-header p {
        font-size: 12px;
        line-height: 1.3;
    }

    .img-dropzone {
        margin: 12px auto;
        padding: 24px 12px;
        min-height: 180px;
    }

    .upload-icon svg {
        width: 48px;
        height: 48px;
    }

    .img-dropzone h3 {
        font-size: 16px;
    }

    .img-dropzone p {
        font-size: 13px;
    }

    .upload-tips {
        flex-direction: column;
        gap: 8px;
    }

    .tip-item {
        font-size: 11px;
    }

    .convert-list {
        padding: 16px;
    }

    .format-selector-inline .format-select {
        padding: 8px 28px 8px 10px;
        font-size: 13px;
    }

    .format-selector-inline .format-select-icon {
        right: 6px;
    }

    .format-label {
        font-size: 13px;
    }

    .convert-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .convert-preview {
        width: 40px;
        height: 40px;
    }

    .convert-details h4 {
        font-size: 14px;
    }

    .convert-meta {
        font-size: 12px;
    }

    .convert-actions button,
    .convert-actions a {
        padding: 10px 12px;
        font-size: 13px;
    }

    .convert-status {
        order: 3;
        align-self: flex-end;
    }

    /* 移动端错误信息样式调整 */
    .convert-status.has-error-message {
        align-self: stretch;
        order: 3;
    }

    .error-message {
        font-size: 12px;
        margin-top: 6px;
    }

    .convert-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
} 