:root {
  --af-font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --af-page-bg: #eceff1;
  --af-topbar-bg: #ffe082;
  --af-topbar-text: #424242;
  --af-card-bg: #ffffff;
  --af-modal-header: #ff9f1a;
  --af-modal-header-dark: #f57c00;
  --af-text: #212121;
  --af-text-secondary: #616161;
  --af-overlay: rgba(0, 0, 0, 0.5);
  --af-fs-sm: 0.8125rem;
  --af-fs-base: 0.875rem;
  --af-fs-lg: 1rem;
  --af-fs-count: 1.5rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

.anti-fake-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--af-font);
  font-size: var(--af-fs-base);
  color: var(--af-text);
  background: var(--af-page-bg);
  line-height: 1.55;
}

.anti-fake-body--scroll-lock {
  overflow: hidden;
}

.anti-fake-back {
  display: inline-flex;
  align-items: center;
  margin: calc(0.5rem + env(safe-area-inset-top, 0px)) 0 0 1rem;
  padding: 0.35rem 0.5rem;
  font-size: var(--af-fs-sm);
  color: var(--af-text-secondary);
  text-decoration: none;
  border-radius: 6px;
}

.anti-fake-back:focus-visible {
  outline: 2px solid var(--af-modal-header);
  outline-offset: 2px;
}

