/* 图片转PDF - 样式文件 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 24px;
}

header {
    text-align: center;
    margin-bottom: 24px;
}

h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 8px;
}

.subtitle {
    color: #666;
    font-size: 14px;
}

/* 上传区域 */
.upload-section {
    margin-bottom: 24px;
}

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

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-hint svg {
    color: #667eea;
    margin-bottom: 16px;
}

.upload-hint p {
    color: #333;
    font-size: 16px;
    margin-bottom: 8px;
}

.upload-hint .small {
    color: #999;
    font-size: 12px;
}

/* 图片列表区域 */
.images-section {
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h2 {
    color: #333;
    font-size: 18px;
}

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

.sort-hint {
    color: #999;
    font-size: 12px;
    margin-bottom: 12px;
}

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

.image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: grab;
    background: #eee;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.image-item:hover {
    border-color: #667eea;
}

.image-item.sortable-ghost {
    opacity: 0.4;
}

.image-item.sortable-chosen {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-item .delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s;
}

.image-item:hover .delete-btn {
    opacity: 1;
}

.image-item .order-number {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

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

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: #666;
}

/* 响应式 - 手机端 */
@media (max-width: 600px) {
    body {
        padding: 12px;
    }

    .container {
        padding: 16px;
        border-radius: 12px;
    }

    h1 {
        font-size: 22px;
    }

    .upload-area {
        padding: 30px 16px;
    }

    .upload-hint svg {
        width: 36px;
        height: 36px;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .actions {
        justify-content: space-between;
    }

    .btn {
        padding: 12px 16px;
        flex: 1;
        text-align: center;
    }

    .image-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .image-item .delete-btn {
        opacity: 1;
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
}