:root {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
}

/* ---- 工具简介段落 ---- */
.intro-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
    color: #4b5563;
}

/* ---- 支持格式标签 ---- */
.format-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.format-tag {
    padding: 4px 10px;
    background: #f3f4f6;
    color: #374151;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

/* ---- 当前文档名 ---- */
.doc-name {
    font-size: 13px;
    color: #374151;
    word-break: break-all;
    background: #f9fafb;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* ---- 提取统计 ---- */
.stat-row {
    display: flex;
    gap: 12px;
}

.stat-box {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    border-radius: 8px;
}

.stat-purple { background: #f5f3ff; }
.stat-green { background: #d1fae5; }

.stat-num {
    font-size: 20px;
    font-weight: 700;
    color: #6d28d9;
}

.stat-green .stat-num { color: #059669; }

.stat-label {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

/* ---- 右侧内容区容器 ---- */
.preview-body {
    padding: 15px;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- 上传占位 ---- */
.upload-placeholder {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 40px;
    border: 3px dashed #d1d5db;
    border-radius: 16px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-placeholder:hover,
.upload-placeholder.drag-over {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.upload-icon { font-size: 48px; }
.upload-text { font-size: 17px; font-weight: 600; color: #374151; }
.upload-hint { font-size: 13px; color: #9ca3af; }

/* ---- 进度 ---- */
.progress-wrap {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 30px 0;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #f3f4f6;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #c4b5fd, #8b5cf6);
    border-radius: 5px;
    transition: width 0.25s ease;
}

.progress-text {
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #6d28d9;
}

/* ---- 空状态（未找到图片） ---- */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
}

.empty-icon { font-size: 48px; margin-bottom: 10px; }
.empty-title { font-size: 16px; font-weight: 600; color: #374151; }
.empty-sub { font-size: 13px; margin-top: 8px; }

/* ---- 图片网格 ---- */
.image-grid {
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.image-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s;
}

.image-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.12);
}

.image-card.selected {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pick-box {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.pick-box input {
    margin: 0;
    cursor: pointer;
}

.card-index {
    font-size: 10px;
    font-weight: 600;
    color: #8b5cf6;
    background: #f5f3ff;
    padding: 2px 8px;
    border-radius: 8px;
}

.card-size {
    font-size: 10px;
    font-weight: 500;
    color: #059669;
    background: #d1fae5;
    padding: 2px 8px;
    border-radius: 8px;
}

.card-preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: repeating-conic-gradient(#ccc 0% 25%, #fff 0% 50%) 50% / 10px 10px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.card-actions {
    display: flex;
    gap: 6px;
}

.btn-mini {
    flex: 1;
    padding: 6px 4px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-mini-download {
    background: #f3f4f6;
    color: #374151;
}

.btn-mini-download:hover:not(:disabled) {
    background: #e5e7eb;
}

.btn-mini-preview {
    background: #ede9fe;
    color: #6d28d9;
}

.btn-mini-preview:hover {
    background: #ddd6fe;
}

/* ---- 预览弹窗 ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.modal-content img {
    display: block;
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    margin: 0 auto;
    background: #fff;
}

/* ---- 预览弹窗工具栏 ---- */
.modal-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
    flex-shrink: 0;
}

.modal-nav,
.modal-download {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-nav:hover {
    border-color: #8b5cf6;
    color: #6d28d9;
}

.modal-download {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #ffffff;
    border-color: transparent;
}

.modal-download:hover {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.modal-counter {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 18px;
}
