/* ============================================
   梁山二手设备交易市场 - 设备详情页样式
   detail.css
   ============================================ */

/* ---------- CSS 变量 ---------- */
:root {
  --primary: #002b5c;
  --primary-dark: #001736;
  --white: #ffffff;
  --red: #ba1a1a;
  --green: #22c55e;
  --bg-light: #f8f9fa;
  --bg-page: #f8f9fa;
  --border-light: #e1e3e4;
  --border-mid: #c4c6d0;
  --text-main: #191c1d;
  --text-dark: #001736;
  --text-body: #1f2937;
  --text-muted: #43474f;
  --text-placeholder: #757684;
  --header-shadow: 0 1px 1px rgba(0,0,0,.05);
  --card-shadow: 0 1px 2px rgba(0,0,0,.05);
  --section-gap: 24px;
  --radius-sm: 2px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;
}

/* ---------- 详情页基础（仅作用 main 内，避免破坏 header/footer） ---------- */
.main-content.detail-page {
  padding: 0;
  background: var(--bg-page);
}

.main-image-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 428px;
  background: #f3f4f6;
  color: #9ca3af;
  font-size: 15px;
}

.product-meta-line {
  margin-top: 8px;
  font-size: 13px;
  color: #9ca3af;
}

.detail-seller-badge {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 2px;
  vertical-align: middle;
}

.detail-seller-badge-star {
  color: #fff;
  background: #fea619;
}

.detail-seller-badge-merchant {
  color: #855300;
  background: rgba(254, 166, 25, 0.1);
  border: 1px solid #fea619;
}

.detail-seller-badge-personal {
  color: #fff;
  background: #2563eb;
}

.hd-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.rec-card-img-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  background: #f3f4f6;
  color: #9ca3af;
  font-size: 13px;
}

.favorite-btn.favorited img {
  filter: hue-rotate(-30deg) saturate(4);
}

/* ============================================
   主内容区
   ============================================ */
.detail-page .page-container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}
.detail-page .product-info-section,
.detail-page .product-gallery,
.detail-page .product-detail,
.detail-page .merchant-block {
  min-width: 0;
  max-width: 100%;
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0;
}
.breadcrumb-link {
  font-size: 14px;
  font-weight: 500;
  color: #43474f;
  transition: color .2s;
}
.breadcrumb-link:hover { color: var(--primary); }
.breadcrumb-arrow { width: 5px; height: 8px; }
.breadcrumb-current {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
}

/* ============================================
   上部区域：商品信息
   ============================================ */
.product-info-section {
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--header-shadow);
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
  margin-bottom: 0;
}
.product-gallery {
  grid-column: 1 / span 5;
}
.product-detail {
  grid-column: 6 / span 7;
}

/* 图片库 */
.product-gallery { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.main-image-wrap {
  position: relative;
  background: #edeeef;
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: 100%;
  height: 428px;
}
.main-image {
  width: 100%;
  height: 428px;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.condition-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--primary-dark);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}
.favorite-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,.8);
  border-radius: var(--radius-lg);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  transition: background .2s;
}
.favorite-btn:hover { background: rgba(255,255,255,1); }
.favorite-btn img { width: 20px; height: 18px; }

.thumbnail-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
.thumbnail-strip .thumb-item {
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s;
  height: 108px;
  padding: 0;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #edeeef;
}
.thumbnail-strip .thumb-item img { width: 100%; height: 100%; object-fit: cover; }
.thumbnail-strip .thumb-item.active { border: 2px solid var(--primary-dark); }
.thumbnail-strip .thumb-item:hover { border-color: var(--primary); }
.thumb-video {
  background: #edeeef;
  flex-direction: column;
  gap: 4px;
}
.thumb-video .video-icon { width: 26px; height: 26px; object-fit: contain; }
.thumb-video span { font-size: 10px; font-weight: 700; color: var(--primary-dark); }

/* 右侧信息区 */
.product-detail {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.product-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.2;
  word-break: break-word;
}
.product-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
}
.price-label { font-size: 18px; color: var(--text-muted); line-height: 1.6; }
.price-value { font-size: 40px; font-weight: 700; color: var(--red); line-height: 1.2; }

/* 规格表格 */
.spec-grid {
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.spec-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-height: 24px;
}
.spec-full { grid-column: 1 / -1; }
.spec-label {
  font-size: 16px;
  color: var(--text-muted);
  white-space: nowrap;
  line-height: 1.5;
}
.spec-value {
  font-size: 16px;
  color: var(--primary-dark);
  line-height: 1.5;
}

/* 商户区块（服务行 + 卡片）— 用 .detail-page 前缀避免与 style.css 首页 .merchant-card 冲突 */
.detail-page .merchant-block {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 4px;
  width: 100%;
}

