/* JPG转WebP工具样式 */

.tool-page-section {
    padding: 100px 0 40px;
}

.tool-card-wrapper {
    margin-bottom: 40px;
}

.tool-header {
    text-align: center;
    margin-bottom: 30px;
}

.tool-header h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: #333;
}

.tool-header p {
    font-size: 1.1em;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.tool-info-card {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-top: 30px;
}

.info-content {
    margin-top: 15px;
    line-height: 1.8;
}

.info-content h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #555;
}

.info-content p {
    margin-bottom: 10px;
    color: #666;
}

.info-content ul {
    margin: 10px 0 20px 20px;
    padding: 0;
}

.info-content li {
    margin-bottom: 8px;
    color: #666;
}

.info-content ol {
    margin: 10px 0 20px 20px;
    padding: 0;
}

.faq-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.faq-item:last-child {
    border-bottom: none;
}

.tool-advantage {
    margin: 30px 0;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    text-align: center;
}

.tool-advantage p {
    margin: 0;
    font-size: 14px;
    color: #333;
}

/* 上传区域 */
.upload-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}

.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-area.has-files {
    padding: 16px;
    cursor: default;
    border-style: solid;
    border-color: #10b981;
    background: #f0fdf4;
}

.upload-area.has-files .upload-default {
    display: none;
}

.upload-area.has-files .file-info-summary {
    display: block;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #6366f1;
    background: #f0f0ff;
}

.upload-area.has-files:hover {
    border-color: #10b981;
    background: #f0fdf4;
}

.upload-icon {
    font-size: 48px;
    color: #6366f1;
    margin-bottom: 16px;
}

.upload-area.has-files .upload-icon {
    font-size: 24px;
    color: #10b981;
    margin-bottom: 8px;
}

.upload-area h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
}

.upload-area.has-files h3 {
    font-size: 14px;
    margin-bottom: 4px;
}

.upload-area p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #666;
}

.upload-area.has-files p {
    font-size: 12px;
    margin-bottom: 8px;
}

/* 文件信息展示 */
.file-info-summary {
    display: none;
    text-align: left;
    max-height: 150px;
    overflow-y: auto;
    margin: 12px 0;
    padding: 12px;
    background: white;
    border-radius: 8px;
}

.upload-area.has-files .file-info-summary {
    display: block;
}

.file-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.file-count-info {
    font-size: 13px;
    color: #666;
}

.file-count-info strong {
    color: #10b981;
    font-size: 15px;
}

.file-total-size {
    font-size: 13px;
    color: #666;
}

.file-total-size strong {
    color: #333;
}

.file-list {
    max-height: 100px;
    overflow-y: auto;
}

.file-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
    border-bottom: 1px dashed #f0f0f0;
}

.file-list-item:last-child {
    border-bottom: none;
}

.file-list-name {
    color: #333;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.file-list-size {
    color: #999;
    white-space: nowrap;
}

.summary-actions {
    text-align: center;
    margin-top: 12px;
}

.summary-actions .upload-btn {
    padding: 8px 16px;
    font-size: 13px;
}

.upload-btn {
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.upload-btn:hover {
    background: #4f46e5;
}

/* URL上传 */
.url-upload {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.url-upload label {
    font-size: 14px;
    color: #666;
    margin-right: 12px;
}

.url-input-group {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.url-input-group input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
}

/* 选项区域 */
.options-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}

.options-section h2 {
    margin-bottom: 20px;
    color: #333;
}

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

.option-item {
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.option-item label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    color: #333;
}

.option-hint {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

/* 自定义后缀输入框 */
.custom-suffix input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
}

.custom-suffix input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 上传区域隐藏 */
.upload-section.hidden {
    display: none;
}

/* 滑块样式 */
#qualitySlider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
}

#qualitySlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
}

#qualityValue {
    color: #6366f1;
    font-weight: 600;
}

/* 复选框和单选框 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 文件列表 */
.files-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}

.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.files-header h2 {
    margin: 0;
    color: #333;
}

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

.files-list {
    min-height: 150px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state p {
    margin: 0;
}

/* 文件项 */
.file-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-item.dragging {
    opacity: 0.5;
}

.file-icon {
    width: 48px;
    height: 48px;
    background: #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 24px;
    color: #666;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.file-size {
    font-size: 12px;
    color: #999;
}

.file-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
}

.status-text {
    font-size: 13px;
}

.status-pending {
    color: #f59e0b;
}

.status-converting {
    color: #3b82f6;
}

.status-completed {
    color: #10b981;
}

.status-error {
    color: #ef4444;
}

.progress-bar {
    width: 100px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width 0.3s ease;
}

.file-actions {
    display: flex;
    gap: 8px;
    margin-left: 16px;
}

.file-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.file-action-btn:hover {
    background: #e5e7eb;
    color: #333;
}

/* 预览区域 */
.preview-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.preview-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.preview-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: center;
}

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

.preview-item h3 {
    margin-bottom: 16px;
    font-size: 16px;
    color: #555;
}

.preview-image-container {
    max-width: 100%;
    max-height: 300px;
    overflow: hidden;
    border-radius: 8px;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-image-container img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.preview-info {
    margin-top: 12px;
}

.preview-info .file-size {
    font-size: 14px;
    color: #666;
}

.size-difference {
    display: inline-block;
    margin-left: 12px;
    padding: 4px 12px;
    background: #10b981;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.preview-arrow {
    font-size: 24px;
    color: #6366f1;
    font-weight: bold;
}

/* 按钮样式 */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.primary-btn:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

.secondary-btn {
    background: #e5e7eb;
    color: #333;
}

.secondary-btn:hover {
    background: #d1d5db;
}

.success-btn {
    background: #10b981;
    color: white;
}

.success-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.danger-btn {
    background: #ef4444;
    color: white;
}

.danger-btn:hover {
    background: #dc2626;
}

/* Toast通知 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
    z-index: 1000;
    animation: fadeInUp 0.3s ease;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .tool-header h1 {
        font-size: 2em;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .url-input-group {
        flex-direction: column;
    }
    
    .preview-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .preview-arrow {
        display: none;
    }
    
    .files-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .files-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .files-actions .btn {
        flex: 1;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .tool-header h1 {
        font-size: 1.8em;
    }
    
    .upload-area {
        padding: 24px 12px;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .file-status {
        margin-left: 0;
    }
    
    .file-actions {
        margin-left: 0;
    }
}