/* related-products.css - Auto-split from styles.css */

/* 同款商品区域 */
.related-products-section {
    margin: 20px 0 0 0;
    padding: 0;
}

.related-products-section .section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #222;
}

.product-linked-group-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
}

.product-linked-group-list::-webkit-scrollbar {
  height: 6px;
}

.product-linked-group-list::-webkit-scrollbar-track {
  background: transparent;
}

.product-linked-group-list::-webkit-scrollbar-thumb {
  background-color: #ddd;
  border-radius: 3px;
}

.product-linked-group-list::-webkit-scrollbar-thumb:hover {
  background-color: #bbb;
}

.linked-group-item {
  flex: 0 0 auto;
}

.content_image.border.linked_product_image {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease;
  border: 1px solid #EBEBEB;
  background-color: #f4f4f4;
}

.content_image.border.linked_product_image:hover {
  transform: scale(1.05);
  border-color: #222;
}

.content_image.border.linked_product_image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 价格参数显示样式 */
.section-title-with-params {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.price-params-display {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.param-display {
  font-size: 12px;
  color: #666;
  background: #f8f9fa;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #e9ecef;
}

/* 价格显示样式 */
.price-original {
  font-size: 12px;
  color: #666;
  text-decoration: line-through;
  opacity: 0.7;
  line-height: 1.1;
  margin-bottom: 1px;
}

.price-final {
  font-size: 14px;
  font-weight: 600;
  color: #e74c3c;
  line-height: 1.1;
}

/* 🆕 获取价格按钮样式 */
.fetch-price-section {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 20px 0;
}

.fetch-price-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #ff6600 0%, #ff8533 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 102, 0, 0.3);
}

.fetch-price-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 102, 0, 0.4);
}

.fetch-price-button:active {
  transform: translateY(0);
}

.fetch-price-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.fetch-icon {
  font-size: 18px;
}

/* 🆕 小尺寸获取价格按钮（放在设置信息后面） */
.fetch-price-button-small {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #ff6600 0%, #ff8533 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 1px 4px rgba(255, 102, 0, 0.3);
}

.fetch-price-button-small:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(255, 102, 0, 0.4);
}

.fetch-price-button-small:active {
  transform: translateY(0);
}

.fetch-price-button-small:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.fetch-price-button-small .fetch-icon {
  font-size: 14px;
}

/* 🆕 设置按钮样式 */
.settings-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.settings-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.settings-button:active {
  transform: translateY(0);
}

.settings-icon {
  font-size: 18px;
}

/* 🆕 小尺寸设置按钮（放在设置信息后面） */
.settings-button-small {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 1px 4px rgba(102, 126, 234, 0.3);
}

.settings-button-small:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

.settings-button-small:active {
  transform: translateY(0);
}

.settings-button-small .settings-icon {
  font-size: 14px;
}

/* 🆕 设置模态框样式 - 大弹窗 + 美观 */
.settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.settings-modal-content {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.settings-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  background: #f8fafc;
  color: #334155;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.settings-modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #1e293b;
}

.close-settings-button {
  background: #e2e8f0;
  border: none;
  color: #475569;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.close-settings-button:hover {
  background: #cbd5e1;
  color: #334155;
}

.settings-modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}

.settings-modal-body label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #374151;
  font-size: 13px;
}

.settings-modal-body input[type="number"],
.settings-modal input[type="number"] {
  padding: 8px 10px;
  box-sizing: border-box;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fafafa;
  text-align: center !important;
}

.settings-modal-body input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
  background: #fff;
}

/* 汇率、手续费居中排布 */
.settings-params-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-bottom: 16px;
}

.settings-params-left,
.settings-params-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-inline-label {
  flex: 0 0 auto;
  margin: 0 !important;
  font-size: 13px !important;
  font-weight: 600;
  color: #475569;
}

.settings-rate-input {
  width: 68px !important;
  min-width: 68px;
  margin-bottom: 0 !important;
  padding: 8px 6px !important;
  text-align: center !important;
}

.fetch-rate-btn {
  flex-shrink: 0;
  padding: 8px 12px;
  background: #d1fae5;
  color: #047857;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.settings-fee-input {
  width: 56px !important;
  min-width: 56px;
  margin-bottom: 0 !important;
  padding: 8px 6px !important;
  text-align: center !important;
}

.fetch-rate-btn:hover:not(:disabled) {
  background: #a7f3d0;
  color: #065f46;
}

.fetch-rate-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.settings-shipping-categories {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
}

.settings-shipping-categories-title {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 10px;
}

