/* ==================== 文档转图片功能样式 ==================== */

.converter-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.converter-container:hover {
    box-shadow: var(--box-shadow-hover);
}

.converter-preview {
    padding: 2rem;
}

.converter-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
    min-height: 600px;
}

/* 文件信息区域 */
.file-info-section h4,
.preview-section h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
}

.file-info-box,
.preview-box {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: var(--border-radius-small);
    height: 560px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow-y: auto;
}

.file-upload-prompt {
    text-align: center;
    color: var(--light-text);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 560px;
}

.file-upload-prompt:hover {
    color: var(--primary-color);
    transform: translateY(-5px);
}

.file-upload-prompt svg {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.file-upload-prompt p {
    margin: 0.5rem 0;
    font-size: 1rem;
    font-weight: 500;
}

.file-upload-prompt .file-types {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* 文件信息显示 */
.file-info-display {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    min-height: 560px;
}

.file-icon-wrapper {
    position: relative;
}

.file-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.file-icon.pdf {
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5A52 100%);
}

.file-icon.ppt {
    background: linear-gradient(135deg, #FFA94D 0%, #FF8C42 100%);
}

.file-icon.word {
    background: linear-gradient(135deg, #4FC3F7 0%, #29B6F6 100%);
}

.file-icon svg {
    width: 48px;
    height: 48px;
    fill: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.file-details {
    text-align: center;
    width: 100%;
}

.file-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    word-break: break-all;
}

.file-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--light-text);
}

.file-meta-item {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

/* 预览区域 */
.preview-empty {
    text-align: center;
    color: var(--light-text);
    width: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 560px;
}

.preview-empty p {
    font-size: 1rem;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    width: 100%;
    padding: 1rem;
    align-content: start;
}

.preview-item {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.preview-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
    text-align: center;
    line-height: 1.2;
}

.preview-single {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

.preview-single img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
}

.preview-single img:hover {
    transform: scale(1.02);
}

/* 转换控制区域 */
.converter-controls {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: var(--border-radius-small);
    min-height: 240px;
}

.control-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
}

/* 转换参数容器 */
.convert-params-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.convert-mode-row,
.quality-mode-row,
.page-range-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.convert-mode-row {
    position: relative;
    min-height: 32px;
}

.convert-mode-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.convert-mode-row label,
.quality-mode-row label,
.page-range-row label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
    width: 95px;
    flex-shrink: 0;
}

.output-format-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
}

.output-format-row .control-group {
    width: calc(50% - 0.5rem);
}

.control-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

/* 单选按钮组 - 横向排列 */
.radio-group {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    align-items: center;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 0.95rem;
    font-weight: 400 !important;
    transition: all 0.2s ease;
}

.radio-label:hover .radio-custom {
    border-color: var(--primary-color);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--primary-color);
    border-width: 2px;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
}

/* 格式选择 */
.format-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.format-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 页数范围输入 */
.page-range-inputs {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-color);
}

.page-range-inputs span {
    white-space: nowrap;
    flex-shrink: 0;
}

.page-input {
    width: 60px;
    padding: 0.4rem 0.3rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    text-align: center;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.page-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 放大数字调节箭头 */
.page-input::-webkit-inner-spin-button,
.page-input::-webkit-outer-spin-button {
    opacity: 1;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.page-input::-webkit-inner-spin-button:hover,
.page-input::-webkit-outer-spin-button:hover {
    background-color: rgba(99, 102, 241, 0.1);
}

/* 操作按钮 - 使用更高优先级覆盖全局样式 */
.converter-controls .action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.converter-controls .convert-btn,
.converter-controls .download-btn {
    padding: 0 !important;
    margin-top: 0 !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    line-height: 1 !important;
    width: 100% !important;
}

.convert-btn svg,
.download-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.convert-btn {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(6, 182, 212, 0.3);
}

.convert-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(6, 182, 212, 0.4);
}

.convert-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.download-btn {
    background: var(--gradient-feature1);
    color: white;
    box-shadow: 0 4px 6px rgba(79, 172, 254, 0.25);
}

.download-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(79, 172, 254, 0.35);
}

.download-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 结果信息 */
.result-info {
    position: absolute;
    top: 0;
    right: 75px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    font-size: 0.9rem;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.result-info .info-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.result-info .info-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.result-info .info-label {
    color: var(--text-color);
    font-weight: 700;
}

.result-info .info-value {
    color: var(--text-color);
    font-weight: 400;
}

/* 进度提示 */
.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-content {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: modalFadeIn 0.3s ease-out;
}

.progress-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    border: 4px solid #f3f4f6;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .converter-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .control-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .converter-preview {
        padding: 1.5rem;
    }

    .file-info-box,
    .preview-box {
        min-height: 350px;
        padding: 1.5rem;
    }

    .preview-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .action-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .converter-preview {
        padding: 1rem;
    }

    .converter-controls {
        padding: 1.5rem;
    }

    .file-icon {
        width: 60px;
        height: 60px;
    }

    .file-icon svg {
        width: 36px;
        height: 36px;
    }

    .preview-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0.5rem;
    }
}
