/* 商品目录及后台商品管理补充样式。与 styles.css、live.css 一起使用；选择器沿用现有 DOM，格式化和注释不改变布局。 */
/* 品质保障按钮与商家承诺说明；点击入口映射到 /help/quality。 */
.quality-badge {
  display: inline-flex;
  background: none;
  border: 0;
  padding: 0;
  vertical-align: middle;
  cursor: pointer;
}
.quality-badge img {
  width: 112px;
  height: 30px;
  object-fit: contain;
}
.product-tags .quality-badge {
  margin: 2px 8px 2px 0;
}
.quality-caption {
  color: #6d8473;
  font-size: 12px;
  line-height: 1.8;
}
.merchant-quality {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 17px 20px;
  background: #f4faf6;
  border: 1px solid #dcebdd;
  margin: 18px 0;
}
.merchant-quality img {
  width: 136px;
  height: 36px;
  flex-shrink: 0;
}
.merchant-quality strong {
  font-size: 14px;
  color: #387449;
}
.merchant-quality p {
  font-size: 13px;
  color: #758279;
  margin: 4px 0;
  line-height: 1.7;
}
/* 目录读取状态与商品文字详情；白空格保留用于展示导入说明的换行。 */
.catalog-status {
  padding: 24px;
  text-align: center;
  color: #888;
}
.product-detail-copy {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.95;
}
/* 后台商品搜索、状态筛选和表格；小屏可横向滚动，避免丢失操作列。 */
.product-manager-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: white;
  border: 1px solid #e4e6e8;
}
.product-manager-toolbar input,
.product-manager-toolbar select {
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  max-width: 200px;
}
.product-manager-toolbar > div {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.product-manager-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.product-manager-table td,
.product-manager-table th {
  padding: 15px 18px;
  border-bottom: 1px solid #e9e9e9;
  text-align: left;
}
.product-manager-table th {
  background: #fafafa;
  color: #888;
  font-size: 12px;
  font-weight: 500;
}
.product-manager-table td:first-child {
  display: flex;
  align-items: center;
  gap: 14px;
}
.product-manager-table td:first-child img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border: 1px solid #eee;
  border-radius: 4px;
}
.product-manager-table td:first-child small {
  display: block;
  color: #999;
  margin-top: 6px;
  font-size: 12px;
}
.product-manager-table button {
  border: 0;
  background: none;
  color: #db7418;
  padding: 6px;
}
.product-manager-table .delete-product {
  color: #b2655d;
}
.product-manager-wrap {
  overflow: auto;
  background: white;
  border: 1px solid #e4e6e8;
  border-top: 0;
}
.product-status {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  white-space: nowrap;
}
.product-status.published {
  color: #39804f;
  background: #ecf7ef;
}
.product-status.draft,
.product-status.hidden {
  color: #777;
  background: #f0f1f2;
}
/* 后台商品编辑表单、字段网格和图片上传预览。独立编辑页面的宽度覆盖见 admin-pages.css。 */
.product-editor {
  width: min(840px, calc(100vw - 28px));
  border: 0;
  border-radius: 9px;
  padding: 0;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 15px 80px #0003;
}
.product-editor::backdrop {
  background: #18212b73;
}
.product-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 26px;
  border-bottom: 1px solid #ececec;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
}
.product-editor-header h2 {
  font-size: 20px;
  margin: 0;
}
.product-editor-header button {
  background: none;
  border: 0;
  font-size: 26px;
  line-height: 1;
  color: #999;
}
.product-editor form {
  padding: 22px 26px;
}
.editor-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.editor-columns .form-field {
  margin-bottom: 17px;
}
.editor-columns .full {
  grid-column: 1/-1;
}
.image-editor {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 15px;
  border: 1px dashed #d7dadd;
  border-radius: 5px;
  margin: 10px 0 20px;
}
.image-editor img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #eee;
}
.image-editor > div {
  flex: 1;
  min-width: 0;
}
.image-editor p {
  font-size: 12px;
  color: #999;
  line-height: 1.7;
}
.image-editor select {
  max-width: 100%;
  padding: 7px;
}
.image-editor input {
  max-width: 100%;
  font-size: 13px;
}
.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid #eee;
  padding-top: 20px;
  margin-top: 20px;
}
/* 商品删除确认区域；只提供按钮视觉，版本核对和删除由管理 API 执行。 */
.product-delete-dialog {
  border: 0;
  border-radius: 8px;
  padding: 26px;
  width: min(420px, calc(100vw - 30px));
}
.product-delete-dialog p {
  font-size: 14px;
  line-height: 1.8;
  color: #777;
}
.product-delete-dialog::backdrop {
  background: #18212b73;
}
.product-editor [hidden] {
  display: none !important;
}
.product-manager-count {
  font-size: 12px;
  color: #999;
  padding: 14px 20px;
  background: #fff;
  border: 1px solid #e4e6e8;
  border-top: 0;
}
/* 屏幕宽度不超过 620px 时的布局调整；媒体规则的包含关系是合法 CSS 语法。 */
@media (max-width: 620px) {
  .editor-columns {
    display: block;
  }
  .product-editor form {
    padding: 18px;
  }
  .product-editor-header {
    padding: 18px;
  }
  .product-manager-toolbar {
    align-items: flex-start;
  }
  .product-manager-toolbar > div {
    gap: 7px;
  }
  .product-manager-toolbar input {
    width: 150px;
  }
  .product-manager-table {
    min-width: 660px;
  }
  .image-editor {
    align-items: flex-start;
  }
  .image-editor img {
    width: 72px;
    height: 72px;
  }
  .merchant-quality {
    padding: 12px;
    gap: 10px;
  }
  .merchant-quality img {
    width: 112px;
    height: 30px;
  }
}

