/* =============================================================================
   商品详情页专用样式
============================================================================= */

/* 面包屑导航 */
.breadcrumb {
  display: flex;
  align-items: center;
  margin: 0 0 24px 0;
  font-size: 14px;
  color: #666;
}

.breadcrumb-link {
  color: #1890ff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb-link:hover {
  color: #1890ff90;
}

.breadcrumb-separator {
  margin: 0 8px;
  font-size: 12px;
  color: #ccc;
}

.breadcrumb-current {
  color: #222;
  font-weight: 500;
}

/* 详情页特殊容器样式 */
.detail-container {
  width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: block;
  /* 覆盖base.css中的flex布局 */
}

/* 标签样式 */
.n-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: #1890ff;
  background: #1890ff20;
  font-weight: 500;
  border: none;
}

/* 文本颜色 */
.text-red {
  font-size: 18px;
  color: #ef4444;
  font-weight: 700;
}

.text-gray {
  color: #666;
  font-weight: 400;
}

/* 分隔线 */
.divider-vertical {
  display: inline-block;
  margin: 0 12px;
  height: 16px;
  width: 1px;
  vertical-align: middle;
  background: #e5e5e5;
}

/* 按钮样式 */
.button {
  background: #fff;
  border: 1px solid #e5e5e5;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.button:hover {
  border-color: #1890ff;
  color: #1890ff;
  transform: translateY(-1px);
}

.button-primary {
  background: #1890ff;
  color: #fff;
  border: 1px solid #1890ff;
}

.button-primary:hover {
  background: #5b21b6;
  border-color: #5b21b6;
  color: #fff;
}

/* 布局 */
.main-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.col-left {
  flex: 2;
  min-width: 0;
  width: 66%;
}

.col-right {
  flex: 1;
  min-width: 0;
  width: 33%;
  position: sticky;
  top: 87px;
  align-self: flex-start;
}

/* 商品信息区域 */
.product-box {
  display: flex;
  padding: 24px;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
}

.product-image {
  width: 140px;
  height: 140px;
  border-radius: 8px;
  background: #f5f5f5;
  margin-right: 24px;
  overflow: hidden;
  flex-shrink: 0;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 140px;
  flex-grow: 1;
}

.g-name {
  font-size: 18px;
  font-weight: 600;
  color: #222;
  margin-bottom: 8px;
  margin-top: 0;
  line-height: 1.4;
}

.g-desc {
  font-size: 15px;
  color: #666;
  margin-bottom: 12px;
  margin-top: 0;
  line-height: 1.5;
}

.action-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* 商品详情内容 */
.markdown-body {
  min-height: 100px;
  width: 100%;
}

.markdown-body:empty::before {
  content: '暂无商品详情';
  color: #999;
  font-size: 14px;
  display: block;
  text-align: center;
  padding: 40px 0;
}

.markdown-body h4 {
  font-weight: 600;
  font-size: 17px;
  color: #222;
  margin-top: 24px;
  margin-bottom: 8px;
}

.markdown-body h4:first-child {
  margin-top: 0;
}

.markdown-body p,
.markdown-body ul {
  line-height: 1.7;
  margin-top: 0;
  margin-bottom: 16px;
  color: #555;
  font-size: 15px;
}

.markdown-body code {
  background: #f8f9ff;
  color: #1890ff;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  margin: 0 3px !important;
  border-bottom: 3px solid #1890ff20;
}

/* blockquote 引用样式 */
.markdown-body blockquote {
  margin: 20px 0;
  padding: 16px 20px;
  border-left: 4px solid #7c3aed;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.05) 0%, transparent 100%);
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.7;
  color: #666;
  font-style: italic;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
  width: auto !important; /* 覆盖内联样式的 width */
}

.markdown-body blockquote p {
  margin-bottom: 12px;
}

.markdown-body blockquote p:last-child {
  margin-bottom: 0;
}

.hot-wrapper {
  font-size: 14px;
  color: #666;
  display: flex;
  align-items: center;
}

.hot-wrapper svg {
  color: #e67e7e;
}

/* 表单样式 */
.form-item {
  margin-bottom: 20px;
}

.form-item>label {
  display: block;
  font-size: 15px;
  color: #222;
  font-weight: 500;
  margin-bottom: 8px;
}

.input-text {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 15px;
  background: #fff;
  outline: none;
  transition: border-color 0.3s ease;
}

