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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, rgb(102, 126, 234) 0%, rgb(118, 75, 162) 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0.25rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

.header-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

/* 主要内容 */
.main-content {
    padding: 0.1rem 0 0 0;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0.2rem 1.5rem 0 1.5rem;
    margin-bottom: 0.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.card-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.form-control.error {
    border-color: #dc3545;
}

.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 0.25rem;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

/* 商品名称单元格特殊样式 */
.table td:nth-child(3) {
    font-size: 1.1rem;
    font-weight: 500;
}

/* 操作按钮文字响应式显示 */
.short-text {
    display: none;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table-responsive {
    overflow-x: auto;
}

/* 按钮组 */
.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* 居中的按钮组 */
.btn-group-centered {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 0;
    padding: 0.2rem 0;
}

/* 确保card内的内容垂直居中 */
.card .btn-group-centered {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 0;
    padding: 0.2rem 0;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .btn-group-centered {
        flex-direction: row;
        justify-content: center;
        gap: 0.5rem;
        flex-wrap: wrap;
        padding: 0.2rem 0;
        align-items: center;
    }
    
    .btn-group-centered .btn {
        width: auto;
        margin: 0.25rem 0;
        min-width: 120px;
    }
    
    .card .btn-group-centered {
        padding: 0.2rem 0;
    }
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 12px;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 16px;
}

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #333;
}

.close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

/* 提示框样式 */
.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.alert-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 1rem;
}

.pagination .btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    background: white;
    color: #007bff;
}

.pagination .btn:hover {
    background: #e9ecef;
}

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

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

/* 搜索框样式 */
.search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0;
    padding: 0.5px;
}

.search-input {
    flex: 1;
    max-width: 300px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 2px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 0.3rem;
        padding: 0.125rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    /* 移动端操作按钮缩小 */
    .btn-sm {
        padding: 0.05rem 0.2rem;
        font-size: 8px;
        line-height: 1;
        min-height: 20px;
        height: 20px;
    }
    
    /* 移动端表格行高减小 */
    .table th,
    .table td {
        padding: 0.25rem 0.75rem;
    }
    
    /* 移动端按钮组间距减小 */
    .btn-group {
        gap: 0.15rem;
        align-items: center;
    }
    
    .table-responsive {
        font-size: 12px;
    }
    
    /* 移动端显示简短文字 */
    .short-text {
        display: inline;
    }
    
    .full-text {
        display: none;
    }
    
    /* 移动端商品名称字号减小 */
    .table td:nth-child(3) {
        font-size: 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-input {
        max-width: none;
    }
    .card-title {
        margin-bottom: 0.125rem;
    }
    .product-row {
        padding: 0.125rem 0.125rem;
    }
    
    .table tbody tr {
        height: auto;
        min-height: unset;
    }
    .footer {
        padding: 0.25rem 0;
        margin-top: 0.25rem;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 0.5rem 0.2rem 0.5rem 0.2rem;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 0.25rem 0.125rem;
        font-size: 11px;
    }
}

/* 工具类 */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

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

.align-items-center {
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

/* 价格展示样式 */
.price-display {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0.3rem 1.5rem 0 1.5rem;
    margin-bottom: 1rem;
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0;
    border-bottom: 1px solid #eee;
}

.price-item:last-child {
    border-bottom: none;
}

.price-name {
    font-weight: 400;
    color: #333;
}

.price-value {
    font-weight:400;
    color: #007bff;
    font-size: 0.9rem;
}

.price-description {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.price-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.11rem;
    padding-left: 1.6rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid #007bff;
}

.price-header-item {
    font-weight: bold;
    color: #333;
}

.sort-btn {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.sort-btn:hover {
    background: #e3f2fd;
}

/* 联系信息样式 */
.contact-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    text-align: center;
}

.contact-btn {
    background: #28a745;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.contact-btn:hover {
    background: #1e7e34;
}

/* 重复检测样式 */
.duplicate-group {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.duplicate-group h4 {
    color: #856404;
    margin-bottom: 0.5rem;
}

.duplicate-item {
    background: white;
    padding: 0.5rem;
    margin: 0.25rem 0;
    border-radius: 4px;
    border-left: 3px solid #ffc107;
}

.similarity-badge {
    background: #007bff;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 0.5rem;
}

/* 底部样式 */
.footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 0.5rem 0 0.5rem 0;
    margin-top: 0.2rem;
    width: 100%;
    position: relative;
    bottom: 0;
}

.footer-content {
    text-align: center;
    color: #6c757d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.footer-content p {
    margin: 0.125rem 0;
    font-size: 14px;
    text-align: center;
}

.footer-content p:first-child {
    font-weight: 500;
    color: #495057;
}

/* 复选框样式 */
.product-checkbox {
    margin: 0;
    cursor: pointer;
}

#selectAll {
    margin: 0;
    cursor: pointer;
}

/* 表格复选框列样式 */
.table th:first-child,
.table td:first-child {
    width: 40px;
    text-align: center;
}

/* 商品点击复制样式 */
.product-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
    padding: 0.5rem 0.25rem;
}

.product-row:hover {
    background-color: #e3f2fd !important;
}

.product-row.copied {
    background-color: #d4edda !important;
    animation: copyFlash 0.5s ease;
}

@keyframes copyFlash {
    0% { background-color: #d4edda; }
    50% { background-color: #c3e6cb; }
    100% { background-color: #d4edda; }
}

/* 滚动加载样式 */
.load-more {
    text-align: center;
    padding: 1rem;
    margin-top: 1rem;
}

.load-more-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.load-more-btn:hover {
    background: #0056b3;
}

.load-more-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
} 