.settings-category-list {
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 10px;
  background: #f8fafc;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}

/* 每个大分类组 */
.settings-cat-group {
  display: flex;
  flex-direction: column;
}
.settings-cat-group.expanded {
  flex-basis: 100%;
}

.settings-big-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.settings-big-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* 🆕 当前分类高亮样式 */
.settings-big-chip.current-category-highlight {
  border: 2px solid #007bff;
  background: #e7f3ff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.settings-category-row.current-category-highlight {
  background: #e7f3ff;
  border-radius: 6px;
  padding: 4px;
  margin: -4px;
}

.settings-category-fee-input.current-category-highlight {
  border: 2px solid #007bff !important;
  background: #e7f3ff !important;
}

.settings-big-plus {
  font-size: 14px;
  font-weight: 700;
  color: #64748b;
  line-height: 1;
}

.settings-big-name {
  font-size: 13px;
  color: #334155;
  white-space: nowrap;
}

.settings-category-fee-input {
  width: 44px !important;
  min-width: 44px;
  padding: 4px 2px !important;
  font-size: 12px;
  text-align: center !important;
}

.settings-small-block {
  margin-top: 8px;
  padding: 10px;
  background: #e2e8f0;
  border-radius: 8px;
  box-sizing: border-box;
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 12px;
}

.settings-cat-group.expanded .settings-small-block {
  display: grid;
}

.settings-small-block-title {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
  grid-column: 1 / -1;
}

.settings-category-group-title {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
  padding-left: 4px;
}

.settings-category-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.settings-category-row label {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-category-row input,
.settings-category-row .settings-category-fee-input {
  flex: 0 0 48px;
  width: 48px;
  min-width: 48px;
  margin-bottom: 0;
  padding: 5px 4px;
  font-size: 13px;
  text-align: center !important;
}

.settings-expand-small-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px 14px;
  background: #f3f4f6;
  color: #6b7280;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.settings-expand-small-btn:hover {
  background: #e5e7eb;
  color: #4f46e5;
}

.settings-category-small-wrap {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e5e7eb;
}

.settings-category-loading,
.settings-category-empty,
.settings-category-error {
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: #6b7280;
}

.settings-category-error {
  color: #dc2626;
}

.settings-status {
  margin-top: 14px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  min-height: 20px;
}

.settings-status.success {
  color: #059669;
}

.settings-status.error {
  color: #dc2626;
}

.settings-modal-footer {
  padding: 16px 22px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
}

.save-settings-button {
  width: 100%;
  padding: 14px;
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.save-settings-button:hover:not(:disabled) {
  background: #c7d2fe;
  color: #312e81;
  border-color: #a5b4fc;
}

.save-settings-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.fetch-status {
  font-size: 13px;
  color: #666;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

/* 🆕 价格对比表格样式 - 完全按照Chrome插件样式 */
.price-comparison-section {
  margin: 15px 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #2b2d42;
}

.price-comparison-table {
  overflow-x: auto;
  margin-top: 15px;
  width: 100%;
}

.price-comparison-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: fixed;
  max-width: 100%;
}

.price-comparison-table thead tr {
  background: #f2f2f2;
}

.price-comparison-table th {
  padding: 3px 2px;
  text-align: center;
  font-size: 11px;
  word-wrap: break-word;
}

.price-comparison-table td {
  padding: 3px 2px;
  text-align: center;
  border-bottom: 1px solid #eee;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.price-comparison-table tbody tr.highlight {
  background: rgba(40, 167, 69, 0.1);
}

/* 🆕 表格加载动画 */
.table-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px 20px;
  min-height: 120px;
}

.table-loading .loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e9ecef;
  border-top: 3px solid #222;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 🆕 页面淡入效果 */
.detail-fade-in {
  animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 🆕 逐个元素依次淡入效果 */
.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  animation: staggerFadeIn 1.0s ease-out forwards;
}

@keyframes staggerFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 不同元素的延迟时间（基础延迟0.6s + 每个间隔0.35s） */
.stagger-delay-1 { animation-delay: 0.6s; }
.stagger-delay-2 { animation-delay: 0.95s; }
.stagger-delay-3 { animation-delay: 1.3s; }
.stagger-delay-4 { animation-delay: 1.65s; }
.stagger-delay-5 { animation-delay: 2.0s; }
.stagger-delay-6 { animation-delay: 2.35s; }
.stagger-delay-7 { animation-delay: 2.7s; }
.stagger-delay-8 { animation-delay: 3.05s; }
.stagger-delay-9 { animation-delay: 3.4s; }

/* 🆕 表格淡入效果 */
.table-fade-in {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 🆕 图片切换按钮样式 */
.main-image-container {
  position: relative;
  cursor: pointer;
}

/* 🆕 主图放大镜图标 */
.main-image-zoom-icon {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0.7;
  transition: all 0.2s ease;
  cursor: pointer;
  z-index: 5;
}

.main-image-zoom-icon svg {
  width: 18px;
  height: 18px;
}

.main-image-container:hover .main-image-zoom-icon {
  opacity: 1;
  background: rgba(0, 0, 0, 0.7);
}

.main-image-zoom-icon:hover {
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .main-image-zoom-icon {
    width: 28px;
    height: 28px;
    right: 8px;
    bottom: 8px;
  }
  
  .main-image-zoom-icon svg {
    width: 16px;
    height: 16px;
  }
}

.image-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.image-nav-btn:hover {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.image-nav-prev {
  left: 10px;
}

.image-nav-next {
  right: 10px;
}

/* 图片指示器 */
.image-indicators {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

/* 缩略图列表 */
.image-thumbnails {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.thumbnail-item {
  flex-shrink: 0;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.thumbnail-item:hover {
  transform: scale(1.05);
}

.thumbnail-item.active {
  border-color: #222 !important;
}

.image-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
}

.image-indicator.active {
  background: #222;
  width: 20px;
  border-radius: 4px;
}

.image-indicator:hover {
  background: rgba(0, 0, 0, 0.5);
}

/* 🆕 同类商品区域样式 */
.related-products-section {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.product-linked-group-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}

.product-linked-group-list::-webkit-scrollbar {
  height: 4px;
}

.product-linked-group-list::-webkit-scrollbar-track {
  background: transparent;
}

.product-linked-group-list::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

.linked-group-item {
  flex-shrink: 0;
  width: 45px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.linked-group-item:hover {
  transform: translateY(-2px);
}

.linked-group-item .item-image {
  width: 45px;
  height: 45px;
  border-radius: 6px;
  overflow: hidden;
  background: #f4f4f4;
  border: 1px solid #ebebeb;
}

.linked-group-item .item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 移动端完整响应式适配 → 见 responsive-mobile.css */
