
 * {margin: 0;padding: 0;box-sizing: border-box;}
 :root {--primary-blue: #1890ff;--blue-light: #69c0ff;--blue-dark: #0050b3;--blue-bg: #e6f7ff;--table-header-bg: #f0f9ff;--table-border: #d9eaf7;--success-green: #52c41a;--warning-orange: #fa8c16;--text-primary: #262626;--text-secondary: #595959;--text-light: #8c8c8c;--bg-white: #ffffff;--bg-gray: #f5f5f5;--border-color: #d9d9d9;--shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);--shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.12);}
 body {font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);line-height: 1.5;color: var(--text-primary);padding: 20px;min-height: 100vh;margin: 0;}
 input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* 隐藏 Firefox 的上下箭头 */
input[type="number"] {
  -moz-appearance: textfield;
}

 .container {max-width: 100%;margin: 0;display: grid;grid-template-columns: 40% 60%;gap: 20px;height: calc(100vh - 40px);}
 .header {grid-column: 1 / -1;background: linear-gradient(135deg, var(--primary-blue) 0%, var(--blue-dark) 100%);padding: 16px 24px;color: white;display: flex;justify-content: space-between;align-items: center;border-radius: 12px;margin-bottom: 0;box-shadow: var(--shadow-medium);}
 .header h1 {font-size: 20px;font-weight: 600;}
 .back-btn {background: rgba(255, 255, 255, 0.2);color: white;border: none;padding: 8px 16px;border-radius: 6px;cursor: pointer;font-weight: 500;transition: all 0.3s ease;backdrop-filter: blur(10px);font-size: 14px;}
 .back-btn:hover {background: rgba(255, 255, 255, 0.3);transform: translateY(-1px);}
 /* ===== 左侧媒体区域 ===== */
 .media-section {background: var(--bg-white);border-radius: 12px;padding: 20px;height: calc(100vh - 100px);display: flex;flex-direction: column;box-shadow: var(--shadow-medium);border: 1px solid var(--border-color);overflow-y: auto;}
 .main-image-container {position: relative;margin-bottom: 16px;border-radius: 8px;overflow: hidden;background: var(--bg-gray);flex: 1;min-height: 300px;}
 .main-image {width: 100%;height: 100%;object-fit: contain;cursor: pointer;transition: transform 0.3s ease;}
 .main-image:hover {transform: scale(1.01);}

.thumbnail-gallery { display: flex; /* 修改：从grid改为flex布局 */ 
    flex-wrap: nowrap; /* 禁止换行 */ 
    gap: 2px; /* 统一间距为2px */ 
    margin-top: 16px;
    justify-content: flex-start; /* 左对齐 */ 
    overflow-x: auto; /* 如果超过一行允许横向滚动 */ 
    padding-bottom: 4px; /* 为滚动条留出空间 */
    padding-top: 4px; /* 为滚动条留出空间 */
}
.thumbnail { width: 60px; /* 修改：固定宽度60px */ height: 60px; /* 修改：固定高度60px */ flex-shrink: 0; /* 禁止缩小 */ position: relative; border-radius: 6px; cursor: pointer; border: 2px solid transparent; transition: all 0.3s ease; background: var(--bg-gray); overflow: hidden;}

.thumbnail img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 4px;}
.thumbnail.active,
.thumbnail:hover {border-color: var(--primary-blue);transform: translateY(-2px);}

.video-thumbnail { display: flex; align-items: center; justify-content: center; background: var(--primary-blue); color: white; font-size: 12px; font-weight: 500;}
 .no-media {display: flex;align-items: center;justify-content: center;height: 100%;color: var(--text-light);background: var(--bg-gray);border-radius: 8px;border: 2px dashed var(--border-color);font-size: 14px;}
 /* ===== 右侧信息区域 ===== */
 .info-section {background: var(--bg-white);border-radius: 12px;padding: 24px;height: calc(100vh - 100px);display: flex;flex-direction: column;box-shadow: var(--shadow-medium);border: 1px solid var(--border-color);overflow-y: auto;}
 /* ===== 紧凑产品信息卡片 ===== */
 .compact-product-card {background: var(--bg-white);border-radius: 8px;padding: 16px;margin-bottom: 20px;border: 1px solid var(--border-color);box-shadow: var(--shadow-light);}
 .compact-header {display: flex;align-items: center;margin-bottom: 12px;padding-bottom: 12px;border-bottom: 1px solid var(--table-border);}
 .compact-sku {font-size: 22px;font-weight: 700;color: var(--primary-blue);margin: 0;line-height: 1.2;}
 .compact-tags {display: flex;gap: 8px;margin-left: 12px;align-items: center;}
 .compact-tag {background: var(--blue-bg);color: var(--blue-dark);padding: 2px 8px;border-radius: 12px;font-size: 12px;font-weight: 500;border: 1px solid var(--blue-light);}
 .compact-info-row {display: flex;align-items: center;flex-wrap: wrap;gap: 8px;margin-bottom: 12px;padding-bottom: 12px;border-bottom: 1px solid var(--table-border);font-size: 13px;}
 .compact-info-item {display: flex;align-items: center;gap: 4px;}
 .compact-label {font-weight: 600;color: var(--text-secondary);}
 .compact-value {color: var(--text-primary);font-weight: 500;}
 .compact-separator {color: var(--text-light);font-weight: 300;}
 .compact-description-row {display: flex;align-items: flex-start;margin-bottom: 8px;font-size: 13px;line-height: 1.5;}
 .compact-description {color: var(--text-primary);flex: 1;margin-left: 8px;word-break: break-word;}
 .compact-notes-row {display: flex;align-items: center;font-size: 13px;line-height: 1.5;}
 .compact-notes {color: var(--text-primary);font-weight: 500;margin-left: 8px;}
 /* ===== 子SKU表格区域 ===== */
