/**
 * 转换器页面基础样式
 * 为所有转换器页面提供统一的样式规范
 */

/* 转换器容器 */
.converter-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

/* 步骤指示器 */
.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    max-width: 200px;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background-color: #3b82f6;
    color: white;
}

.step.completed .step-number {
    background-color: #10b981;
    color: white;
}

.step-title {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    transition: color 0.3s ease;
}

.step.active .step-title {
    color: #3b82f6;
    font-weight: 600;
}

.step.completed .step-title {
    color: #10b981;
    font-weight: 600;
}

/* 步骤连接线 */
.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: calc(50% + 20px);
    width: calc(100% - 40px);
    height: 2px;
    background-color: #e5e7eb;
    transition: background-color 0.3s ease;
}

.step.completed:not(:last-child)::after {
    background-color: #10b981;
}

/* 转换器区域 */
.converter-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.converter-section.hidden {
    display: none;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
}

.upload-area.dragover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: #9ca3af;
}

.upload-text {
    font-size: 1.125rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.875rem;
    color: #6b7280;
}

/* 文件列表 */
.file-list {
    margin-top: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background-color: #f9fafb;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.file-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.file-icon {
    width: 24px;
    height: 24px;
    margin-right: 0.75rem;
    color: #ef4444;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.file-size {
    font-size: 0.875rem;
    color: #6b7280;
}

.file-remove {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.file-remove:hover {
    color: #ef4444;
}

/* 进度条 */
.progress-container {
    margin: 2rem 0;
}

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

.converter-progress-fill {
    height: 100%;
    background-color: #3b82f6;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    margin-top: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* 结果区域 */
.result-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-item {
    padding: 1rem;
    background-color: #f9fafb;
    border-radius: 6px;
}

.result-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.result-value {
    font-weight: 500;
    color: #374151;
}

/* 错误区域 */
.error-message {
    padding: 1rem;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc2626;
    margin-bottom: 1rem;
}

/* 按钮兼容性样式 - 确保与style.css中的.btn类兼容 */
.converter-section .btn {
    /* 继承style.css中的基础按钮样式 */
}

/* 转换器专用按钮样式 */
.converter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    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;
    gap: 0.5rem;
}

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

.converter-btn-primary {
    background-color: #3b82f6;
    color: white;
}

.converter-btn-primary:hover:not(:disabled) {
    background-color: #2563eb;
}

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

.converter-btn-secondary:hover:not(:disabled) {
    background-color: #4b5563;
}

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

.converter-btn-success:hover:not(:disabled) {
    background-color: #059669;
}

.converter-btn-outline {
    background-color: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.converter-btn-outline:hover:not(:disabled) {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

/* 按钮组 */
.converter-btn-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* 功能说明区域 */
.feature-info {
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 2rem;
    margin-top: 3rem;
}

.info-grid {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
}

.info-item {
    flex: 1;
    min-width: 200px;
    text-align: center;
    padding: 1.5rem;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.info-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.info-item p {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1.5rem;
    text-align: center;
}

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

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

.feature-item h4 {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .converter-container {
        padding: 1rem;
    }
    
    .converter-section {
        padding: 1.5rem;
    }
    
    .step-indicator {
        margin-bottom: 2rem;
    }
    
    .step-title {
        font-size: 0.75rem;
    }
    
    .result-info {
        grid-template-columns: 1fr;
    }
    
    .converter-btn-group {
        flex-direction: column;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        flex-direction: column !important;
        gap: 1rem;
    }
    
    .info-item {
        min-width: auto;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .step-indicator {
        flex-direction: row;
        gap: 0.5rem;
        overflow-x: auto;
        padding: 0 0.5rem;
    }
    
    .step {
        flex-direction: column;
        min-width: 80px;
        max-width: 120px;
    }
    
    .step:not(:last-child)::after {
        top: 20px;
        left: calc(50% + 40px);
    }
    
    .info-grid {
        flex-direction: column !important;
        gap: 0.75rem;
    }
    
    .info-item {
        min-width: auto;
        padding: 1rem 0.75rem;
    }
    
    .info-item h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .info-item p {
        font-size: 0.8rem;
    }
    
    .step:not(:last-child)::after {
        width: calc(100% - 80px + 0.5rem);
        height: 2px;
        background-color: #e5e7eb;
    }
    
    .step-number {
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
    
    .step-title {
        font-size: 0.75rem;
        text-align: center;
    }
}

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

.converter-section:not(.hidden) {
    animation: fadeIn 0.3s ease;
}

/* 加载动画 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

/* 缩略图区域样式 */
.thumbnail-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin: 2rem 0;
}

.thumbnail-section.hidden {
    display: none;
}

.thumbnail-header {
    text-align: center;
    margin-bottom: 2rem;
}

.thumbnail-header h3 {
    color: #374151;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.thumbnail-header p {
    color: #6b7280;
    font-size: 1rem;
}

.thumbnail-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: flex-start;
}

.thumbnail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.thumbnail-page {
    position: relative;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.thumbnail-page:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.thumbnail-page img {
    display: block;
    max-width: 150px;
    max-height: 200px;
    width: auto;
    height: auto;
}

.page-number {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    padding: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.split-control {
    margin: 0.5rem 0;
    display: flex;
    justify-content: center;
}

.split-btn {
    background: #f3f4f6;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6b7280;
}

.split-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    color: #374151;
    transform: scale(1.1);
}

.split-control.active .split-btn {
    background: #3b82f6;
    border-color: #2563eb;
    color: white;
    transform: scale(1.1);
}

.split-control.active .split-btn:hover {
    background: #2563eb;
    border-color: #1d4ed8;
}

.split-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 2rem;
    text-align: center;
}

.split-info p {
    margin: 0.25rem 0;
    color: #374151;
    font-size: 0.875rem;
}

.split-info p:first-child {
    font-weight: 600;
    color: #1f2937;
}

.convert-action {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.convert-action .btn {
    min-width: 200px;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
}

.thumbnail-loading {
    text-align: center;
    padding: 3rem 2rem;
}

.thumbnail-loading .loading {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.thumbnail-loading p {
    color: #6b7280;
    font-size: 1rem;
}

.thumbnail-error {
    text-align: center;
    padding: 2rem;
}

.thumbnail-error p {
    color: #ef4444;
    font-size: 1rem;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .thumbnail-grid {
        gap: 0.75rem;
    }
    
    .thumbnail-page img {
        max-width: 120px;
        max-height: 160px;
    }
    
    .split-btn {
        width: 40px;
        height: 40px;
    }
    
    .thumbnail-section {
        padding: 1.5rem;
    }
    
    .thumbnail-header h3 {
        font-size: 1.25rem;
    }
}

/* 压缩等级选择样式 */
.compression-level-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.compression-level-section h3 {
    margin: 0 0 1rem 0;
    color: #1e293b;
    font-size: 1.125rem;
    font-weight: 600;
}

.compression-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.compression-option {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.compression-option:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.compression-option input[type="radio"] {
    margin: 0.25rem 0.75rem 0 0;
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
    cursor: pointer;
}

.compression-option input[type="radio"]:checked + .option-content {
    color: #1e293b;
}

.compression-option:has(input[type="radio"]:checked) {
    border-color: #3b82f6;
    background: #eff6ff;
}

.option-content {
    flex: 1;
}

.option-title {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.option-desc {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .compression-level-section {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .compression-option {
        padding: 0.75rem;
    }
    
    .option-title {
        font-size: 0.9rem;
    }
    
    .option-desc {
        font-size: 0.8rem;
    }
}