/* 目录分类选择框和分页按钮；当前筛选状态由 catalog.js 渲染。 */
.category-panel {
  max-height: 700px;
  overflow-y: auto;
}
.catalog-category-select {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  padding: 8px 0;
}
.catalog-category-select select {
  font: inherit;
  padding: 9px 12px;
  max-width: 240px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
}
.catalog-pager {
  display: flex;
  justify-content: center;
  gap: 20px;
  align-items: center;
  margin: 24px 0;
  font-size: 14px;
}
.catalog-pager button:disabled {
  opacity: 0.45;
  cursor: default;
}
/* 商品说明图片区及图库，等比缩放并避免图片超过内容宽度。 */
.product-detail-picture {
  margin: 18px 0;
}
.product-detail-picture img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: auto;
}
.product-gallery {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 12px;
}
.product-gallery img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  border: 1px solid #eee;
}
.product-source {
  margin-top: 20px;
  border: 1px solid #eee;
  padding: 14px;
  font-size: 14px;
  line-height: 1.8;
}
.detail-tabs {
  flex-wrap: wrap;
}
.product-detail-copy {
  font-size: 16px;
}
/* 后台资料导入面板、校验文字和进度条；hidden 属性控制显示，不在 CSS 中决定是否执行导入。 */
.catalog-import {
  background: #fff;
  border: 1px solid #e4e6e8;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.catalog-import p {
  font-size: 14px;
  line-height: 1.8;
}
.catalog-import progress {
  width: 100%;
  height: 12px;
}
.catalog-import [hidden] {
  display: none !important;
}
/* 屏幕宽度不超过 620px 时的布局调整；媒体规则的包含关系是合法 CSS 语法。 */
@media (max-width: 620px) {
  .catalog-category-select {
    gap: 8px;
  }
  .catalog-category-select select {
    max-width: 210px;
  }
  .category-panel {
    max-height: 400px;
  }
  .catalog-pager {
    gap: 12px;
  }
}
.catalog-pricing,
/* 报价和订单金额明细：基础价、汇率、手续费和总额。 */
.pricing-breakdown {
  padding: 18px 20px;
  margin: 16px 0;
  background: #fff8ee;
  border: 1px solid #f4d8b3;
  border-radius: 12px;
  color: #493c2e;
  line-height: 1.7;
}
.catalog-pricing p,
.pricing-breakdown p {
  margin: 6px 0;
  font-size: 13px;
}
.catalog-pricing button,
.text-button {
  color: #a74400;
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}
.pricing-breakdown h3 {
  margin: 0 0 8px;
}
.pricing-breakdown dl {
  margin: 12px 0 0;
}
.pricing-breakdown dl > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  border-top: 1px solid #eadfce;
}
.pricing-breakdown dd {
  margin: 0;
  white-space: nowrap;
}
.pricing-breakdown dt {
  font-size: 14px;
}

