/* AmzTools - 样式文件 */

/* 分类标签样式 */
.category-tag.active {
    opacity: 0.8;
    font-weight: 600;
    border: 2px solid #333 !important;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #ffffff;
    color: #333;
    line-height: 1.6;
}

.container {
    margin: 0 auto;
    padding: 20px;
}

/* 导航栏 */
.nav {
    background-color: #232f3e;
    color: white;
    margin-bottom: 20px;
}

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

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

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links a:hover {
    background-color: #37475a;
}

/* 按钮 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background-color: #e88a00;
}

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

.btn-secondary:hover {
    background-color: #5a6268;
}

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

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

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

.btn-success:hover {
    background-color: #218838;
}

/* 通用模态框 */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}

.modal-header {
    margin-bottom: 12px;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

/* 功能属性标签 */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #eef5ff;
    color: #1f3b57;
    border: 1px solid #d0e2ff;
    border-radius: 14px;
    font-size: 12px;
    line-height: 1.4;
}

/* 分类选择 */
.category-select-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    min-height: 50px;
}

.category-select-group label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 2px solid #dee2e6;
    border-radius: 20px;
    font-size: 13px;
    line-height: 16px;
    font-weight: 500;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
}

.category-select-group label:hover {
    border-color: #adb5bd;
    background: #f8f9fa;
}

.category-select-group label input {
    margin: 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #ff9900;
    flex-shrink: 0;
    vertical-align: middle;
}

.category-select-group label .category-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.category-select-group label.selected {
    border-color: #ff9900;
    background: #fff7ec;
    color: #cc7700;
    font-weight: 600;
}

.category-select-group label.selected:hover {
    border-color: #e88a00;
    background: #ffe8cc;
}

.category-select-group label.selected .category-color-dot {
    transform: scale(1.1);
}

.category-select-empty {
    font-size: 13px;
    color: #6c757d;
    font-style: italic;
    padding: 8px 0;
}



/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

/* 在form-row中，form-group可以自适应宽度，不占满整个grid cell */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-start;
}

.form-row .form-group {
    flex: 0 1 auto;
    min-width: 180px;
    max-width: 100%;
}


.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #ff9900;
}

/* 图片预览样式 */
#image-preview {
    transition: opacity 0.3s;
    display: none;
}

#image-preview.show {
    display: block;
}

#preview-img {
    display: block;
    padding: 5px;
    background: white;
    height: 42px; /* 与输入框高度一致（padding 10px * 2 + line-height） */
    width: auto;
    object-fit: contain;
    transition: all 0.3s ease;
    cursor: pointer;
}

#image-preview:hover #preview-img {
    height: 150px;
    width: 150px;
    position: absolute;
    z-index: 1000;
}


/* 卡片 */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

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

.card-header h2 {
    font-size: 20px;
    color: #232f3e;
}

.card-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 让草稿列表中的搜索框跟标题水平排列 */
.card-header-left .search-box {
    margin-bottom: 0;
}


/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.table th,
.table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

/* 产品主行样式 */
.product-main-row {
    border-bottom: 1px solid #e0e0e0;
}

.product-main-row td {
    text-align: center;
    vertical-align: middle;
}

/* 操作按钮垂直排列 */
.action-buttons-vertical {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

/* 站点数据行样式 */
.product-sites-row {
    background-color: #fafafa;
    border-bottom: 1px solid #e0e0e0;
}

.product-sites-row td {
    padding: 15px 12px;
    border-bottom: none;
    text-align: left;
    vertical-align: middle;
}

.sites-container {
    padding: 15px 12px !important;
}

/* 链接按钮行样式 */
.product-links-row {
    background-color: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
}

.product-links-row td {
    padding: 10px 12px;
    border-bottom: none;
    text-align: left;
    vertical-align: middle;
}

.links-container {
    padding: 10px 12px !important;
}

.product-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-link {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    color: white;
    font-weight: 500;
}

.btn-amazon {
    background-color: #ff9900;
}

.btn-amazon:hover {
    background-color: #e88a00;
    transform: translateY(-1px);
}

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

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

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

.btn-1688:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #232f3e;
    text-align: center;
}

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

/* 站点标签 */
.site-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.site-badge.de {
    background-color: #ffd700;
    color: #333;
}

.site-badge.fr {
    background-color: #0055a4;
    color: white;
}

