/* 产品详情页 - 与 product-detail.html 设计稿完全一致 */

.compact-hero {
  min-height: auto !important;
}

.compact-hero h1 {
  font-size: 22px !important;
}

.compact-hero p {
  font-size: 13px !important;
  margin-top: 4px;
}

/* 覆盖 product.css 中产品详情相关样式，确保与设计稿一致 */
.product-detail-section {
  padding: 20px 0 40px;
  margin-top: 175px; /* 适配固定头部高度 */
}

.product-layout {
  display: grid;
  grid-template-columns: 450px 1fr;
  gap: 30px;
}

.product-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-detail-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
  color: #64748b;
  padding: 8px 0;
}

.product-detail-breadcrumb a {
  color: #64748b;
  text-decoration: none;
}

.product-detail-breadcrumb a:hover {
  color: #1a7f37;
}

.product-detail-breadcrumb .breadcrumb-sep {
  color: #cbd5e1;
  user-select: none;
}

.product-detail-breadcrumb .breadcrumb-current {
  color: #334155;
  font-weight: 500;
}

.gallery-box {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #eee;
}

.gallery-main {
  position: relative;
  aspect-ratio: 1;
  background: #f8f9fa;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-main img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* 化学结构线稿：减轻浏览器双线性插值导致的边缘发虚（需配合较高分辨率源图） */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.gallery-main .no-image-large {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #94a3b8;
}

.gallery-main .no-image-large i {
  font-size: 48px;
  display: block;
  margin-bottom: 8px;
}

.stock-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #22c55e;
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
}

.stock-tag.low {
  background: #f59e0b;
}

.stock-tag.out {
  background: #ef4444;
}

.thumb-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.thumb-item {
  width: 50px;
  height: 50px;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s;
}

.thumb-item:hover,
.thumb-item.active {
  border-color: #1a7f37;
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.quick-info {
  display: flex;
  gap: 8px;
}

.quick-info .info-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 11px;
  color: #666;
}

.quick-info .info-item i {
  font-size: 14px;
  color: #1a7f37;
}

.product-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-name,
.product-detail-name {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.4;
}

.product-detail-english {
  font-size: 14px;
  color: #64748b;
  margin: -4px 0 8px;
}

.product-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 文字标签样式：CAS、纯度、分子式、分子量 - 黑色加粗放大 */
.product-specs-label {
  gap: 16px 28px;
  margin: 12px 0;
}

.product-specs-label .spec-item {
  font-size: 16px;
  color: #333;
  font-weight: 700;
}

.product-specs-label .spec-item strong {
  color: #000;
  font-weight: 700;
  font-size: 16px;
}

.spec-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: #f5f5f5;
  border-radius: 4px;
  font-size: 12px;
  color: #666;
}

.spec-tag i {
  font-size: 12px;
  color: #1a7f37;
}

.price-box {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border-radius: 6px;
  border: 1px solid #bbf7d0;
}

.price-label {
  font-size: 12px;
  color: #666;
}

.price-num {
  font-size: 26px;
  font-weight: 700;
  color: #1a7f37;
}

.price-num small {
  font-size: 14px;
  font-weight: 500;
}

.price-unit {
  font-size: 13px;
  color: #888;
}

.spec-price-table-wrap {
  margin: 12px 0;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}

.spec-price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.spec-price-table th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
}

.spec-price-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
}

.spec-price-table tbody tr:last-child td {
  border-bottom: none;
}

.spec-price-table .spec-price {
  font-weight: 600;
  color: #1a7f37;
}

.spec-price-table .spec-qty-input {
  width: 70px;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
}

.spec-price-table .spec-qty-input:focus {
  border-color: #1a7f37;
  outline: none;
}

