/* ========================================
   图片转文档功能样式
   ======================================== */

/* 容器样式 - 与其他页面保持一致 */
.imagetodoc-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;
}

.imagetodoc-container:hover {
    box-shadow: var(--box-shadow-hover);
}

.imagetodoc-preview {
    padding: 2rem;
}

/* 内容布局 - 左右两栏 */
.imagetodoc-content {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    min-height: 500px;
}

/* 左侧缩略图区域 */
.imagetodoc-thumbnails-section {
    flex: 1;
    min-width: 0;
}

.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-height: 750px;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

/* 缩略图卡片 */
.thumbnail-card {
    position: relative;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: grab;
}

.thumbnail-card:active {
    cursor: grabbing;
}

.thumbnail-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.thumbnail-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.thumbnail-image-wrapper {
    width: 100%;
    padding-top: 100%;
    position: relative;
    background: #f0f0f0;
    overflow: hidden;
}

.thumbnail-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.thumbnail-card:hover .thumbnail-image {
    transform: scale(1.05);
}

/* 删除按钮 */
.thumbnail-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(255, 59, 48, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.thumbnail-card:hover .thumbnail-delete-btn {
    opacity: 1;
}

.thumbnail-delete-btn:hover {
    background: #ff3b30;
    transform: scale(1.1);
}

/* 右侧控制面板 */
.imagetodoc-controls {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 继续添加图片按钮 */
.add-images-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(6, 182, 212, 0.3);
}

.add-images-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(6, 182, 212, 0.4);
}

/* 控制组 */
.imagetodoc-controls .control-group {
    margin-bottom: 1.5rem;
}

.imagetodoc-controls .control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #333;
}

/* 单选按钮组 */
.imagetodoc-container .radio-group {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    align-items: center;
}

.imagetodoc-container .radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.imagetodoc-container .radio-label:hover {
    background: #f8f9fa;
}

.imagetodoc-container .radio-label input[type="radio"] {
    display: none;
}

.imagetodoc-container .radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
}

.imagetodoc-container .radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #667eea;
}

.imagetodoc-container .radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #667eea;
    border-radius: 50%;
}

/* 输出方式选项 - 卡片式风格 */
.output-mode-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.output-mode-option {
    flex: 1;
    min-width: calc(50% - 0.25rem);
    padding: 0.75rem 0.5rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.output-mode-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.output-mode-option.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea15, #764ba215);
}

.output-mode-option input[type="radio"] {
    display: none;
}

.output-mode-option .option-label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.output-mode-option.active .option-label {
    color: #667eea;
}

/* 页面尺寸选项 */
.page-size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.page-size-option {
    flex: 1;
    min-width: calc(50% - 0.25rem);
    padding: 0.75rem 0.5rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-size-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.page-size-option.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea15, #764ba215);
}

.page-size-option input[type="radio"] {
    display: none;
}

.option-label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.page-size-option.active .option-label {
    color: #667eea;
}

/* 转换按钮 */
.convert-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: auto;
}

.convert-doc-btn {
    width: 100%;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.convert-doc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.convert-doc-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.pdf-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #c92a2a 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.pdf-btn:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.ppt-btn {
    background: linear-gradient(135deg, #ff922b 0%, #fd7e14 100%);
    box-shadow: 0 4px 15px rgba(255, 146, 43, 0.3);
}

.ppt-btn:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(255, 146, 43, 0.4);
}

.word-btn {
    background: linear-gradient(135deg, #4c9aff 0%, #0078d4 100%);
    box-shadow: 0 4px 15px rgba(76, 154, 255, 0.3);
}

.word-btn:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(76, 154, 255, 0.4);
}

/* 进度叠加层 */
.imagetodoc-container .progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.imagetodoc-container .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;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.imagetodoc-container .progress-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: imagetodoc-spin 1s linear infinite;
}

@keyframes imagetodoc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.imagetodoc-container .progress-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* 空状态 */
.thumbnails-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: #999;
}

.thumbnails-empty svg {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.thumbnails-empty p {
    font-size: 16px;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .imagetodoc-content {
        flex-direction: column;
    }

    .imagetodoc-controls {
        width: 100%;
    }

    .thumbnails-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .thumbnails-grid {
        grid-template-columns: repeat(2, 1fr);
        max-height: 400px;
    }

    .page-size-option {
        min-width: 100%;
    }
}