.input-text:focus {
  border-color: #1890ff;
  box-shadow: 0 0 0 3px #1890ff20;
}

.input-number-group {
  display: flex;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e5e5e5;
}

.input-number-group button {
  width: 44px;
  height: 44px;
  border: none;
  background: #f8f9fa;
  cursor: not-allowed;
  font-size: 16px;
  color: #ccc;
  transition: all 0.3s ease;
}

.input-number-group button:not([disabled]) {
  background: #fff;
  color: #1890ff;
  cursor: pointer;
}

.input-number-group button:not([disabled]):hover {
  background: #f8f9ff;
}

.input-number-group input {
  flex-grow: 1;
  text-align: center;
  border: none;
  height: 44px;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
  -moz-appearance: textfield;
}

/* 移除input type 为 number 的加减按钮的样式 */
.input-number-group input::-webkit-outer-spin-button,
.input-number-group input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* 数量按钮样式 */
.quantity-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  color: #1890ff;
  transition: all 0.3s ease;
  font-weight: 600;
}

.quantity-btn:hover {
  background: #f8f9ff;
  color: #5b21b6;
}

.quantity-btn:disabled {
  background: #f8f9fa;
  color: #ccc;
  cursor: not-allowed;
}

/* 支付方式 */
.payment-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bomaos-check-card {
  cursor: pointer;
  border: 1px solid #e5e5e5;
  padding: 12px 16px;
  border-radius: 6px;
  text-align: center;
  transition: all 0.3s ease;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bomaos-check-card:hover {
  border-color: #1890ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px #1890ff20;
}

.payment-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #333;
  font-weight: 500;
  line-height: 1.2;
}

.payment-btn img {
  width: auto;
  height: 24px;
  max-width: 80px;
  margin-right: 12px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}

.bomaos-check-card:first-child {
  border-color: #1890ff;
  background: #f0f5ff;
}

/* 底部结算 */
.footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-top: 1px solid #f3f3f3;
  background: #fafbff;
}

.money {
  color: #ef4444;
  font-weight: 700;
}

.money .small {
  font-size: 16px;
}

.money span:last-child {
  font-size: 28px;
}

.submit-button {
  height: 48px;
  padding: 0 32px;
  border-radius: 24px;
  background: #1890ff20;
  color: #1890ff;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.submit-button:hover {
  background: #1890ff30;
  transform: translateY(-2px);
}

/* 移动端专用付款区域 */
.mobile-payment-card {
  display: none;
}

/* 响应式设置 */
@media (max-width: 1240px) {
  .detail-container {
    width: 100%;
    padding: 0 20px;
  }
}

