/**
 * 防伪查询中心模板（query_center）——仅外链样式，无内联
 */

.qc-root {
  --qc-page-bg: #157574;
  --qc-brand: #157574;
  min-height: 100vh;
  box-sizing: border-box;
  padding: 1.25rem 0.9rem 2rem;
  background-color: var(--qc-page-bg);
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.12) 40%, rgba(0, 0, 0, 0.35) 100%),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 11px,
      rgba(255, 255, 255, 0.07) 11px,
      rgba(255, 255, 255, 0.07) 12px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 9px,
      rgba(255, 255, 255, 0.055) 9px,
      rgba(255, 255, 255, 0.055) 10px
    );
  color: #2b3340;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.qc-root *,
.qc-root *::before,
.qc-root *::after {
  box-sizing: border-box;
}

.qc-skip {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.qc-inner {
  max-width: 420px;
  margin: 0 auto;
}

/* —— 首页 / 扫码页 顶栏 —— */
.qc-hero {
  text-align: center;
  padding: 0.5rem 0 1.25rem;
}

.qc-logo-ring {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.qc-logo-ring img {
  max-width: 78%;
  max-height: 78%;
  object-fit: contain;
  display: block;
}

.qc-hero-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* —— 主卡片 —— */
.qc-card {
  position: relative;
  background: #fff;
  /* 四角统一圆角，避免底角与波浪条叠加时某一角渲染错位；overflow 裁剪保证圆角轮廓完整 */
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.qc-card-body {
  padding: 1.35rem 1.1rem 1.5rem;
}

.qc-card-wave {
  height: 14px;
  margin-top: -1px;
  background: #fff;
  /* 与 repeat-x 周期对齐，避免卡片宽度下左右两端相位不一致造成底角附近「缺一块」 */
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12'%3E%3Cpath fill='%23fff' d='M0 12h120V0C100 8 80 12 60 12S20 8 0 0v12z'/%3E%3C/svg%3E");
  mask-size: 120px 12px;
  mask-repeat: repeat-x;
  mask-position: left bottom;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12'%3E%3Cpath fill='%23fff' d='M0 12h120V0C100 8 80 12 60 12S20 8 0 0v12z'/%3E%3C/svg%3E");
  -webkit-mask-size: 120px 12px;
  -webkit-mask-repeat: repeat-x;
  -webkit-mask-position: left bottom;
}

/* —— Tab —— */
.qc-tabs {
  display: flex;
  border-bottom: 1px solid #e8e8e8;
  margin: 0 -0.25rem 1.1rem;
  padding: 0 0.25rem;
}

.qc-tab {
  flex: 1;
  text-align: center;
  padding: 0.5rem 0.25rem 0.65rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: #888;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.qc-tab:hover {
  color: #555;
}

.qc-tab--active {
  color: var(--qc-brand);
  font-weight: 600;
  border-bottom-color: var(--qc-brand);
}

/* —— 编号验证 —— */
.qc-hint {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: #666;
}

.qc-code-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
  margin-bottom: 1rem;
}

/* 查询页：编号输入格（保持原版竖向渐变 + 灰边框，勿与结果页样式混用） */
.qc-code-box {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.25rem;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 1rem;
  text-align: center;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fbfbfb 0%, #f0f1f3 100%);
}

.qc-code-box:focus {
  outline: none;
  border-color: #c9a227;
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.2);
  background: linear-gradient(180deg, #ffffff 0%, #f4f5f7 100%);
}

/* 结果页：防伪码展示格（斜纹 + 透明描边 + 略方圆角） */
.qc-code-seg {
  box-sizing: border-box;
  padding: 0.38rem 0.22rem;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 1.22rem;
  text-align: center;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: #3a3a3a;
  background-color: #ececee;
  background-image: repeating-linear-gradient(
    135deg,
    #ececee,
    #ececee 5px,
    #dedee3 5px,
    #dedee3 6px
  );
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  line-height: 1.25;
  word-break: break-all;
}

.qc-code-seg:empty::before {
  content: "\a0";
}

.qc-btn-primary {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0;
  background: var(--qc-brand);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
}

.qc-btn-primary:active {
  background: #126663;
}

.qc-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* —— 扫码页 —— */
.qc-scan-panel {
  text-align: center;
  padding: 0.25rem 0 0.5rem;
}

.qc-scan-graphic-btn {
  display: block;
  margin: 0 auto 0.75rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  line-height: 0;
}

.qc-scan-graphic-btn:focus {
  outline: none;
}

.qc-scan-graphic-btn:focus-visible {
  outline: 2px solid var(--qc-brand);
  outline-offset: 4px;
  border-radius: 4px;
}

.qc-scan-graphic {
  width: 80px;
  height: 80px;
  margin: 0 auto 0.75rem;
  display: block;
  color: var(--qc-brand);
}

.qc-scan-graphic-btn .qc-scan-graphic {
  margin: 0;
}

.qc-scan-graphic .qc-scan-frame,
.qc-scan-graphic .qc-scan-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.qc-scan-text {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: #555;
}

/* —— 验证提醒：票券式虚线 + 左右半圆缺口（与外层深色底衔接） —— */
.qc-divider-row {
  position: relative;
  margin: 1.25rem -1.1rem 1rem;
  height: 16px;
  z-index: 0;
  overflow: hidden;
}

.qc-divider-row::before,
.qc-divider-row::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--qc-page-bg);
  z-index: 2;
  pointer-events: none;
}