/* 分类与兑换广告共享所有顾客页面顶部。 */
/* 首页分类入口与交易平台卡片的同行布局。 */
.catalog-entry-row {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}
.catalog-entry-row > .catalog-tabs {
  min-width: 0;
  align-items: center;
  padding: 14px 18px;
}
.catalog-entry-row .catalog-category-select {
  min-width: 0;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.catalog-entry-row .catalog-category-select select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.catalog-exchanges {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}
.catalog-exchanges .exchange-poster {
  min-width: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-rows: auto auto auto auto auto;
  gap: 3px 10px;
  padding: 12px 14px;
  text-align: left;
  align-content: center;
  align-items: center;
}
.catalog-exchanges .exchange-tag {
  grid-column: 1/-1;
  grid-row: 1;
  font-size: 9px;
  line-height: 1.4;
}
.catalog-exchanges .exchange-brand,
.catalog-exchanges .exchange-poster.okx .exchange-brand {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.catalog-exchanges .exchange-brand span {
  font-size: 12px;
  font-weight: 500;
}
.catalog-exchanges .exchange-art {
  grid-column: 1;
  grid-row: 2/5;
  width: 52px;
  height: 64px;
  margin: 0;
}
.catalog-exchanges .exchange-poster h3 {
  grid-column: 2;
  grid-row: 3;
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
}
.catalog-exchanges .exchange-poster p {
  display: none;
}
.catalog-exchanges .exchange-cta {
  grid-column: 2;
  grid-row: 4;
  min-width: 0;
  width: 100%;
  min-height: 28px;
  padding: 5px 7px;
  font-size: 11px;
  line-height: 1.4;
  margin-top: 2px;
}
.catalog-exchanges .exchange-domain {
  grid-column: 1/-1;
  grid-row: 5;
  font-size: 9px;
  line-height: 1.4;
  color: #a8afb9;
}
.catalog-exchanges .exchange-poster small {
  grid-column: 1/-1;
  grid-row: 6;
  margin: 0;
  font-size: 9px;
  line-height: 1.4;
}
.catalog-exchanges .exchange-poster small br {
  display: none;
}
/* 屏幕宽度不超过 1100px 时的布局调整；媒体规则的包含关系是合法 CSS 语法。 */
@media (max-width: 1100px) {
  .catalog-entry-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .catalog-entry-row > .catalog-tabs {
    padding: 0 14px;
  }
  .catalog-entry-row .catalog-category-select {
    flex-direction: row;
    align-items: center;
    width: auto;
  }
  .catalog-entry-row .catalog-category-select select {
    width: auto;
    max-width: 240px;
  }
}
/* 屏幕宽度不超过 600px 时的布局调整；媒体规则的包含关系是合法 CSS 语法。 */
@media (max-width: 600px) {
  .catalog-exchanges {
    gap: 10px;
  }
  .catalog-exchanges .exchange-poster {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 3px 7px;
    padding: 10px;
  }
  .catalog-exchanges .exchange-art {
    width: 38px;
    height: 52px;
  }
  .catalog-exchanges .exchange-brand,
  .catalog-exchanges .exchange-poster.okx .exchange-brand {
    font-size: 14px;
  }
  .catalog-exchanges .exchange-brand span {
    font-size: 11px;
  }
  .catalog-exchanges .exchange-cta {
    min-height: 32px;
  }
  .catalog-exchanges .exchange-poster small {
    font-size: 9px;
  }
}
/* 屏幕宽度不超过 360px 时的布局调整；媒体规则的包含关系是合法 CSS 语法。 */
@media (max-width: 360px) {
  .catalog-exchanges .exchange-poster {
    grid-template-columns: 28px minmax(0, 1fr);
    padding: 9px 8px;
    gap: 3px 5px;
  }
  .catalog-exchanges .exchange-art {
    width: 28px;
    height: 46px;
  }
  .catalog-exchanges .exchange-brand,
  .catalog-exchanges .exchange-poster.okx .exchange-brand {
    font-size: 13px;
  }
}

.site-catalog-entry {
  margin-top: 18px;
  margin-bottom: 18px;
}
/* 屏幕宽度不超过 600px 时的布局调整；媒体规则的包含关系是合法 CSS 语法。 */
@media (max-width: 600px) {
  .site-catalog-entry {
    margin-top: 12px;
    margin-bottom: 12px;
  }
}

.catalog-all-link {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.catalog-all-link:hover {
  color: var(--accent);
}
/* 库存/缺货/待确认状态展示；只标识服务器返回结果，不推算或修改库存。 */
.product-inventory {
  margin-top: 10px;
  color: #39764d;
  font-size: 13px;
  line-height: 1.8;
}
.product-inventory small {
  display: block;
  color: #7a8491;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.product-inventory.out-of-stock {
  color: #b25237;
}
.product-inventory.inventory-unknown {
  color: #7a8491;
}
.product-manager-table .inventory-cell {
  min-width: 130px;
}
.product-manager-table .inventory-cell .product-inventory {
  margin-top: 0;
}
