/* 电商风格的产品展示样式 */

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* 容器样式 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部工具栏 */
.toolbar {
    position: sticky;
    top: 0;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    z-index: 100;
    padding: 20px 0;
}

.toolbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.breadcrumb {
    font-size: 16px;
    color: #666;
    font-weight: 400;
}

.breadcrumb::before {
    content: ' > ';
    margin: 0 5px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 按钮样式 */
.back-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.export-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.export-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.selected-count {
    font-size: 16px;
    color: #666;
}

#selectedCount {
    font-weight: 600;
    color: #007bff;
}

/* 筛选栏样式 */
.filter-bar {
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 15px 0;
    position: sticky;
    top: 81px;
    z-index: 99;
}

.filter-bar .container {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.filter-select, .search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
    font-size: 14px;
    color: #333;
    transition: border-color 0.3s ease;
}

.filter-select:hover, .search-input:hover {
    border-color: #007bff;
}

.filter-select:focus, .search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.search-input {
    width: 250px;
}

.filter-info {
    margin-left: auto;
    font-size: 14px;
    color: #666;
}

/* 产品网格 - 电商风格卡片 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 30px 0;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #f0f0f0;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #007bff;
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-image.loading {
    opacity: 0.7;
    animation: imageLoading 1.5s ease-in-out infinite alternate;
}

.product-image.loaded {
    opacity: 1;
    animation: none;
}

.image-count-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.product-info {
    padding: 16px;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.product-brand, .product-time {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.product-brand {
    background: #e3f2fd;
    color: #1976d2;
}

.product-time {
    background: #f3e5f5;
    color: #7b1fa2;
}

.product-summary {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* 分页样式 */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 40px 0;
    margin-top: 20px;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 40px;
}

.pagination-btn:hover:not(.disabled) {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination-btn.disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #dee2e6;
}

.pagination-info {
    margin: 0 15px;
    font-size: 14px;
    color: #666;
}

/* 产品详情页样式 */
.product-detail-header {
    background: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.product-detail-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.product-detail-header .product-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.image-count {
    background: #fff3cd;
    color: #856404;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

/* 详情页图片网格 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 0;
}

.gallery-item {
    position: relative;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.gallery-item a {
    display: block;
    text-decoration: none;
}

/* 图片样式 */
.gallery-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    object-position: center;
    transition: all 0.3s ease;
}

.gallery-image.loading {
    opacity: 0.7;
    animation: imageLoading 1.5s ease-in-out infinite alternate;
}

.gallery-image.loaded {
    opacity: 1;
    animation: none;
}

.gallery-image.error {
    opacity: 0.5;
    filter: grayscale(1);
}

/* 选择按钮 */
.select-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.select-btn:hover {
    background-color: #fff;
    border-color: #007bff;
}

.select-btn.selected {
    background-color: #007bff;
    border-color: #007bff;
}

.select-btn.selected::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* 选择面板 */
.selection-panel {
    background: white;
    padding: 16px;
    border-radius: 8px;
    margin-top: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

.select-all-btn, .deselect-all-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.select-all-btn:hover {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.deselect-all-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

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

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #666;
    font-size: 16px;
}

/* 错误提示 */
.error {
    text-align: center;
    padding: 60px 0;
    color: #dc3545;
    font-size: 18px;
}

/* 动画 */
@keyframes imageLoading {
    0% { opacity: 0.5; }
    100% { opacity: 0.8; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .toolbar .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .title {
        font-size: 20px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
        padding: 20px 0;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .filter-bar .container {
        justify-content: center;
        flex-direction: column;
        gap: 12px;
    }
    
    .search-input {
        width: 100%;
        max-width: 300px;
    }
    
    .pagination-container {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 12px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .pagination-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 35px;
    }
}