/**
 * 微信扫码页 wechat/scan.php 专用样式（金/黑/白主题，移动端优先）
 */

.wechat-scan-page {
  --yz-gold: #c5a059;
  --yz-gold-dark: #a8863d;
  --yz-black: #1a1a1a;
  --yz-border: #dcdcdc;
  --yz-bg: #ffffff;
  --yz-muted: #666666;
  --yz-text: #222;
  --yz-body-size: 14px;
  --yz-body-lh: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: var(--yz-body-size);
  font-weight: 400;
  line-height: var(--yz-body-lh);
  background: var(--yz-bg);
  color: var(--yz-text);
  margin: 0;
  padding: 0 12px 48px;
  min-height: 100vh;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

.wechat-scan-page *,
.wechat-scan-page *::before,
.wechat-scan-page *::after {
  box-sizing: border-box;
}

.wechat-scan-page .yz-wrap {
  max-width: 480px;
  margin: 0 auto;
}

/* 顶部品牌 */
.yz-brand {
  text-align: center;
  padding: 20px 0 16px;
}

.yz-brand-logo {
  display: block;
  margin: 0 auto 12px;
  max-width: 132px;
  max-height: 132px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.yz-brand-name {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--yz-gold);
  margin: 0;
  letter-spacing: 0.06em;
  line-height: 1.35;
}

/* 卡片通用 */
.yz-card {
  border: 1px solid var(--yz-border);
  border-radius: 8px;
  background: var(--yz-bg);
  margin-bottom: 14px;
  overflow: hidden;
}

.yz-card-head {
  background: var(--yz-black);
  color: var(--yz-gold);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  padding: 10px 12px;
  letter-spacing: 0.12em;
}

.yz-card-body {
  padding: 14px 14px 16px;
}

.yz-hint {
  font-size: var(--yz-body-size);
  font-weight: 400;
  color: var(--yz-muted);
  line-height: var(--yz-body-lh);
  margin: 0 0 12px;
}

/* 防伪查询表单 */
.yz-code-field {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--yz-border);
  border-radius: 4px;
  margin-bottom: 12px;
}

.yz-code-field:focus {
  outline: none;
  border-color: var(--yz-gold);
  box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.2);
}

.yz-meta-row {
  font-size: var(--yz-body-size);
  font-weight: 400;
  margin-bottom: 8px;
  line-height: var(--yz-body-lh);
  word-break: break-all;
}

.yz-meta-row .yz-meta-k {
  color: var(--yz-muted);
  margin-right: 4px;
}

.yz-meta-row .yz-meta-v {
  color: #222;
}

.yz-query-btn-wrap {
  text-align: center;
  margin-top: 14px;
}

.yz-query-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 140px;
  padding: 10px 28px;
  font-size: 15px;
  font-weight: 500;
  color: var(--yz-gold);
  background: var(--yz-black);
  border: none;
  border-radius: 24px;
  cursor: pointer;
  letter-spacing: 0.1em;
}

.yz-query-btn:hover {
  opacity: 0.92;
}

.yz-query-btn .yz-query-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  position: relative;
  flex-shrink: 0;
}

/* 对号在圆内居中（相对父级 50%/50% + 微调视觉重心） */
.yz-query-btn .yz-query-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 9px;
  margin: 0;
  border: solid var(--yz-black);
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -58%) rotate(45deg);
  box-sizing: border-box;
}

.yz-scan-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.yz-scan-actions .yz-scan-extra {
  flex: 1;
  min-width: 0;
}

.yz-btn-scan {
  padding: 10px 16px;
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.yz-btn-scan.d-none {
  display: none !important;
}

/* 验证结果条 */
.yz-result-banner {
  padding: 12px 14px;
  font-size: var(--yz-body-size);
  font-weight: 400;
  line-height: var(--yz-body-lh);
  border-radius: 6px;
  margin-top: 12px;
}

.yz-result-banner--ok {
  background: #f0f7f0;
  color: #1e6b2e;
  border: 1px solid #c8e6c9;
}

.yz-result-banner--bad {
  background: #fff5f5;
  color: #b71c1c;
  border: 1px solid #ffcdd2;
}

.yz-result-banner--neutral {
  background: #f8f8f8;
  color: #444;
  border: 1px solid var(--yz-border);
}

/* 产品信息 */
/* 主图：横竖版均与下方表格同宽（竖版不再因 max-height 先触顶而变窄留空） */
.yz-product-photo {
  margin: 0 0 14px;
  width: 100%;
}

.yz-product-photo img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--yz-border);
  border-radius: 4px;
  vertical-align: middle;
}

.yz-spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--yz-body-size);
  font-weight: 400;
}