.sub-sku-section {flex: 1;display: flex;flex-direction: column;min-height: 300px;}
.sub-sku-table-container { flex: 1; overflow-y: auto; overflow-x: hidden; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-white);}
.sub-sku-table {width: 100%;border-collapse: collapse;}
.sub-sku-table th {background: var(--table-header-bg);color: var(--primary-blue);font-weight: 600;font-size: 14px;padding: 12px 8px;text-align: center;border-bottom: 2px solid var(--primary-blue);position: sticky;top: 0;z-index: 10;}
.sub-sku-table td {padding: 4px 2px;text-align: center;border-bottom: 1px solid var(--table-border);font-size: 14px;vertical-align: middle;}
.sub-sku-table tbody tr:hover {background: var(--blue-bg);}

/* 子SKU描述字段 - 自动换行完整显示 */
.sub-sku-description { max-width: 100%; overflow: visible; display: block; line-height: 1.5; word-break: break-word; white-space: normal; text-align: left; padding: 8px 4px; min-height: 24px;}

/* 移除悬停提示效果，因为现在直接显示完整内容 */
.sub-sku-description:hover::after { display: none;}

 /* 表格输入框和按钮 */
 .quantity-control { display: flex; align-items: center; justify-content: center; }
 .quantity-btn { width: 28px; height: 28px; border: 1px solid var(--border-color); background: var(--bg-gray); cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; transition: all 0.3s; }
 .quantity-btn:hover { background: var(--border-color); }
 .quantity-btn.minus { border-radius: 4px 0 0 4px; border-right: none; }
 .quantity-btn.plus { border-radius: 0 4px 4px 0; border-left: none; }
 .sub-sku-quantity-input {width: 50px; text-align: center; margin: 0; padding: 6px 8px;border: 1px solid var(--border-color);border-radius: 0;font-size: 14px;transition: all 0.3s;}
 .sub-sku-quantity-input:focus {border-color: var(--primary-blue);box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);outline: none;}
 .price-display {font-weight: 600;color: var(--primary-blue);font-size: 14px;}
 .cny-price {color: var(--success-green);font-weight: 500;font-size: 13px;}
 .add-sub-sku-btn {background: var(--primary-blue);color: white;border: none;padding: 6px 16px;border-radius: 4px;font-size: 14px;font-weight: 500;cursor: pointer;transition: all 0.3s;white-space: nowrap;}
 .add-sub-sku-btn:hover {background: var(--blue-dark);transform: translateY(-1px);box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);}
 .add-sub-sku-btn:active {transform: translateY(0);}
 /* 小计列样式 */
 .subtotal-column {display: flex;flex-direction: column;align-items: center;justify-content: center;gap: 4px;padding: 8px 4px !important;}
 .subtotal-usd {font-weight: 600;color: var(--primary-blue);font-size: 14px;}
 .subtotal-cny {color: var(--success-green);font-weight: 500;font-size: 13px;}
 /* 加载状态 */
 .loading-text {text-align: center;padding: 40px !important;color: var(--text-light);}
 .loading-spinner {display: inline-block;width: 20px;height: 20px;border: 2px solid var(--blue-light);border-top-color: var(--primary-blue);border-radius: 50%;animation: spin 1s linear infinite;margin-right: 8px;vertical-align: middle;}
 @keyframes spin {
 to { transform: rotate(360deg); }
 }
 /* 全屏图片浏览器 */
 #fullscreenGallery {display: none;position: fixed;top: 0;left: 0;width: 100%;height: 100%;background: rgba(0, 0, 0, 0.95);z-index: 10000;align-items: center;justify-content: center;}
 #fullscreenGallery .close {position: absolute;top: 20px;right: 20px;background: rgba(255, 255, 255, 0.2);color: white;border: none;border-radius: 50%;width: 50px;height: 50px;font-size: 24px;cursor: pointer;z-index: 10001;}
 #fullscreenGallery #prevBtn,
 #fullscreenGallery #nextBtn {position: absolute;top: 50%;transform: translateY(-50%);background: rgba(255, 255, 255, 0.2);color: white;border: none;border-radius: 50%;width: 60px;height: 60px;font-size: 24px;cursor: pointer;z-index: 10001;}
 #fullscreenGallery #prevBtn {left: 20px;}
 #fullscreenGallery #nextBtn {right: 20px;}
 #fullscreenImageContainer {position: relative;width: 90%;height: 90%;display: flex;align-items: center;justify-content: center;}
 #fullscreenImage {max-width: 100%;max-height: 100%;object-fit: contain;transition: transform 0.3s ease;cursor: zoom-in;}
 #fullscreenThumbnails {position: absolute;bottom: 20px;left: 0;width: 100%;display: flex;justify-content: center;gap: 10px;padding: 0 20px;overflow-x: auto;}
 #fullscreenThumbnails img {width: 60px;height: 60px;object-fit: cover;border-radius: 4px;cursor: pointer;border: 2px solid transparent;}
 #fullscreenThumbnails img.active {border-color: var(--primary-blue);}
 /* ===== 响应式设计 ===== */
 @media (max-width: 1400px) {
    .sub-sku-table .col-subtotal { display: none; }
 }
 @media (max-width: 1200px) {
    .container { grid-template-columns: 45% 55%; gap: 16px;}
    .sub-sku-table th,.sub-sku-table td { padding: 8px 4px; font-size: 13px;}
    .sub-sku-quantity-input { width: 40px; padding: 4px;}
    .quantity-btn { width: 24px; height: 24px; }
    .add-sub-sku-btn { padding: 4px 8px; font-size: 12px;}
 }
 @media (max-width: 992px) {
    .container { grid-template-columns: 1fr; height: auto;}
    .media-section,.info-section { height: auto; min-height: 500px;}
    .header { flex-direction: row; justify-content: space-between; align-items: center; padding: 12px 16px; gap: 8px;}
    .header h1 { font-size: 18px; margin: 0; flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
    .back-btn { padding: 6px 12px; font-size: 12px; flex-shrink: 0;}
    .sub-sku-table th,.sub-sku-table td { padding: 6px 3px; font-size: 12px;}
    .sub-sku-description { -webkit-line-clamp: 2; max-height: 2.8em;}
    .sub-sku-table .col-subtotal { display: table-cell; } /* 恢复显示，因为纵向布局空间足够 */
    .add-sub-sku-btn { padding: 3px 6px; font-size: 11px;}
 }
 @media (max-width: 768px) {
    body { padding: 12px;}
    .container { gap: 12px;}
    .media-section,.info-section { padding: 16px;}
    .compact-sku { font-size: 20px;}
    .thumbnail-gallery { grid-template-columns: repeat(4, 1fr);}
    .thumbnail { height: 50px;}
    .compact-header { flex-direction: column; align-items: flex-start; gap: 8px;}
    .compact-tags { margin-left: 0;}
    .compact-info-row { gap: 6px;}
    .compact-info-item { flex-wrap: wrap;}
    .compact-label { min-width: auto;}
    
    /* 手机端表格卡片式布局 */
    .sub-sku-table-container { overflow-x: hidden; border: none; background: transparent; padding: 0;}
    .sub-sku-table, .sub-sku-table tbody, .sub-sku-table tr, .sub-sku-table td { display: block; width: 100%; }
    .sub-sku-table thead { display: none; }
    .sub-sku-table tr { margin-bottom: 12px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-white); box-shadow: var(--shadow-light); }
    .sub-sku-table td { text-align: right; padding: 10px 12px 10px 35%; position: relative; border-bottom: 1px solid #f0f0f0; min-height: 40px; display: flex; justify-content: flex-end; align-items: center; }
    .sub-sku-table td:last-child { border-bottom: none; }
    .sub-sku-table td::before { content: attr(data-label); position: absolute; left: 12px; width: 30%; text-align: left; font-weight: 600; color: var(--text-secondary); top: 50%; transform: translateY(-50%); font-size: 13px; }
    .sub-sku-table td.loading-text { padding: 40px 12px; text-align: center; justify-content: center; }
    .sub-sku-table td.loading-text::before { display: none; }
    .sub-sku-table .col-subtotal { display: flex; } /* 手机端卡片模式下恢复显示小计 */
    .quantity-control { justify-content: flex-end !important; }
    .subtotal-column { flex-direction: row; gap: 8px; padding: 10px 12px 10px 35% !important; justify-content: flex-end; }
    .sub-sku-description { text-align: right; padding: 0; }
 }
 @media (max-width: 576px) {
    .thumbnail-gallery { grid-template-columns: repeat(3, 1fr);}
    .compact-sku { font-size: 18px;}
    .compact-info-row { flex-direction: column; align-items: flex-start; gap: 6px;}
    .compact-separator { display: none;}
    .compact-description-row,.compact-notes-row { flex-direction: column; align-items: flex-start; gap: 4px;}
    .compact-description,.compact-notes { margin-left: 0;}
    .sub-sku-table-container { font-size: 13px;}
    .sub-sku-quantity-input { width: 60px; padding: 4px 6px;}
    .add-sub-sku-btn { padding: 4px 12px; font-size: 13px;}
 } 
 #watermark {position: fixed;top: 0;left: 0;width: 100%;height: 100%;pointer-events: none;z-index: 999999;overflow: hidden;}
 .watermark-text {position: absolute;color: rgba(0, 0, 0, 0.05);font-size: 35px;font-weight: bold;font-family: Calibri, sans-serif;white-space: nowrap;} 