.site-badge.it {
    background-color: #009246;
    color: white;
}

.site-badge.es {
    background-color: #c60b1e;
    color: white;
}

/* 提示信息 */
.alert {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* 全局提示动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

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

/* 计算结果显示 */
.calc-result {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    margin-top: 0;
}

.calc-result-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.calc-result-item strong {
    color: #232f3e;
}

/* 站点数据对比 */
.sites-comparison {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.site-data {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #ff9900;
}

.site-data h4 {
    margin-bottom: 10px;
    color: #232f3e;
}

.site-data-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 14px;
}

/* 选品列表中的紧凑站点数据显示 */
.sites-comparison-compact {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.site-data-compact {
    background: white;
    border-radius: 6px;
    border-left: 3px solid #ff9900;
    padding: 10px 12px;
    min-width: 200px;
    flex: 0 0 auto;
    transition: transform 0.2s;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
}

/* 根据站点设置不同的左边框颜色 */
.site-data-compact.site-de {
    border-left-color: #ffd700;
}

.site-data-compact.site-fr {
    border-left-color: #0055a4;
}

.site-data-compact.site-it {
    border-left-color: #009246;
}

.site-data-compact.site-es {
    border-left-color: #c60b1e;
}

.site-data-compact:hover {
    transform: translateY(-2px);
}

.site-header-compact {
    flex-shrink: 0;
    padding-right: 12px;
    border-right: 1px solid #e0e0e0;
    margin: 0;
    padding-bottom: 0;
    border-bottom: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.site-name-cn {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    margin-top: 2px;
}

.site-content-compact {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.site-row-compact {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    line-height: 1.4;
}

.site-row-compact .site-label {
    color: #666;
    margin-right: 5px;
}

.site-row-compact strong {
    color: #232f3e;
    font-weight: 600;
}

.no-sites-data {
    color: #999;
    font-size: 12px;
    padding: 10px;
    text-align: center;
}

/* 草稿卡片平铺 */
.drafts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.draft-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.draft-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.draft-card img {
    width: 100%;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 15px;
}

.draft-card h3 {
    margin-bottom: 10px;
    color: #232f3e;
}

.draft-card-item {
    margin-bottom: 8px;
    font-size: 14px;
}

.draft-card-item strong {
    color: #555;
    margin-right: 5px;
}

/* 搜索框 */
.search-box {
    margin-bottom: 20px;
}

.search-box input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* 动态添加字段 */
.dynamic-field {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.dynamic-field input {
    flex: 1;
}

.dynamic-field .btn {
    padding: 8px 15px;
}

.price-calc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.price-calc-toggle {
    background: none;
    border: none;
    color: #ff9900;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.price-calc-toggle:focus {
    outline: none;
}

.price-calc-body.collapsed {
    display: none;
}

/* 价格计算区域 */
.price-calc-container {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.price-calc-base {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}


.price-calc-entries {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.price-calc-row-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}


.price-calc-result {
    min-width: 140px;
}

/* 可调节列宽的表格（草稿列表） */
.resizable-table {
    table-layout: auto;
}

.resizable-table th {
    position: relative;
}

.resizable-table th .col-resizer {
    position: absolute;
    right: 0;
    top: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
}

.price-calc-add {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}


/* 配送费表 */
.shipping-table-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.shipping-table-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.shipping-table-section h3 {
    margin-bottom: 15px;
    color: #232f3e;
}

/* 编辑页面布局 */
.edit-page-layout {
    display: flex;
    align-items: flex-start;
}

.edit-form-container {
    flex: 0 0 80%;
}

.calc-results-panel {
    flex: 0 0 20%;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

/* 响应式 */
@media (max-width: 1200px) {
    /* 中等屏幕：左右布局改为上下布局 */
    .edit-page-layout {
        flex-direction: column !important;
    }
    
    .edit-form-container {
        flex: 1 1 100% !important;
    }
    
    .calc-results-panel {
        flex: 1 1 100% !important;
        position: static !important;
        max-height: none !important;
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        min-width: 100%;
        max-width: 100%;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        max-width: 100% !important;
    }
    
    .sites-comparison {
        grid-template-columns: 1fr;
    }
    
    .shipping-table-container {
        grid-template-columns: 1fr;
    }
    
    .drafts-grid {
        grid-template-columns: 1fr;
    }
    
    .nav .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