@media (max-width: 768px) {

  /* 隐藏面包屑导航 */
  .breadcrumb {
    display: none;
  }

  /* 移动端显示右侧付款区域 */
  .col-right {
    display: block;
    position: static;
    top: auto;
  }

  /* 容器调整 */
  .detail-container {
    padding: 16px;
    padding-bottom: 20px;
    margin-bottom: 30px;
  }

  .main-row {
    display: flex;
    flex-direction: column;
    gap: 12px; /* 减小间距 */
    width: 100%;
  }

  /* 移动端调整显示顺序：商品信息 → 付款表单 → 批发价/详情介绍 */
  .col-left {
    width: 100%;
    min-width: 100%;
    display: contents; /* 让子元素变成 main-row 的直接 flex items */
  }

  /* 商品信息卡片显示在最前面 */
  .col-left > .n-card:nth-child(1) {
    order: 1;
    width: 100%;
    min-width: 100%;
  }

  /* 付款表单显示在商品信息后面 */
  .col-right {
    width: 100%;
    min-width: 100%;
    order: 2;
  }

  /* 批发价格和详细介绍显示在最后 */
  .col-left > .n-card:nth-child(2) {
    order: 3;
    margin-top: 0; /* 重置原来的 margin-top */
    width: 100%;
    min-width: 100%;
  }
  
  .col-left > .n-card:nth-child(3) {
    order: 4;
    margin-top: 0; /* 重置原来的 margin-top */
    width: 100%;
    min-width: 100%;
  }

  /* 付款表单卡片内部调整 */
  .col-right .n-card {
    margin-bottom: 0;
    width: 100%;
    min-width: 100%;
  }

  /* 商品信息区域移动端优化 */
  .product-box {
    flex-direction: column;
    padding: 16px;
    text-align: center;
    min-width: 100%;
    width: 100%;
  }

  .product-image {
    width: 120px;
    height: 120px;
    margin: 0 auto 16px auto;
    align-self: center;
  }

  .product-info {
    height: auto;
    text-align: left;
    width: 100%;
    min-width: 100%;
  }

  .g-name {
    font-size: 16px;
    margin-bottom: 6px;
    width: 100%;
    word-wrap: break-word;
  }

  .g-desc {
    font-size: 14px;
    margin-bottom: 10px;
    width: 100%;
    word-wrap: break-word;
  }

  .action-bar {
    gap: 12px;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  /* 卡片内边距调整 */
  .n-card__content {
    padding: 16px;
    width: 100%;
    min-width: 100%;
    box-sizing: border-box;
  }

  .n-card-header {
    padding: 12px 16px !important;
    font-size: 16px;
    width: 100%;
    min-width: 100%;
    box-sizing: border-box;
  }

  /* 表单优化 */
  .form-item {
    margin-bottom: 16px;
  }

  .form-item label {
    font-size: 14px;
    /* margin-bottom: 6px; */
  }

  .input-text {
    height: 40px;
    font-size: 14px;
  }

  .input-number-group {
    height: 40px;
  }

  .input-number-group button,
  .input-number-group input {
    font-size: 14px;
  }

  /* 支付方式优化 */
  .payment-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .bomaos-check-card {
    padding: 2px 8px;
    min-height: 48px;
  }

  .payment-btn {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
  }

  .payment-btn img {
    width: auto;
    height: 18px;
    max-width: 60px;
    margin-right: 8px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
  }

  /* 底部栏优化 */
  .footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    flex-direction: row;
  }

  .money {
    margin-right: 16px;
  }

  .money span:last-child {
    font-size: 24px;
  }

  .submit-button {
    height: 44px;
    padding: 0 6px;
    font-size: 15px;
    border-radius: 22px;
    flex: 1;
    max-width: 120px;
  }

  /* 详情内容优化 */
  .markdown-body {
    width: 100%;
    min-width: 100%;
    box-sizing: border-box;
  }

  .markdown-body h4 {
    font-size: 16px;
    margin-top: 20px;
    margin-bottom: 6px;
    width: 100%;
    word-wrap: break-word;
  }

  .markdown-body p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
    width: 100%;
    word-wrap: break-word;
  }

  .markdown-body code {
    font-size: 13px;
    padding: 2px 4px;
  }

  /* blockquote 引用样式优化 */
  .markdown-body blockquote {
    margin: 12px 0;
    padding: 10px 12px;
    border-left: 3px solid #d5d5d5;
    /* background: linear-gradient(90deg, rgba(124, 58, 237, 0.05) 0%, transparent 100%); */
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    font-style: italic;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    width: auto !important; /* 覆盖内联样式的 width */
  }

  .markdown-body blockquote p {
    margin-bottom: 8px;
  }

  .markdown-body blockquote p:last-child {
    margin-bottom: 0;
  }

  /* 热门标签优化 */
  .hot-wrapper {
    font-size: 13px;
  }

  .hot-wrapper svg {
    width: 14px;
    height: 14px;
    margin-right: 4px;
  }

  /* 分隔符调整 */
  .divider-vertical {
    margin: 0 8px;
    height: 14px;
  }

  /* 按钮调整 */
  .button {
    padding: 6px 12px;
    font-size: 13px;
  }

  .n-tag {
    padding: 3px 8px;
    font-size: 12px;
  }
}

/* 小屏幕进一步优化 */
@media (max-width: 480px) {
  .detail-container {
    padding: 12px;
  }

  .product-box {
    padding: 12px;
  }

  .product-image {
    width: 100px;
    height: 100px;
  }

  .g-name {
    font-size: 15px;
  }

  .g-desc {
    font-size: 13px;
  }

  .action-bar {
    gap: 8px;
  }

  .payment-options {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .payment-btn {
    padding: 10px 12px;
    justify-content: flex-start;
  }

  .footer-bar {
    gap: 12px;
    align-items: center;
  }

  .money {
    margin-right: 0;
    text-align: center;
  }

  .submit-button {
    width: 100%;
    justify-content: center;
  }

  .main-row {
    gap: 0;
  }
}