/* 只保留「咬进」白卡内的半圆，外侧整圆的一半不绘制 */
.qc-divider-row::before {
  left: -7px;
  clip-path: inset(0 0 0 50%);
}

.qc-divider-row::after {
  right: -7px;
  clip-path: inset(0 50% 0 0);
}

.qc-divider-line {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  height: 0;
  border: none;
  border-top: 1px dashed #c5c5c5;
  transform: translateY(-50%);
  z-index: 1;
}

.qc-remind-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #333;
}

.qc-remind-intro {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: #777;
  line-height: 1.55;
}

.qc-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.qc-legend::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(180deg, #e0e0e0, #f5f5f5);
  border-radius: 1px;
}

.qc-legend-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  column-gap: 0.55rem;
  row-gap: 0.12rem;
  margin-bottom: 0.85rem;
  position: relative;
  align-items: start;
}

.qc-legend-item:last-child {
  margin-bottom: 0;
}

.qc-legend-icon-wrap {
  grid-column: 1;
  grid-row: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  align-self: center;
}

.qc-legend-icon-wrap img {
  max-width: 20px;
  max-height: 20px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  image-rendering: auto;
}

.qc-legend-fallback {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
}

.qc-legend-fallback--ok {
  background: #2e9d5c;
}

.qc-legend-fallback--dup {
  background: #e89b20;
}

.qc-legend-fallback--err {
  background: #e04545;
}

.qc-legend-name {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  align-self: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: #333;
  line-height: 1.35;
}

.qc-legend-desc {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 400;
  color: #888;
  line-height: 1.45;
}

/* —— 票券结果卡 —— */
.qc-ticket {
  position: relative;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  max-width: 420px;
  margin: 0 auto;
  overflow: visible;
  display: flow-root;
}

/* 结果票券：上下段之间，两侧半圆 + 中间虚线（flex 垂直居中） */
.qc-ticket-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 18px;
  height: 18px;
  margin: 0;
  padding: 0 10px;
  box-sizing: border-box;
  z-index: 0;
  overflow: hidden;
}

.qc-ticket-divider::before,
.qc-ticket-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--qc-page-bg);
  z-index: 2;
  pointer-events: none;
}

.qc-ticket-divider::before {
  left: -7px;
  clip-path: inset(0 0 0 50%);
}

.qc-ticket-divider::after {
  right: -7px;
  clip-path: inset(0 50% 0 0);
}

.qc-ticket-divider-line {
  flex: 1 1 auto;
  min-width: 0;
  height: 0;
  margin: 0;
  border: none;
  border-top: 1px dashed #c5c5c5;
  align-self: center;
  position: relative;
  z-index: 1;
}

/* 票券最底部：仅保留中间虚线（无两侧半圆） */
.qc-ticket-bottom-edge {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 18px;
  height: 18px;
  margin: 0;
  padding: 0 10px;
  box-sizing: border-box;
  z-index: 0;
}

.qc-ticket-bottom-edge-line {
  flex: 1 1 auto;
  min-width: 0;
  height: 0;
  margin: 0;
  border: none;
  border-top: 1px dashed #c5c5c5;
  align-self: center;
  position: relative;
  z-index: 1;
}

/* 票券顶部：防伪码靠左（在分割线与半圆之上） */
.qc-ticket-code {
  text-align: left;
  margin: 0 0 0.9rem;
  padding: 0;
  width: 100%;
}

.qc-ticket-code .qc-code-label {
  margin: 0 0 0.95rem;
}

/* 结果页：格数随防伪码段数变化，各格均分，整行占满左右 */
.qc-code-value-grid {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.45rem;
  margin: 0;
  width: 100%;
}

