/* 全站底部悬浮条：主题色协调、深浅色对比安全、扫码按钮文字始终深色 */

html body .document-bottom-promo {
  --dbp-bg1: #152447;
  --dbp-bg2: #1e3a8a;
  --dbp-bg3: #172554;
  --dbp-text: rgba(255, 255, 255, 0.98);
  --dbp-muted: rgba(248, 250, 252, 0.82);
  --dbp-accent-glow: #fde047;
  --dbp-ring: rgba(255, 255, 255, 0.14);
  --dbp-btn-bg: #ffffff;
  --dbp-btn-text: #0f172a;
  --dbp-btn-icon-bg: #f1f5f9;
  --dbp-btn-border: rgba(15, 23, 42, 0.1);
  --dbp-pop-bg: #ffffff;
  --dbp-pop-line: rgba(15, 23, 42, 0.1);
  --dbp-pop-shadow: 0 20px 50px rgba(15, 23, 42, 0.2), 0 8px 24px rgba(15, 23, 42, 0.12);
  --dbp-theme: var(--theme-color, #3eaf7c);

  display: block;
  position: fixed;
  left: 50%;
  bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
  z-index: 9990;
  width: min(92vw, 56rem);
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 1px solid var(--dbp-ring);
  border-radius: clamp(20px, 3.2vw, 28px);
  box-sizing: border-box;
  color: var(--dbp-text);
  background: linear-gradient(145deg, var(--dbp-bg1) 0%, var(--dbp-bg2) 42%, var(--dbp-bg3) 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.2),
    0 4px 8px rgba(0, 0, 0, 0.15),
    0 28px 64px rgba(15, 23, 42, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translate(-50%, calc(100% + 28px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: visible;
  transition:
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.4s ease,
    visibility 0.4s,
    box-shadow 0.45s ease;
  animation: document-bottom-promo-breathe 4.5s ease-in-out infinite;
}

html body .document-bottom-promo.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 内层裁剪圆角，外层 overflow:visible 供二维码浮层露出 */
html body .document-bottom-promo__clip {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

html body .document-bottom-promo__sheen {
  position: absolute;
  inset: -40% -20% auto -20%;
  height: 70%;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 55% at 50% 0%, rgba(255, 255, 255, 0.14) 0%, transparent 65%);
  opacity: 0.9;
}

@keyframes document-bottom-promo-breathe {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.2),
      0 4px 8px rgba(0, 0, 0, 0.14),
      0 26px 58px rgba(15, 23, 42, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      0 0 40px rgba(59, 130, 246, 0.08);
  }

  50% {
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.22),
      0 6px 14px rgba(0, 0, 0, 0.16),
      0 32px 72px rgba(37, 99, 235, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.22),
      0 0 56px rgba(96, 165, 250, 0.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  html body .document-bottom-promo {
    animation: none;
  }
}

/* 整站深色（html.dark）时条略压暗，关闭钮与扫码钮对比规则不变 */
html.dark body .document-bottom-promo,
html body.dark .document-bottom-promo {
  --dbp-bg1: #0c1222;
  --dbp-bg2: #1e2a5a;
  --dbp-bg3: #111827;
  --dbp-btn-icon-bg: #d8dee9;
  --dbp-pop-shadow: 0 22px 56px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(148, 163, 184, 0.1);
}

/* 关闭：右上角略偏外，与条顶角形成「浮起」层次 */
html body .document-bottom-promo__close {
  position: absolute;
  top: -0.42rem;
  right: -0.42rem;
  z-index: 10060;
  width: 2.15rem;
  height: 2.15rem;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.2),
    0 0 0 3px rgba(255, 255, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

html body .document-bottom-promo__close:hover,
html body .document-bottom-promo__close:focus-visible {
  background: #ffffff;
  transform: scale(1.06);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.26),
    0 0 0 3px rgba(255, 255, 255, 0.45);
  outline: none;
}

html body .document-bottom-promo__close-x {
  display: block;
  width: 14px;
  height: 14px;
  position: relative;
}

html body .document-bottom-promo__close-x::before,
html body .document-bottom-promo__close-x::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  border-radius: 1px;
  background: #0f172a;
}

html body .document-bottom-promo__close-x::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

html body .document-bottom-promo__close-x::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

html body .document-bottom-promo__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1.15rem;
  padding: 0.7rem 2.65rem 0.7rem 1rem;
  box-sizing: border-box;
}

html body .document-bottom-promo__lead {
  flex: 1 1 16rem;
  min-width: 0;
}

html body .document-bottom-promo__brand {
  display: flex;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin-bottom: 0.28rem;
}

html body .document-bottom-promo__logo {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
  border-radius: 12px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

html body .document-bottom-promo__title {
  margin: 0;
  font-family: 'YouSheBiaoTiHei', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: clamp(1.2rem, 2.6vw, 1.62rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.2;
  color: var(--dbp-text);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

html body .document-bottom-promo__text {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.65;
  letter-spacing: 0.015em;
  color: var(--dbp-muted);
}

html body .document-bottom-promo__accent {
  color: var(--dbp-accent-glow);
  font-weight: 700;
  text-shadow:
    0 0 14px rgba(253, 224, 71, 0.65),
    0 0 32px rgba(250, 204, 21, 0.35);
}

/* 右侧扫码：横排 + 白底深字；浮层在条外 overflow:visible 下完整露出 */
html body .document-bottom-promo__qrs {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  flex: 0 1 auto;
  flex-shrink: 0;
  align-items: flex-end;
  gap: 0.45rem 0.55rem;
  min-width: min(100%, 17rem);
  max-width: min(100%, 30rem);
}

html body .document-bottom-promo__qr-pop {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 6.75rem;
  max-width: none;
}

html body .document-bottom-promo__qr-pop:hover,
html body .document-bottom-promo__qr-pop:focus-within {
  z-index: 10050;
}

html body .document-bottom-promo__qr-popover {
  position: absolute;
  left: 50%;
  right: auto;
  width: max-content;
  max-width: min(100vw - 1.5rem, 22rem);
  min-width: 10.5rem;
  box-sizing: border-box;
  bottom: calc(100% + 4px);
  transform: translate(-50%, 8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 10055;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  filter: drop-shadow(0 12px 28px rgba(15, 23, 42, 0.2));
}

html body .document-bottom-promo__qr-pop:hover .document-bottom-promo__qr-popover,
html body .document-bottom-promo__qr-pop:focus-within .document-bottom-promo__qr-popover {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

html body .document-bottom-promo__qr-popover-card {
  padding: 0.55rem 0.55rem 0.55rem 0.6rem;
  background: var(--dbp-pop-bg);
  border: 1px solid var(--dbp-pop-line);
  border-radius: 14px;
  box-shadow: var(--dbp-pop-shadow);
  box-sizing: border-box;
}

html body .document-bottom-promo__qr-popover-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  box-sizing: border-box;
}

html body .document-bottom-promo__qr-pop-hint {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-height: 6.75rem;
  padding: 0.3rem 0.36rem;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.14em;
  color: #fff;
  text-align: center;
  writing-mode: vertical-rl;
  -webkit-writing-mode: vertical-rl;
  text-orientation: upright;
  -webkit-text-orientation: upright;
  background-color: var(--dbp-theme);
  border: none;
  border-radius: 10px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 3px 12px rgba(0, 0, 0, 0.14);
}

html body .document-bottom-promo__qr-frame {
  width: 6.75rem;
  height: 6.75rem;
  border-radius: 10px;
  background: var(--dbp-pop-bg);
  border: 1px solid var(--dbp-pop-line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

html body .document-bottom-promo__qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

html body .document-bottom-promo__qr-placeholder {
  display: block;
  padding: 0.4rem 0.5rem;
  font-size: 0.62rem;
  line-height: 1.35;
  text-align: center;
  color: #475569;
}

html body .document-bottom-promo__qr-frame.is-empty {
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 6px,
    rgba(15, 23, 42, 0.05) 6px,
    rgba(15, 23, 42, 0.05) 12px
  );
}

html body .document-bottom-promo__qr-trigger {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem 0.45rem;
  width: 100%;
  min-height: 2.4rem;
  padding: 0.35rem 0.45rem 0.35rem 0.4rem;
  margin: 0;
  font: inherit;
  cursor: pointer;
  color: var(--dbp-btn-text);
  background: var(--dbp-btn-bg);
  border: 1px solid var(--dbp-btn-border);
  border-radius: 14px;
  box-shadow:
    0 2px 6px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

html body .document-bottom-promo__qr-trigger:hover,
html body .document-bottom-promo__qr-pop:focus-within .document-bottom-promo__qr-trigger {
  border-color: var(--dbp-theme);
  box-shadow:
    0 8px 22px rgba(15, 23, 42, 0.12),
    0 0 0 1px var(--dbp-theme);
  transform: translateY(-2px);
}

html body .document-bottom-promo__qr-trigger-icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--dbp-btn-icon-bg);
  color: #1e293b;
}

html body .document-bottom-promo__qr-trigger-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

html body .document-bottom-promo__qr-trigger-label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
  white-space: normal;
  overflow: visible;
  word-break: keep-all;
  color: var(--dbp-btn-text);
}

html body .document-bottom-promo__qr-pop:hover .document-bottom-promo__qr-trigger-icon,
html body .document-bottom-promo__qr-pop:focus-within .document-bottom-promo__qr-trigger-icon {
  background: var(--theme-color-20, rgba(66, 185, 131, 0.2));
  color: var(--dbp-theme);
}

/* 深色整站下避免全局样式把按钮/图标洗成浅灰，白底按钮上图标保持足够对比 */
html.dark body .document-bottom-promo .document-bottom-promo__qr-trigger,
html body.dark .document-bottom-promo .document-bottom-promo__qr-trigger {
  color: #0f172a;
}

html.dark body .document-bottom-promo .document-bottom-promo__qr-trigger-label,
html body.dark .document-bottom-promo .document-bottom-promo__qr-trigger-label {
  color: #0f172a;
}

html.dark body .document-bottom-promo .document-bottom-promo__qr-trigger-icon,
html body.dark .document-bottom-promo .document-bottom-promo__qr-trigger-icon {
  background: var(--dbp-btn-icon-bg);
  color: #0f172a;
}

html.dark body .document-bottom-promo .document-bottom-promo__qr-pop:hover .document-bottom-promo__qr-trigger-icon,
html.dark body .document-bottom-promo .document-bottom-promo__qr-pop:focus-within .document-bottom-promo__qr-trigger-icon,
html body.dark .document-bottom-promo .document-bottom-promo__qr-pop:hover .document-bottom-promo__qr-trigger-icon,
html body.dark .document-bottom-promo .document-bottom-promo__qr-pop:focus-within .document-bottom-promo__qr-trigger-icon {
  color: var(--dbp-theme);
}

/* 系统偏好深色且未用 html.dark 时，条与按钮仍保持同一套对比（条本身已是深色底） */
@media (prefers-color-scheme: dark) {
  html:not(.dark) body .document-bottom-promo {
    --dbp-bg1: #0f172a;
    --dbp-bg2: #1e3a5f;
    --dbp-bg3: #111c3a;
  }
}

@media (max-width: 768px) {
  html body .document-bottom-promo.document-bottom-promo--hide-mobile {
    display: none !important;
  }

  html body .document-bottom-promo__close {
    top: -0.28rem;
    right: -0.28rem;
  }

  html body .document-bottom-promo__inner {
    flex-direction: column;
    align-items: stretch;
    padding: 0.65rem 2.5rem 0.65rem 0.85rem;
  }

  html body .document-bottom-promo__qrs {
    max-width: 100%;
    min-width: 0;
    flex-shrink: 1;
    align-items: stretch;
    flex-wrap: wrap;
  }

  html body .document-bottom-promo__qr-pop {
    flex: 1 1 calc(50% - 0.3rem);
    min-width: 7.5rem;
  }

  html body .document-bottom-promo__title {
    letter-spacing: 0.05em;
  }
}

@media (max-width: 380px) {
  html body .document-bottom-promo__qr-pop {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body .document-bottom-promo__qr-trigger:hover,
  html body .document-bottom-promo__qr-pop:focus-within .document-bottom-promo__qr-trigger {
    transform: none;
  }
}

html.document-bottom-promo-open body {
  padding-bottom: var(--document-bottom-promo-pad, 0);
  transition: padding-bottom 0.35s ease;
}