.anti-fake-wrap {
  max-width: 28rem;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.anti-fake-topbar {
  margin: 0 -1rem;
  padding: 0.65rem 1rem;
  background: var(--af-topbar-bg);
  text-align: center;
}

.anti-fake-topbar__text {
  margin: 0;
  font-size: var(--af-fs-sm);
  font-weight: 500;
  color: var(--af-topbar-text);
}

.anti-fake-label-card {
  margin-top: 1rem;
  padding: 1.25rem 1rem;
  background: var(--af-card-bg);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.anti-fake-label-card__brand {
  margin-bottom: 0.75rem;
}

.anti-fake-label-card__logo {
  display: block;
  width: min(11rem, 65vw);
  height: auto;
  margin: 0 auto;
}

.anti-fake-label-card__tagline {
  margin: 0.5rem 0 0;
  font-size: var(--af-fs-sm);
  font-weight: 300;
  color: var(--af-text-secondary);
  line-height: 1.5;
}

.anti-fake-label-card__subtitle {
  margin: 0.2rem 0 0;
  font-size: var(--af-fs-sm);
  font-weight: 400;
  color: var(--af-text-secondary);
  line-height: 1.5;
}

.anti-fake-label-card__figure {
  margin: 0.75rem 0 0;
  padding: 0;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  background: #fafafa;
}

.anti-fake-label-card__product-img {
  display: block;
  width: 100%;
  max-height: 12rem;
  object-fit: contain;
}

.anti-fake-label-card__product-name {
  margin: 0.75rem 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.anti-fake-label-card__product-name-label {
  font-size: var(--af-fs-sm);
  font-weight: 500;
  color: var(--af-text-secondary);
}

.anti-fake-label-card__product-name-value {
  font-size: var(--af-fs-base);
  font-weight: 600;
  color: var(--af-text);
  line-height: 1.45;
}

.anti-fake-welcome-desc {
  margin: 0.85rem 0 0;
  font-size: var(--af-fs-sm);
  font-weight: 400;
  color: var(--af-text-secondary);
  line-height: 1.6;
  text-align: center;
}

.anti-fake-product {
  margin-top: 1.25rem;
  padding: 1rem 1rem 1.25rem;
  background: var(--af-card-bg);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.anti-fake-product--spec {
  padding: 0;
  overflow: hidden;
}

.anti-fake-product__title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1rem;
  font-size: var(--af-fs-lg);
  font-weight: 600;
  color: var(--af-text);
}

.anti-fake-product--spec .anti-fake-product__title {
  margin: 0;
  padding: 0.95rem 1rem 0.75rem;
  border-bottom: 1px solid #eeeeee;
}

.anti-fake-product__icon {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 4px;
  background: linear-gradient(135deg, #66bb6a, #43a047);
  flex-shrink: 0;
}

.anti-fake-product__list {
  margin: 0;
}

.anti-fake-spec {
  padding: 0;
}

.anti-fake-spec__row {
  display: grid;
  grid-template-columns: minmax(5.5rem, 38%) 1fr;
  gap: 0.5rem 0.75rem;
  align-items: center;
  padding: 0.7rem 1rem;
  margin: 0;
  border-bottom: 1px solid #f0f0f0;
}

.anti-fake-spec__row:last-child {
  border-bottom: none;
}

.anti-fake-spec__row dt {
  margin: 0;
  font-size: var(--af-fs-sm);
  font-weight: 500;
  color: var(--af-text-secondary);
  line-height: 1.45;
}

.anti-fake-spec__row dd {
  margin: 0;
  font-size: var(--af-fs-base);
  color: var(--af-text);
  font-weight: 500;
  line-height: 1.5;
  text-align: right;
  word-break: break-word;
}

.anti-fake-spec__dd {
  font-weight: 500;
}

.anti-fake-spec__dd--first {
  color: #2e7d32;
  font-weight: 600;
}

.anti-fake-spec__badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: var(--af-fs-sm);
  font-weight: 600;
  line-height: 1.35;
}

.anti-fake-spec__badge--ok {
  background: #e8f5e9;
  color: #2e7d32;
}

.anti-fake-spec__badge--bad {
  background: #ffebee;
  color: #c62828;
}

.anti-fake-spec__badge--frozen {
  background: #fff3e0;
  color: #e65100;
}

.anti-fake-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--af-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.anti-fake-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.anti-fake-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  padding-top: calc(1.25rem + env(safe-area-inset-top, 0px));
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

.anti-fake-modal-shell.is-open .anti-fake-modal {
  pointer-events: auto;
}

.anti-fake-modal-shell:not(.is-open) .anti-fake-modal {
  visibility: hidden;
}

.anti-fake-modal {
  position: relative;
  width: 100%;
  max-width: 20.5rem;
  max-height: min(88vh, 36rem);
  overflow-y: auto;
  background: var(--af-card-bg);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  transform: scale(0.96);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.anti-fake-modal-shell.is-open .anti-fake-modal {
  transform: scale(1);
  opacity: 1;
}

.anti-fake-modal__close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  font-size: var(--af-fs-lg);
  line-height: 1;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

.anti-fake-modal__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.anti-fake-modal__header {
  padding: 1.75rem 1.5rem 1.5rem;
  text-align: center;
  background: linear-gradient(160deg, var(--af-modal-header) 0%, var(--af-modal-header-dark) 100%);
  color: #fff;
}

/* 首次查询成功：头部为绿色渐变；第 2 次及以后或非首次场景保持上方橙色渐变 */
.anti-fake-modal__header--first {
  background: linear-gradient(160deg, #66bb6a 0%, #2e7d32 100%);
}

.anti-fake-modal__count-wrap {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 50%;
}

.anti-fake-modal__count {
  margin: 0;
  font-size: var(--af-fs-count);
  font-weight: 600;
  line-height: 1;
}

.anti-fake-modal__count--symbol {
  font-size: 1.65rem;
  line-height: 1;
}

.anti-fake-modal__hint {
  margin: 0;
  font-size: var(--af-fs-base);
  font-weight: 500;
  line-height: 1.5;
  opacity: 0.98;
}

.anti-fake-modal__body {
  padding: 1.15rem 1.15rem 1.35rem;
}

.anti-fake-modal__status {
  margin: 0;
  font-size: var(--af-fs-sm);
  color: var(--af-text-secondary);
  text-align: left;
  line-height: 1.6;
}

/* 扫码页表单与补充模块（结构参考 anti-fake.html，功能扩展） */
.anti-fake-query-card {
  margin-top: 1rem;
  padding: 1.25rem 1rem;
  background: var(--af-card-bg);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.anti-fake-scan-form .code-input-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.anti-fake-form-label {
  display: block;
  font-size: var(--af-fs-sm);
  font-weight: 500;
  color: var(--af-text-secondary);
  margin-bottom: 0.35rem;
  text-align: left;
}

.anti-fake-scan-form .code-input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: var(--af-fs-base);
  font-family: inherit;
}

.anti-fake-scan-form .code-input:focus {
  outline: none;
  border-color: var(--af-modal-header);
  box-shadow: 0 0 0 2px rgba(255, 159, 26, 0.22);
}

.anti-fake-scan-form .submit-btn {
  width: 100%;
  padding: 0.62rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: var(--af-fs-base);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: linear-gradient(160deg, var(--af-modal-header) 0%, var(--af-modal-header-dark) 100%);
  color: #fff;
}

.anti-fake-scan-form .scan-btn {
  width: 100%;
  padding: 0.65rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: var(--af-fs-sm);
  font-family: inherit;
  background: #fff;
  color: var(--af-text);
  cursor: pointer;
}

.anti-fake-rate-msg {
  margin-top: 0.5rem;
  font-size: var(--af-fs-sm);
  color: #c62828;
  text-align: left;
}

.anti-fake-footer-note {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--af-text-secondary);
}

.anti-fake-scan-module {
  margin-top: 1rem;
  padding: 1rem 1rem 1.15rem;
  background: var(--af-card-bg);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  text-align: left;
}

.anti-fake-scan-module__title {
  margin: 0 0 0.75rem;
  font-size: var(--af-fs-lg);
  font-weight: 600;
  color: var(--af-text);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}

.anti-fake-scan-module__title span {
  font-size: var(--af-fs-sm);
  font-weight: 400;
  color: var(--af-text-secondary);
  margin-left: 0.35rem;
}

.anti-fake-info-row {
  display: grid;
  grid-template-columns: minmax(5rem, 36%) 1fr;
  gap: 0.4rem 0.65rem;
  align-items: start;
  margin-bottom: 0.7rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid #f0f0f0;
}

.anti-fake-info-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.anti-fake-info-row .info-label {
  margin: 0;
  font-size: var(--af-fs-sm);
  font-weight: 500;
  color: var(--af-text-secondary);
  line-height: 1.45;
}

.anti-fake-info-row .info-content {
  margin: 0;
  font-size: var(--af-fs-base);
  color: var(--af-text);
  line-height: 1.5;
  text-align: right;
  word-break: break-word;
}

.product-description {
  font-size: var(--af-fs-sm);
  line-height: 1.65;
  color: var(--af-text);
}

.certifications-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.certification-item img {
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid #eee;
}

.module-center {
  text-align: center;
  font-size: var(--af-fs-sm);
  color: var(--af-text-secondary);
}

.d-none {
  display: none !important;
}
