/* 独立商品与内容页样式。data-view 在 HTML 解析初期决定首屏显示，避免加载时先闪出首页目录。 */
/* 按页面类型隐藏无关区域；保留 DOM 供共享脚本初始化，避免重复建立页面结构。 */
html[data-view="product"] #catalog-page,
html[data-view="product"] .exchange-rail {
  display: none;
}
html[data-view="content"] #catalog-page,
html[data-view="content"] #product-page,
html[data-view="content"] .exchange-rail {
  display: none;
}
/* 购物清单、结算、订单、客服、指南及说明的独立内容页面。 */
.content-page {
  max-width: 1080px;
  padding: 24px 0 48px;
  min-height: 65vh;
}
.content-breadcrumb {
  margin-bottom: 20px;
  font-size: 14px;
  color: #6b7684;
}
.content-surface {
  padding: 32px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.content-surface > #page-title {
  font-size: 27px;
  margin: 0 0 22px;
  line-height: 1.4;
}
.content-surface .policy-copy,
.content-surface > p {
  font-size: 16px;
}
.content-surface .chat-log {
  min-height: 320px;
  max-height: 55vh;
}
.content-surface .support-header #page-title {
  font-size: 26px;
}
.wallet-address {
  overflow-wrap: anywhere;
  word-break: break-all;
}
.network-tag {
  white-space: normal;
}
/* 屏幕宽度不超过 760px 时的布局调整；媒体规则的包含关系是合法 CSS 语法。 */
@media (max-width: 760px) {
  .content-page {
    width: calc(100% - 28px);
    padding-top: 16px;
  }
  .content-surface {
    padding: 20px;
  }
  .content-surface > #page-title {
    font-size: 23px;
  }
  .wallet-header {
    flex-wrap: wrap;
    gap: 8px;
  }
}
/* 商品详情主体及返回目录的面包屑。 */
.product-page {
  padding-top: 24px;
  padding-bottom: 48px;
  max-width: 1160px;
}
.product-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: #6b7684;
  font-size: 14px;
  margin: 0 0 22px;
  overflow-wrap: anywhere;
}
.product-breadcrumb span:last-child {
  max-width: 660px;
  color: #454e5b;
}
/* 商品图库和购买面板双栏；窄屏使用下方响应式规则切换为单列。 */
.product-overview {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
  gap: 40px;
  background: #fff;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.product-photo-column {
  min-width: 0;
}
.product-main-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid #edf0f3;
  border-radius: 6px;
  background: #fff;
}
/* 商品缩略图按钮；aria-pressed 表示当前主图，由详情点击事件更新。 */
.product-thumbnails {
  display: flex;
  gap: 10px;
  overflow: auto;
  margin-top: 12px;
  padding: 2px;
}
.product-thumbnails button {
  flex: 0 0 72px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.product-thumbnails button[aria-pressed="true"] {
  border-color: var(--accent);
}
.product-thumbnails img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
.product-page-category {
  font-size: 14px;
  color: #c4640f;
  margin: 0 0 8px;
}
.product-buy-panel h1 {
  font-size: 27px;
  line-height: 1.5;
  margin: 0 0 16px;
  overflow-wrap: anywhere;
}
.product-page-summary {
  color: #67717f;
  font-size: 16px;
  line-height: 1.8;
  margin: 0 0 16px;
  overflow-wrap: anywhere;
}
/* 规格价格与数量控件；改变规格时 JS 更新单价，成交金额再由后端报价核对。 */
.product-price-panel {
  background: #fff6eb;
  border-radius: 6px;
  padding: 18px 20px;
  margin: 20px 0;
  color: #8a5a31;
  font-size: 14px;
}
.product-price-panel .payment-amount {
  font-size: 34px;
  margin: 2px 0 0;
  color: #df6b00;
  line-height: 1.5;
}
.product-price-panel .payment-amount small {
  display: inline;
  margin-left: 10px;
  font-size: 14px;
  color: #8a7059;
}
.product-spec-field {
  font-size: 15px;
  margin: 20px 0;
}
.product-spec-field select {
  width: 100%;
  font-size: 15px;
  padding: 12px;
  background: #fff;
  border: 1px solid #d7dce3;
  border-radius: 5px;
}
.product-quantity-field {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  margin: 18px 0;
}
.product-quantity-field input {
  width: 80px;
  padding: 10px;
  border: 1px solid #d7dce3;
  border-radius: 5px;
  font-size: 16px;
}
.product-quantity-field span {
  font-size: 14px;
  color: #7a8491;
}
/* 加入合并清单及立即购买按钮；缺货/汇率不可用时禁用。 */
.product-buy-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.product-buy-actions .button {
  flex: 1;
  min-height: 48px;
  font-size: 16px;
}
.product-service-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 18px 0;
  font-size: 14px;
}
.product-facts {
  padding-top: 12px;
  border-top: 1px solid #edf0f3;
  font-size: 14px;
  color: #6b7684;
}
.product-facts div {
  display: flex;
  gap: 18px;
  margin: 7px 0;
}
.product-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
/* 商品详细说明、交易、交付、退款、注意事项等章节。 */
.product-detail-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 24px;
  padding: 0 32px 32px;
}
.product-detail-panel .detail-tabs {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  gap: 22px;
  margin: 0;
}
.product-detail-panel .detail-tabs button {
  font-size: 16px;
  padding: 10px 0;
}
.product-detail-panel .detail-section {
  scroll-margin-top: 170px;
}
.product-detail-panel .detail-heading {
  font-size: 21px;
  margin-top: 26px;
}
.product-detail-panel .product-detail-copy {
  font-size: 16px;
  line-height: 1.95;
}
/* 商品不存在/下架/接口异常时的提示和返回列表入口。 */
.product-page-empty {
  text-align: center;
  padding: 70px 20px;
  background: #fff;
  border: 1px solid var(--line);
}
.product-page-empty h1 {
  font-size: 24px;
}
.product-page-empty p {
  font-size: 16px;
  color: #6b7684;
}
.product-title-button {
  display: block;
  text-align: left;
}
.view-product {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.header-search,
.header-search input,
.product-main,
.product-buy-panel,
.pricing-breakdown dt,
.content-surface {
  min-width: 0;
}
.product-title,
.product-description,
.product-meta-line,
.product-tags,
.cart-row-info,
.order-card,
.order-id,
.spec-item,
.policy-copy,
.chat-bubble,
.conversation-row {
  overflow-wrap: anywhere;
}
.product-spec-field select,
.form-field input,
.form-field select,
.form-field textarea {
  max-width: 100%;
  min-width: 0;
}
.desktop-nav {
  height: auto;
  min-height: 43px;
  flex-wrap: wrap;
}
.desktop-nav > a,
.desktop-nav > button {
  min-height: 43px;
}
.desktop-nav > button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0 20px;
  font: inherit;
  cursor: pointer;
}
.desktop-nav > button:hover {
  background: #ef6c00;
}
.desktop-nav > .nav-support {
  padding-right: 0;
}
.product-spec-field select {
  font-size: 16px;
}
#product-page-inventory .product-inventory {
  font-size: 15px;
  margin: 0 0 18px;
}
#product-page-inventory .product-inventory small {
  font-size: 13px;
}
.product-buy-actions .button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.dialog-actions {
  flex-wrap: wrap;
}
.pricing-breakdown dl > div {
  flex-wrap: wrap;
}
.cart-summary {
  flex-wrap: wrap;
  gap: 12px;
}
/* 屏幕宽度不超过 900px 时的布局调整；媒体规则的包含关系是合法 CSS 语法。 */
@media (max-width: 900px) {
  .navigation-border {
    display: none;
  }
  .mobile-menu-toggle {
    display: inline-flex;
    flex-shrink: 0;
  }
  .mobile-nav {
    max-height: 65vh;
    overflow: auto;
  }
  .mobile-nav a,
  .mobile-nav button {
    display: block;
    width: 100%;
    padding: 12px;
    text-align: left;
    min-height: 44px;
    border: 0;
    background: transparent;
  }
  .product-overview {
    gap: 24px;
    padding: 24px;
  }
}
/* 屏幕宽度不超过 600px 时的布局调整；媒体规则的包含关系是合法 CSS 语法。 */
@media (max-width: 600px) {
  .topbar {
    display: none;
  }
  .content-surface {
    padding: 18px;
  }
  .content-surface .form-field input,
  .content-surface .form-field textarea,
  .content-surface .form-field select,
  .chat-form textarea {
    font-size: 16px;
  }
  .product-buy-actions {
    flex-direction: column-reverse;
  }
  .product-buy-actions .button {
    flex: auto;
    width: 100%;
  }
  .cart-row-info {
    flex-basis: calc(100% - 64px);
  }
  .cart-row-price {
    margin-left: auto;
  }
  .catalog-toolbar {
    flex-wrap: wrap;
  }
  .catalog-toolbar > div:first-child {
    flex-wrap: wrap;
  }
  .product-purchase {
    margin-left: 0;
    width: 100%;
  }
  .product-price small {
    white-space: normal;
  }
  .product-main {
    min-width: 0;
  }
  .pricing-breakdown {
    padding: 14px;
  }
  .pricing-breakdown dl > div {
    gap: 4px 12px;
  }
  .wallet-address {
    font-size: 13px;
  }
  .wallet-header .network-tag {
    max-width: 100%;
  }
  .content-surface .chat-form {
    flex-wrap: wrap;
  }
  .content-surface .chat-form textarea {
    flex-basis: 100%;
    width: 100%;
  }
  .content-surface .chat-form button {
    margin-left: auto;
    min-height: 44px;
  }
  .order-card-top {
    flex-wrap: wrap;
    gap: 8px;
  }
  .catalog-pager {
    flex-wrap: wrap;
  }
  .merchant-quality {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}
/* 屏幕宽度不超过 760px 时的布局调整；媒体规则的包含关系是合法 CSS 语法。 */
@media (max-width: 760px) {
  .product-page {
    width: calc(100% - 28px);
    padding-top: 16px;
  }
  .product-breadcrumb {
    font-size: 14px;
  }
  .product-breadcrumb span:last-child {
    display: none;
  }
  .product-overview {
    display: block;
    padding: 20px;
    gap: 0;
  }
  .product-main-photo {
    max-height: 350px;
    aspect-ratio: 1;
  }
  .product-buy-panel {
    margin-top: 24px;
  }
  .product-buy-panel h1 {
    font-size: 22px;
  }
  .product-page-summary {
    font-size: 15px;
  }
  .product-price-panel {
    padding: 14px;
  }
  .product-price-panel .payment-amount {
    font-size: 29px;
  }
  .product-quantity-field {
    flex-wrap: wrap;
  }
  .product-detail-panel {
    padding: 0 20px 24px;
  }
  .product-detail-panel .detail-tabs {
    gap: 16px;
  }
  .product-detail-panel .detail-tabs button {
    font-size: 14px;
  }
  .product-detail-panel .detail-section {
    scroll-margin-top: 125px;
  }
  .product-buy-actions {
    gap: 10px;
  }
}