.qc-ticket-upper {
  padding: 0.85rem 1.15rem 1.1rem;
  text-align: center;
}

/* 有产品图：顶部适当留白，避免贴紧票券上沿 */
.qc-ticket-upper--with-teaser {
  padding: 0.85rem 1.15rem 1.1rem;
}

.qc-ticket-upper--no-teaser {
  padding: 0.85rem 1.15rem 0.5rem;
}

.qc-ticket-upper--no-teaser .qc-ticket-code {
  margin-bottom: 0.65rem;
}

/* 与票券同宽，抵消 .qc-ticket-upper 左右 padding，图片仅留少量边距 */
.qc-result-teaser {
  width: calc(100% + 2.3rem);
  max-width: none;
  margin: 0 -1.15rem 1rem;
  padding: 0 0.45rem;
  box-sizing: border-box;
}

.qc-result-teaser-img {
  display: block;
  width: 100%;
  max-height: 200px;
  height: auto;
  margin: 0 auto 0.45rem;
  object-fit: contain;
  object-position: center;
}

@keyframes qc-result-icon-pop {
  0% {
    transform: scale(0.55);
    opacity: 0.75;
  }
  48% {
    transform: scale(1.14);
    opacity: 1;
  }
  68% {
    transform: scale(0.92);
  }
  84% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.qc-result-status {
  margin: 0 auto 0.85rem;
  text-align: center;
}

.qc-result-kind {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  color: #2b3340;
}

.qc-result-status--genuine .qc-result-kind {
  color: #41c66d;
}

.qc-result-status--duplicate .qc-result-kind {
  color: #f67d74;
}

.qc-result-status--error .qc-result-kind {
  color: #ff5959;
}

.qc-result-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  animation: qc-result-icon-pop 0.62s cubic-bezier(0.33, 1.15, 0.68, 1) both;
}

.qc-result-icon img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  image-rendering: auto;
}

.qc-result-fallback {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin: 0 auto 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  transform-origin: center center;
  animation: qc-result-icon-pop 0.62s cubic-bezier(0.33, 1.15, 0.68, 1) both;
}

.qc-result-fallback--ok {
  background: #2e9d5c;
}

.qc-result-fallback--dup {
  background: #e89b20;
}

.qc-result-fallback--err {
  background: #ff5c5c;
}

@media (prefers-reduced-motion: reduce) {
  .qc-result-icon,
  .qc-result-fallback {
    animation: none;
  }
}

/* 结果页：查询说明主文案 — 与「您查询的防伪密码为：」同色 #666 */
.qc-ticket-lower .qc-result-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 400;
  color: #666;
  line-height: 1.45;
}

/* 结果页：「查询结果：」— 与防伪码标签同色 */
.qc-result-block-label {
  margin: 0 0 1.45rem;
  padding: 0;
  font-size: 0.94rem;
  font-weight: 400;
  color: #666;
  text-align: left;
  align-self: stretch;
  width: 100%;
  line-height: 1.4;
}

.qc-ticket-lower {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 1rem 1.15rem 2.65rem;
}

.qc-ticket-lower .qc-result-status,
.qc-ticket-lower .qc-result-title {
  text-align: center;
  align-self: center;
  width: 100%;
}

.qc-code-label {
  margin: 0 0 0.35rem;
  font-size: 0.94rem;
  color: #666;
}


/* —— 产品信息（正品） —— */
.qc-extra {
  max-width: 420px;
  margin: 1rem auto 0;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1rem;
  color: #e8e8e8;
}

.qc-extra-title {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #d1b377;
}

.qc-extra-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
}

.qc-extra-row:last-child {
  border-bottom: none;
}

.qc-extra-k {
  flex: 0 0 5rem;
  color: #aaa;
}

.qc-extra-v {
  flex: 1;
  color: #eee;
}

.qc-extra-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-top: 0.5rem;
}

.qc-extra-img + .qc-extra-img {
  margin-top: 0.65rem;
}

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

/* —— 出库模块沿用全局 outbound 样式 —— */
.qc-root .outbound-wechat-module {
  max-width: 420px;
  margin: 0 auto 1rem;
}

.qc-rate-msg {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: #c44;
  display: none;
}

.qc-rate-msg.visible {
  display: block;
}

.qc-footer-copy {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.35);
}

.qc-back-wrap {
  text-align: center;
  max-width: 420px;
  margin: 1rem auto 0;
}

.qc-back {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.qc-back:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.75);
}

.qc-back:active {
  background: rgba(255, 255, 255, 0.08);
}

.qc-back:focus {
  outline: none;
}

.qc-back:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
}