.detail-page .service-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 16px 12px;
  flex-wrap: wrap;
}
.detail-page .service-title {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.5;
  flex-shrink: 0;
  width: 56px;
}
.detail-page .service-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.detail-page .service-items {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding-left: 8px;
}
.detail-page .service-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.detail-page .badge-outline {
  background: rgba(0, 23, 54, 0.05);
  border: 1px solid rgba(0, 23, 54, 0.3);
  color: var(--primary-dark);
}
.detail-page .badge-outline img {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.detail-page .service-item-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: nowrap;
}
.detail-page .service-item-tag img {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* 商户卡片：左头像 | 中信息 | 右按钮 */
.detail-page .merchant-card {
  background: var(--white);
  border: 2px solid #d6e3ff;
  border-radius: var(--radius-md);
  padding: 26px;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 24px;
  box-shadow: var(--card-shadow);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  cursor: default;
  transition: none;
}
.detail-page .merchant-card:hover {
  box-shadow: var(--card-shadow);
  transform: none;
}
.detail-page .merchant-avatar {
  width: 64px;
  height: 64px;
  background: var(--primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 64px;
  margin-bottom: 0;
  overflow: visible;
  box-shadow: none;
}
.detail-page .merchant-avatar img {
  width: 24px;
  height: 21px;
  object-fit: contain;
}
.detail-page .merchant-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.detail-page .merchant-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  max-width: 100%;
}
.detail-page .merchant-name {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.5;
  text-align: left;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail-page .verified-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.detail-page .merchant-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}
.detail-page .merchant-stars {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  margin-bottom: 0;
}
.detail-page .merchant-stars img {
  width: 13px;
  height: 13px;
  display: block;
}
.detail-page .merchant-stat {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.55px;
  line-height: 1;
  white-space: nowrap;
}
.detail-page .merchant-labels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  width: 100%;
}
.detail-page .ml {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  padding: 3px 11px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.detail-page .ml-blue   { background: #dbeafe; border: 1px solid #bfdbfe; color: #1d4ed8; }
.detail-page .ml-indigo { background: #e0e7ff; border: 1px solid #c7d2fe; color: #4338ca; }
.detail-page .ml-green  { background: #dcfce7; border: 1px solid #bbf7d0; color: #15803d; }
.detail-page .ml-cyan   { background: #cffafe; border: 1px solid #a5f3fc; color: #0e7490; }
.detail-page .ml-yellow { background: #fef3c7; border: 1px solid #fde68a; color: #b45309; }
.detail-page .ml-gray   { background: #f1f5f9; border: 1px solid #e2e8f0; color: #334155; }

.detail-page .merchant-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 168px;
  width: 168px;
  flex-shrink: 0;
}
.detail-page .btn-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  box-sizing: border-box;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
}
.detail-page .btn-contact:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.detail-page .btn-contact:active { transform: translateY(0); }
.detail-page .btn-contact img {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  object-fit: contain;
}
.detail-page .btn-phone { background: var(--primary-dark); }
.detail-page .btn-wechat { background: #22c55e; }
.detail-page .btn-wechat img { width: 20px; height: 20px; }
.detail-page .detail-seller-badge {
  flex-shrink: 0;
}

/* ============================================
   中部区域：详情说明
   ============================================ */
.detail-section {
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--card-shadow);
  padding: 24px 32px 32px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 0;
}

.detail-block {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.detail-block + .detail-block {
  margin-top: 40px;
  gap: 24px;
}

.section-heading { display: flex; align-items: center; gap: 8px; }
.heading-bar {
  width: 6px;
  height: 24px;
  background: var(--primary-dark);
  border-radius: 1px;
  flex-shrink: 0;
}
.section-heading h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.4;
}

.detail-desc {
  font-size: 18px;
  color: var(--text-main);
  line-height: 1.625;
  word-break: break-word;
}
.detail-desc img { max-width: 100%; height: auto; margin: 12px 0; border-radius: 4px; }
.detail-desc p { margin: 0 0 12px; }
.detail-desc p:last-child { margin-bottom: 0; }
.detail-desc ul, .detail-desc ol { padding-left: 1.5em; margin: 0 0 12px; }

/* 技术参数表（Figma 双列条纹表） */
.spec-table {
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  padding: 32px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.spec-table-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.spec-table-cell {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 9px;
  border-bottom: 1px solid var(--border-mid);
  min-height: 41px;
}
.st-label {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.5;
  flex-shrink: 0;
}
.st-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.5;
  text-align: right;
}

/* 高清实拍 */
.hd-photo-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  width: 100%;
}
.hd-photo {
  width: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

/* ============================================
   下部区域：相似推荐
   ============================================ */
.recommend-section {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 0 0 16px;
  background: transparent;
  box-shadow: none;
}
.recommend-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.recommend-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.2;
}
.more-link {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
  transition: gap .2s;
}
.more-link:hover { gap: 8px; }
.more-link img { width: 16px; height: 16px; }

/* 推荐卡片网格 */
.recommend-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.rec-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: box-shadow .2s, transform .2s;
  cursor: pointer;
}
.rec-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  transform: translateY(-2px);
}
.rec-card-img-wrap {
  position: relative;
  overflow: hidden;
  background: #edeeef;
}
.rec-card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.rec-card:hover .rec-card-img { transform: scale(1.04); }
.rec-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--white);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: .55px;
}
.badge-orange { background: #fea619; }
.badge-dark { background: var(--primary-dark); }

.rec-card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.rec-card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rec-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
}
.rec-price { font-size: 24px; font-weight: 700; color: var(--red); line-height: 1.4; }
.rec-location { font-size: 12px; color: var(--text-muted); }
.rec-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 13px;
}
.rec-year, .rec-condition {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

/* ============================================
   响应式
   ============================================ */

/* 大屏缩小字号 */
@media (max-width: 1200px) {
  .detail-page .product-info-section {
    grid-template-columns: 1fr;
  }
  .detail-page .product-gallery,
  .detail-page .product-detail {
    grid-column: 1 / -1;
  }
  .detail-page .product-title { font-size: 28px; }
  .detail-page .price-value { font-size: 32px; }
  .detail-page .recommend-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-page .recommend-title { font-size: 28px; }
}

/* 平板：商户按钮改到下方整行 */
@media (max-width: 991px) {
  .detail-page .page-container { padding: 0 16px 48px; }
  .detail-page .product-info-section { padding: 20px; }
  .detail-page .main-image-wrap,
  .detail-page .main-image { height: 360px; }
  .detail-page .thumbnail-strip .thumb-item { height: 88px; }
  .detail-page .product-title { font-size: 24px; }
  .detail-page .price-value { font-size: 30px; }
  .detail-page .spec-grid { grid-template-columns: 1fr; }
  .detail-page .service-row { padding: 12px 0; gap: 12px; }
  .detail-page .service-title { width: auto; }
  .detail-page .service-items { padding-left: 0; }
  .detail-page .merchant-card {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 20px;
    gap: 16px;
  }
  .detail-page .merchant-avatar {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
  }
  .detail-page .merchant-info {
    flex: 1 1 calc(100% - 72px);
    min-width: 0;
  }
  .detail-page .merchant-name { white-space: normal; }
  .detail-page .merchant-actions {
    flex: 1 1 100%;
    width: 100%;
    flex-direction: row;
    gap: 10px;
  }
  .detail-page .btn-contact {
    flex: 1;
    padding: 11px 16px;
    font-size: 15px;
  }
  .detail-page .detail-section { padding: 20px 16px; }
  .detail-page .spec-table-row { grid-template-columns: 1fr; }
  .detail-page .hd-photo-grid { grid-template-columns: 1fr; }
  .detail-page .recommend-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .detail-page .recommend-grid { gap: 16px; }
}

/* 小平板 / 大手机 */
@media (max-width: 767px) {
  .detail-page .page-container { padding: 0 12px 40px; gap: 16px; }
  .detail-page .product-info-section { padding: 16px; }
  .detail-page .main-image-wrap,
  .detail-page .main-image { height: 280px; }
  .detail-page .thumbnail-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .detail-page .thumbnail-strip .thumb-item { height: 72px; }
  .detail-page .product-title { font-size: 20px; }
  .detail-page .price-label { font-size: 15px; }
  .detail-page .price-value { font-size: 26px; }
  .detail-page .service-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .detail-page .service-tags { width: 100%; }
  .detail-page .recommend-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .detail-page .recommend-title { font-size: 22px; }
  .detail-page .rec-card-title { font-size: 16px; }
  .detail-page .rec-price { font-size: 20px; }
  .detail-page .section-heading h2 { font-size: 20px; }
  .detail-page .detail-desc { font-size: 16px; }
}

/* 小手机 */
@media (max-width: 479px) {
  .detail-page .page-container { padding: 0 10px 32px; }
  .detail-page .breadcrumb { padding: 12px 0; gap: 6px; }
  .detail-page .breadcrumb-link,
  .detail-page .breadcrumb-current { font-size: 12px; }
  .detail-page .product-info-section { padding: 12px; gap: 16px; }
  .detail-page .main-image-wrap,
  .detail-page .main-image { height: 220px; }
  .detail-page .thumbnail-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .detail-page .thumbnail-strip .thumb-item { height: 64px; }
  .detail-page .product-title { font-size: 18px; }
  .detail-page .price-value { font-size: 24px; }
  .detail-page .merchant-card { padding: 14px; }
  .detail-page .merchant-avatar {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
  }
  .detail-page .merchant-name { font-size: 16px; }
  .detail-page .btn-contact {
    padding: 10px 10px;
    font-size: 13px;
    gap: 6px;
  }
  .detail-page .btn-contact img { width: 16px; height: 16px; }
  .detail-page .ml { font-size: 11px; padding: 2px 8px; }
  .detail-page .merchant-stars img { width: 11px; height: 11px; }
  .detail-page .recommend-grid { grid-template-columns: 1fr; }
  .detail-page .recommend-title { font-size: 20px; }
  .detail-page .detail-section { padding: 16px 12px; }
}
