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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    min-height: 100vh;
}

/* 为共享导航菜单设置特殊样式，确保在所有页面上显示一致 */
#shared-navigation-container {
    margin-bottom: 0 !important;
}

h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #3498db, #2980b9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 20px 0;
}

/* 确保容器与导航栏之间有适当的间距 */
.container {
    max-width: 1400px;
    margin: 25px auto 0 auto;
    padding: 0 20px;
    position: relative;
}

.section {
    margin-bottom: 30px;
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.section:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #3498db, #2980b9);
}

.section-title {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    position: relative;
    font-weight: 600;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 2px;
}

/* 筛选区域样式 */
.filter-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
    position: relative;
}

.filter-section h3 {
    color: #495057;
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 600;
}

/* 筛选区域的选择框特殊样式 - 移除默认箭头 */
.filter-section select {
    background-image: none;
    padding-right: 16px;
}

/* 为筛选区域添加统一的筛选指示器 */
.filter-section::before {
    content: '';
    position: absolute;
    top: 20px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #6b7280;
    pointer-events: none;
    z-index: 1;
}

/* 表格中开票税点列的选择框特殊样式 - 移除默认箭头 */
.tax-rate-select {
    background-image: none !important;
    padding-right: 8px !important;
}

/* 输入区域样式 */
.input-section {
    margin-bottom: 25px;
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.input-section:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

/* 输入框组样式 */
.input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}

/* 统一输入项的宽度比例 */
.input-group .input-item {
    flex: 1;
    min-width: 220px;
    position: relative;
}

/* 标签样式 */
label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

/* 统一所有输入框和选择框的样式 */
input[type="text"], 
input[type="number"], 
select, 
.unified-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: #ffffff;
    color: #495057;
    font-family: inherit;
}

input[type="text"]:focus, 
input[type="number"]:focus, 
select:focus, 
.unified-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background-color: #ffffff;
}

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 48px;
}

/* 百分比输入框样式 */
.percentage-input {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 0;
    border: 1px solid #e9ecef;
}

/* 按钮容器样式 */
.buttons-container {
    text-align: center;
    margin-top: 30px;
}

.export-buttons {
    text-align: center;
    padding: 30px 0;
}

/* 按钮样式 */
.button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 28px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 0.95rem;
    margin: 0 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
    min-width: 120px;
}

.button:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

/* 表格容器样式 */
.table-container {
    overflow-x: auto;
    margin-top: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* 产品列表表格样式 */
.product-list {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.product-list th, .product-list td {
    padding: 16px 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.product-list th {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.product-list tbody tr {
    transition: all 0.3s ease;
}

.product-list tbody tr:hover {
    background-color: #f8f9fa;
}

.product-list tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

/* 复选框列样式 */
.product-list th.checkbox-header,
.product-list td.checkbox-column {
    min-width: 50px !important;
    width: 50px !important;
    max-width: 50px !important;
    text-align: center;
    padding: 12px 8px !important;
}

.product-list th.checkbox-header input[type="checkbox"],
.product-list td.checkbox-column input[type="checkbox"] {
    transform: scale(1.2);
    cursor: pointer;
}

/* 批量操作区域样式 */
.batch-operations {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 批量修改区域样式 */
.batch-edit-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.batch-edit-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.batch-edit-header h4 {
    margin: 0;
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
}

.batch-edit-subtitle {
    color: #6c757d;
    font-size: 0.9rem;
    font-style: italic;
}

.edit-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.edit-row:last-child {
    margin-bottom: 0;
}

.edit-item.compact {
    flex: 1;
    min-width: 200px;
    background: #ffffff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.edit-item.compact:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #3498db;
    transform: translateY(-2px);
}

.edit-item.compact label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.2;
}

.edit-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.edit-input, .edit-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #ffffff;
    transition: all 0.3s ease;
}

.edit-input:focus, .edit-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

.edit-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 45px;
}

.edit-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.calculate-btn {
    background: linear-gradient(135deg, #28a745, #1e7e34);
}

.calculate-btn:hover {
    background: linear-gradient(135deg, #1e7e34, #155724);
}

/* 分页控制区域 */
.pagination-controls {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

/* 货源链接样式 */
.source-link {
    color: #007bff;
    text-decoration: none;
    max-width: 200px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-weight: 500;
}

.source-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.source-link:visited {
    color: #6f42c1;
}

.source-link-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 平台SKU列特殊样式 - 支持俄文字符显示 */
.product-list td:nth-child(2) {
    font-family: 'Roboto', 'Open Sans', 'Segoe UI', 'Arial Unicode MS', 'Lucida Grande', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #2c3e50;
    word-break: break-all;
    white-space: normal;
    line-height: 1.4;
    padding: 12px 8px;
    unicode-bidi: embed;
    direction: ltr;
}

/* 可编辑单元格样式 */
.editable-cell {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 4px;
    padding: 4px 8px;
}

.editable-cell:hover {
    background-color: #e3f2fd;
    box-shadow: 0 0 0 1px rgba(52, 152, 219, 0.3);
}

.editable-cell:active {
    background-color: #bbdefb;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .input-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .input-item {
        min-width: 100%;
    }
    
    .edit-row {
        flex-direction: column;
    }
    
    .edit-item.compact {
        min-width: 100%;
    }
    
    .button {
        width: 100%;
        margin: 8px 0;
    }
    
    .table-container {
        margin: 0 -15px;
        width: calc(100% + 30px);
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 15px;
    }
    
    .batch-edit-section {
        padding: 15px;
    }
    
    .edit-item.compact {
        padding: 12px;
    }
}

/* 滚动条美化 */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
}

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

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

/* 成功提示样式 */
.success-message {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid #c3e6cb;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15);
}

/* 警告提示样式 */
.warning-message {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid #ffeaa7;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.15);
}