* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
}
html { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Helvetica, Arial, sans-serif;
  color: #1f2937;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   通用提示卡（首页 / 404）
   ============================================================ */
.centered {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #f8fafc 0%, #eef2ff 100%);
}
.hint-card {
  background: #fff;
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  max-width: 420px;
  width: 100%;
}
.hint-card h1 { margin: 0 0 8px; font-size: 20px; }
.hint-card p { margin: 8px 0; color: #6b7280; font-size: 14px; }
.hint-card code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.btn-ghost {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  color: #1f2937;
  text-decoration: none;
}

/* ============================================================
   落地页（有底图）：图片 fit-to-viewport，居中，模糊回填
   ============================================================ */
body.landing {
  background: #000;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  position: relative;
}

.landing-backdrop {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: blur(28px) brightness(0.55) saturate(1.1);
  transform: scale(1.18);
  z-index: 0;
  pointer-events: none;
}

.landing-stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.landing-frame {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  line-height: 0;
}

.landing-bg {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  -webkit-touch-callout: none;
}

/* ============================================================
   QR 槽位（覆盖在底图上）
   ============================================================ */
.qr-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  aspect-ratio: 1 / 1;
  z-index: 2;
}

.qr-stage {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.qr-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4%;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.qr-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}
.qr-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  -webkit-touch-callout: default;
  touch-callout: default;
  -webkit-user-select: none;
  user-select: none;
  display: block;
}

/* ============================================================
   控件区：保存按钮 + 圆点 + 提示
   有底图时固定在视口底部，半透明浮层
   ============================================================ */
.qr-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.qr-controls--floating {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom, 16px));
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 360px;
  z-index: 10;
}

.qr-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.qr-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #94a3b8;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.qr-dot.is-active {
  background: #2563eb;
  transform: scale(1.3);
}

.qr-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.95);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.05s, background 0.15s;
  white-space: nowrap;
}
.qr-save-btn:active {
  transform: scale(0.97);
  background: #1d4ed8;
}
.qr-save-btn svg { flex-shrink: 0; }

.qr-tip {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(15, 23, 42, 0.6);
  padding: 4px 12px;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.qr-tip strong {
  color: #fde68a;
  font-weight: 600;
}

.qr-empty-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.92);
  color: #6b7280;
  padding: 14px 22px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 5;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================================
   落地页（无底图）：清爽居中卡片
   ============================================================ */
.landing--no-bg {
  background: linear-gradient(160deg, #f8fafc 0%, #eef2ff 100%);
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: max(24px, env(safe-area-inset-top, 24px)) 16px
           max(24px, env(safe-area-inset-bottom, 24px));
}
.no-bg-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}
.no-bg-title {
  margin: 8px 0 0;
  font-size: 22px;
  text-align: center;
  color: #111827;
}
.qr-slot--standalone {
  position: static;
  transform: none;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
}
.qr-slot--standalone .qr-stage {
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.landing--no-bg .qr-tip {
  background: transparent;
  color: #64748b;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.landing--no-bg .qr-tip strong {
  color: #2563eb;
}
.landing--no-bg .qr-dots {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  padding: 0;
}
.muted {
  color: #6b7280;
  text-align: center;
  font-size: 14px;
}