.yz-spec-table th,
.yz-spec-table td {
  border: 1px solid var(--yz-border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.yz-spec-table th {
  background: #fafafa;
  color: var(--yz-muted);
  font-weight: 500;
  width: 38%;
}

.yz-spec-table td {
  color: var(--yz-text);
  word-break: break-word;
}

/* 手风琴 */
.yz-acc {
  margin-top: 10px;
}

.yz-acc-item {
  border: 1px solid var(--yz-border);
  border-radius: 8px;
  margin-bottom: 10px;
  background: #fff;
  overflow: hidden;
}

.yz-acc-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border: none;
  background: #fff;
  font-size: var(--yz-body-size);
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  color: var(--yz-text);
  gap: 10px;
}

.yz-acc-trigger:focus {
  outline: 2px solid rgba(197, 160, 89, 0.45);
  outline-offset: 1px;
}

.yz-acc-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--yz-black);
  color: var(--yz-gold);
  font-size: 16px;
  line-height: 24px;
  text-align: center;
  flex-shrink: 0;
  font-weight: 400;
  transition: transform 0.2s ease;
}

.yz-acc-trigger[aria-expanded="true"] .yz-acc-icon {
  transform: rotate(45deg);
}

.yz-acc-title {
  flex: 1;
  font-weight: 500;
  line-height: 1.45;
}

/* 展开区与外层卡片一体：无灰底、无内层再套框 */
.yz-acc-panel {
  padding: 0;
  font-size: var(--yz-body-size);
  font-weight: 400;
  line-height: var(--yz-body-lh);
  color: var(--yz-text);
  border-top: 1px solid var(--yz-border);
  background: #fff;
}

.yz-acc-panel[hidden] {
  display: none !important;
}

.yz-acc-text {
  margin: 0;
  padding: 12px 14px;
  color: var(--yz-text);
}

.yz-acc-panel .yz-acc-text:last-child {
  padding-bottom: 14px;
}

/* 栏目内字段表：与上方「产品信息」表格同一套 yz-spec-table */
.yz-acc-panel .yz-spec-table.yz-acc-fields-table {
  margin: 0;
  width: 100%;
}

.yz-acc-panel .yz-acc-text + .yz-spec-table.yz-acc-fields-table {
  margin-top: 0;
}

.yz-acc-panel > .yz-spec-table.yz-acc-fields-table:first-child {
  margin-top: 0;
}

.yz-acc-text + .yz-acc-images {
  margin-top: 0;
  border-top: 1px solid var(--yz-border);
}

.yz-acc-panel .yz-spec-table + .yz-acc-images {
  margin-top: 0;
  border-top: 1px solid var(--yz-border);
}

.yz-acc-panel > .yz-acc-images:first-child {
  margin-top: 0;
  padding-top: 12px;
}

/* 保留换行与空格（产品介绍、栏目多行正文） */
.yz-text-pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.yz-intro-card {
  margin-top: 14px;
  border: 1px solid var(--yz-border);
  border-radius: 8px;
  overflow: hidden;
}

.yz-intro-card .yz-card-body {
  font-size: var(--yz-body-size);
  font-weight: 400;
  line-height: var(--yz-body-lh);
  color: var(--yz-text);
}

.yz-acc-images {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 0;
  padding: 12px 14px 14px;
}

.yz-acc-images img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--yz-border);
  border-radius: 4px;
}

/* 出库模块（沿用类名 + 覆盖） */
.wechat-scan-page .outbound-wechat-module {
  border: 1px solid var(--yz-border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
  background: #fff;
}

.wechat-scan-page .outbound-wechat-title {
  background: var(--yz-black);
  color: var(--yz-gold);
  margin: -14px -14px 12px;
  padding: 10px 12px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.wechat-scan-page .outbound-wechat-input,
.wechat-scan-page .outbound-wechat-select,
.wechat-scan-page .outbound-wechat-product-fixed {
  border: 1px solid var(--yz-border);
  border-radius: 4px;
}

.wechat-scan-page .outbound-wechat-submit {
  background: var(--yz-black);
  color: var(--yz-gold);
  border: none;
  border-radius: 24px;
  padding: 10px 24px;
}

/* 出库信息块 */
.yz-outbound-info {
  margin-bottom: 14px;
}

.yz-info-grid .yz-meta-row {
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.yz-info-grid .yz-meta-row:last-child {
  border-bottom: none;
}

/* 扫码详情 */
.yz-scan-detail {
  margin-bottom: 14px;
}

/* 底部 */
.yz-footer-note {
  text-align: center;
  font-size: 12px;
  color: #999;
  margin-top: 20px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* 工具类 */
.d-none {
  display: none !important;
}

.img-hidden {
  display: none !important;
}

.rate-limit-message {
  color: #c62828;
  font-size: 13px;
  margin-top: 8px;
  display: none;
}

.rate-limit-message.visible {
  display: block !important;
}