/* 详情页：表格 + 订单摘要 左右布局 */
.detail-main-wrap {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.detail-table-area {
  flex: 1;
  min-width: 0;
}

/* 产品说明：发货、科研使用、储存条件（右侧：加入购物车下方） */
.product-right-tips {
  margin-top: 16px;
  padding: 12px 0;
}

.product-right-tips p {
  margin: 6px 0;
  font-size: 13px;
  color: #666;
}

.product-right-tips p i {
  margin-right: 8px;
  color: #1a7f37;
}

.product-right-tips .storage-line {
  margin-top: 8px;
}

/* 文档下载按钮（图2样式：浅灰、圆角、阴影） */
.detail-doc-downloads {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-right-docs {
  margin-top: 12px;
}

/* 文档下载单独一排（在询单/加入购物车下方） */
.detail-doc-row {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.detail-doc-inline {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
}

.detail-doc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  color: #333;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: all 0.2s;
}

.detail-doc-btn:hover {
  background: #eee;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  color: #1a7f37;
}

.detail-doc-btn-disabled {
  background: #f0f0f0 !important;
  color: #999 !important;
  cursor: not-allowed;
  opacity: 0.8;
}

.detail-doc-btn-disabled:hover {
  background: #f0f0f0 !important;
  color: #999 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

@media (max-width: 900px) {
  .detail-main-wrap {
    flex-direction: column;
  }
  .detail-summary-panel {
    width: 100%;
    position: static;
  }
}

.option-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.option-row label {
  width: 50px;
  font-size: 13px;
  color: #666;
}

.spec-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.spec-btn {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.spec-btn:hover {
  border-color: #1a7f37;
  color: #1a7f37;
}

.spec-btn.active {
  border-color: #1a7f37;
  background: #1a7f37;
  color: #fff;
}

.qty-box {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.qty-btn-mini {
  width: 32px;
  height: 32px;
  border: none;
  background: #f5f5f5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
}

.qty-btn-mini:hover {
  background: #1a7f37;
  color: #fff;
}

.qty-input-mini {
  width: 50px;
  height: 32px;
  border: none;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
}

.stock-tip {
  font-size: 12px;
  color: #22c55e;
  margin-left: auto;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
}

.action-row .detail-doc-inline {
  display: flex;
  gap: 10px;
  margin-left: 0;
}

.btn-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  white-space: nowrap;
  background: linear-gradient(135deg, #1a7f37, #16a34a);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cart:hover {
  background: linear-gradient(135deg, #16a34a, #15803d);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 127, 55, 0.3);
}

.btn-inquiry,
.btn-favorite {
  padding: 14px 20px;
  background: linear-gradient(135deg, #1a7f37, #16a34a);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-inquiry:hover,
.btn-favorite:hover {
  background: linear-gradient(135deg, #16a34a, #15803d);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 127, 55, 0.3);
}

.btn-favorite.active {
  background: linear-gradient(135deg, #1a7f37, #16a34a);
  color: #fff;
}

.contact-row {
  display: flex;
  gap: 10px;
  padding-top: 8px;
}

.contact-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 13px;
  color: #666;
  text-decoration: none;
  transition: all 0.2s;
}

.contact-btn:hover {
  background: #1a7f37;
  color: #fff;
}

.contact-btn.wechat:hover {
  background: #07c160;
}

.contact-btn.doc-download:hover {
  background: #1a7f37;
  color: #fff;
}

.contact-btn i {
  font-size: 16px;
}

/* 三列联系按钮时均分 */
.contact-row .contact-btn {
  flex: 1;
  min-width: 0;
}

.tab-box {
  margin-top: 30px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #eee;
  overflow: hidden;
}

.tab-nav {
  display: flex;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}

.tab-link {
  padding: 14px 24px;
  border: none;
  background: none;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.tab-link:hover {
  color: #1a7f37;
}

.tab-link.active {
  color: #1a7f37;
  background: #fff;
}

.tab-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #1a7f37;
}

.tab-content {
  padding: 20px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.desc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.desc-block h4 {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #1a7f37;
}

.desc-block p,
.desc-block .description-content {
  font-size: 13px;
  color: #666;
  line-height: 1.8;
  margin: 0;
}

.desc-block .description-content {
  color: #666;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  position: relative;
  padding: 6px 0 6px 20px;
  font-size: 13px;
  color: #666;
  line-height: 1.6;
}

.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  background: #1a7f37;
  border-radius: 50%;
}

.storage-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 12px;
  color: #666;
}

.storage-info i {
  color: #1a7f37;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
}

.spec-table th,
.spec-table td {
  padding: 10px 16px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid #eee;
}

.spec-table th {
  width: 140px;
  background: #fafafa;
  color: #666;
  font-weight: 500;
}

.spec-table td {
  color: #333;
}

.spec-table tr:hover td {
  background: #f8f9fa;
}

.doc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f8f9fa;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

.doc-item:hover {
  background: #f0fdf4;
}

.doc-item i {
  font-size: 24px;
  color: #ef4444;
}

.doc-item span {
  flex: 1;
  font-size: 14px;
  color: #333;
}

.doc-download {
  font-size: 12px;
  color: #1a7f37;
}

.share-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 1000;
}

.share-popup.show {
  opacity: 1;
  visibility: visible;
}

.share-popup-content {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  min-width: 200px;
  transform: scale(0.9);
  transition: all 0.3s;
}

.share-popup.show .share-popup-content {
  transform: scale(1);
}

.share-popup-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
  text-align: center;
}

.share-popup-options {
  display: flex;
  gap: 12px;
}

.share-popup-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: none;
  background: #f5f5f5;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.share-popup-option:hover {
  background: #1a7f37;
  color: #fff;
}

.share-popup-option:hover i {
  color: #fff;
}

.share-popup-option i {
  font-size: 24px;
  color: #07c160;
  transition: all 0.2s;
}

.share-popup-option span {
  font-size: 12px;
  color: #666;
}

.share-popup-option:hover span {
  color: #fff;
}

.toast-msg {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 13px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 1001;
}

.toast-msg.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* 产品详情分页导航 */
.product-detail-pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: #fff;
  padding: 20px 24px;
  border-radius: 8px;
  border: 1px solid #eee;
  margin-top: 30px;
  margin-bottom: 30px;
}

.product-pagination-prev,
.product-pagination-next {
  flex: 1;
  min-width: 140px;
}

.product-pagination-prev {
  text-align: left;
}

.product-pagination-next {
  text-align: right;
}

.product-pagination-info {
  padding: 0 16px;
  font-size: 14px;
  color: #64748b;
  white-space: nowrap;
}

.product-pagination-info strong {
  color: #1a7f37;
  font-weight: 600;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #f8fafc;
  color: #1e293b;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  font-size: 14px;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(.disabled) {
  background: #1a7f37;
  color: #fff;
  border-color: #1a7f37;
}

.pagination-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-btn.back {
  flex-shrink: 0;
}

.pagination-label {
  font-size: 12px;
  color: #94a3b8;
}

.pagination-title {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

/* 相关产品 */
.related-products-section {
  margin-top: 40px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 20px;
  color: #1e293b;
}

.related-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.related-products-grid .product-card {
  padding: 0;
}

.related-products-grid .product-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.related-products-grid .product-image {
  position: relative;
  padding-top: 100%;
  background: #f8fafc;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
}

.related-products-grid .product-image img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.related-products-grid .no-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #94a3b8;
}

.related-products-grid .product-info {
  padding: 12px;
}

.related-products-grid .product-name {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-products-grid .product-cas {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 8px;
}

.related-products-grid .product-price .price-value {
  font-size: 16px;
  font-weight: 700;
  color: #1a7f37;
}

@media (max-width: 1024px) {
  .product-layout {
    grid-template-columns: 360px 1fr;
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .product-layout {
    grid-template-columns: 1fr;
  }

  .product-left {
    max-width: 450px;
    margin: 0 auto;
  }

  .desc-grid {
    grid-template-columns: 1fr;
  }

  .option-row {
    flex-wrap: wrap;
  }

  .option-row label {
    width: auto;
  }

  .spec-btns {
    flex: 1;
  }

  .tab-nav {
    overflow-x: auto;
  }

  .tab-link {
    padding: 12px 20px;
    white-space: nowrap;
  }

  .product-detail-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .product-pagination-prev,
  .product-pagination-next {
    min-width: auto;
    text-align: center;
  }

  .product-pagination-info {
    padding: 8px 0;
    text-align: center;
  }
}

/* 询单弹窗 */
.inquiry-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.inquiry-modal.show {
  display: flex;
}

.inquiry-modal-content {
  background: #fff;
  border-radius: 8px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
}

.inquiry-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.inquiry-modal-close:hover {
  background: #e0e0e0;
  color: #333;
}

.inquiry-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0 0 8px;
}

.inquiry-modal-desc {
  font-size: 13px;
  color: #666;
  margin: 0 0 20px;
}

.inquiry-form-row {
  margin-bottom: 16px;
}

.inquiry-form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.inquiry-form-group label {
  display: block;
  font-size: 13px;
  color: #333;
  margin-bottom: 6px;
}

.inquiry-form-group .required {
  color: #ef4444;
}

.inquiry-form-group input,
.inquiry-form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.inquiry-form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.inquiry-submit-btn {
  width: 100%;
  padding: 14px;
  background: #1a7f37;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s;
}

.inquiry-submit-btn:hover:not(:disabled) {
  background: #15803d;
}

.inquiry-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
