@charset "UTF-8";

/* =======================
   精简合并的CSS样式
   ======================= */

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 20px;
    text-align: center;
}

.header h1 {
    font-size: 32px;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
}

/* 搜索容器样式 */
.search-container {
    padding: 30px;
    background: white;
    border-bottom: 1px solid #e1e1e1;
}

.search-container h3 {
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 22px;
    font-weight: 600;
    position: relative;
    padding-bottom: 10px;
}

.search-container h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: #3498db;
    border-radius: 2px;
}

/* 搜索类型选择样式 */
.search-type-select {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 12px;
    margin-top: 5px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f1f5f9;
}

.search-type-select::-webkit-scrollbar {
    height: 6px;
}

.search-type-select::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.search-type-select::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.search-type-select button {
    flex: 0 0 auto;
    padding: 12px 18px;
    border: 2px solid #e2e8f0;
    background: white;
    color: #4a5568;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-type-select button:hover {
    border-color: #3498db;
    color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

.search-type-select button.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

/* 搜索输入框样式 */
.search-input {
    width: 100%;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    min-height: 120px;
    transition: all 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* 日期输入框特殊样式 */
.date-input {
    min-height: auto;
    height: 54px;
    padding: 12px 16px;
}

/* 搜索按钮样式 */
.search-form button[type="submit"] {
    margin-top: 20px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.3);
    display: block;
    width: 100%;
}

.search-form button[type="submit"]:hover {
    background: linear-gradient(135deg, #219653, #27ae60);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(39, 174, 96, 0.4);
}

.search-form button[type="submit"]:active {
    transform: translateY(0);
}

/* 结果表格样式 */
.results-container {
    padding: 20px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.results-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.results-count {
    color: #718096;
    font-size: 14px;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.products-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: bold;
    color: #333;
    border-bottom: 2px solid #e1e1e1;
    cursor: pointer;
    user-select: none;
}

.products-table th:hover {
    background: #e9ecef;
}

.products-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e1e1e1;
    vertical-align: top;
}

.products-table tr:hover {
    background: #f8f9fa;
}

.product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.clickable {
    color: #3498db;
    cursor: pointer;
    text-decoration: underline;
}

.clickable:hover {
    color: #2980b9;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 10px;
}

.pagination a,
.pagination span {
    padding: 8px 16px;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    text-decoration: none;
    color: #3498db;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: #3498db;
    color: white;
}

.pagination .current {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.pagination .disabled {
    color: #6c757d;
    cursor: not-allowed;
}

/* 加载动画 */
.loading {
    display: none;
    text-align: center;
    padding: 40px 0;
}

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

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

    100% {
        transform: rotate(360deg);
    }
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    width: 80%;
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.close {
    position: absolute;
    right: 15px;
    top: 10px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 0px;
    }

    .header {
        padding: 10px 0;
        margin-bottom: 20px;
    }

    .header h1 {
        font-size: 24px;
    }

    .search-container {
        padding: 20px;
    }

    .search-container h3 {
        font-size: 18px;
    }

    .search-type-select {
        gap: 4px;
    }

    .search-type-select button {
        padding: 10px 14px;
        font-size: 14px;
    }

    .search-input {
        padding: 14px;
        font-size: 14px;
    }

    .search-form button[type="submit"] {
        padding: 12px 20px;
        font-size: 15px;
    }

    .results-container {
        padding: 15px;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .products-table {
        font-size: 14px;
    }

    .products-table th,
    .products-table td {
        padding: 8px 10px;
    }

    .product-image {
        width: 40px;
        height: 40px;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 18px;
    }

    .search-type-select button {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/*分页样式   */

.page-jump input[type="number"] {
    width: 60px;
    padding: 4px;
}

.page-jump input[type="submit"] {
    padding: 4px 8px;
    margin-left: 4px;
}

/* 实时输出消息样式 */
.progress-message {
    padding: 10px 15px;
    margin: 5px 0;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
    font-size: 14px;
    color: #1565c0;
}

.success-message {
    padding: 10px 15px;
    margin: 5px 0;
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    border-radius: 4px;
    font-size: 14px;
    color: #2e7d32;
}

.error-message {
    padding: 10px 15px;
    margin: 5px 0;
    background: #ffebee;
    border-left: 4px solid #f44336;
    border-radius: 4px;
    font-size: 14px;
    color: #c62828;
}

.warning-message {
    padding: 10px 15px;
    margin: 5px 0;
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    font-size: 14px;
    color: #ff8f00;
}

.collection-results {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    background: #fafafa;
}

/* 新增采集控制样式 */
.collection-controls {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    align-items: center;
}

.btn-start {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.btn-stop {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.btn-start:disabled,
.btn-stop:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.progress-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 10px;
    margin: 10px 0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    transition: width 0.3s ease;
    width: 0%;
}

.collection-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.stat-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 15px;
    text-align: center;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
}

.real-time-log {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 15px;
    background: #f8f9fa;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.log-entry {
    margin: 5px 0;
    padding: 5px;
    border-left: 3px solid transparent;
}

.log-info {
    border-left-color: #3498db;
    background: #e3f2fd;
}

.log-success {
    border-left-color: #27ae60;
    background: #e8f5e9;
}

.log-error {
    border-left-color: #e74c3c;
    background: #ffebee;
}

.log-warning {
    border-left-color: #f39c12;
    background: #fff8e1;
}
/* 表格容器样式 */
.table-container {
    position: relative;
    overflow: auto;
    max-height: 600px;
    border: 1px solid #e1e1e1;
}

/* 固定表头 */
.products-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8f9fa;
}

/* 固定前两列（图片和JAN代码） */
.products-table th:nth-child(1),
.products-table td:nth-child(1),
.products-table th:nth-child(2),
.products-table td:nth-child(2) {
    position: sticky;
    background: white;
    z-index: 5;
}

.products-table th:nth-child(1),
.products-table td:nth-child(1) {
    left: 0;
    min-width: 80px;
}

.products-table th:nth-child(2),
.products-table td:nth-child(2) {
    left: 80px; /* 第一列宽度 */
    min-width: 120px;
}

/* 确保固定列有阴影效果 */
.products-table th:nth-child(2),
.products-table td:nth-child(2) {
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

/* 表格样式调整 */
.products-table {
    width: auto;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.products-table th,
.products-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* 产品图片样式调整 */
.product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}