/* Desktop-first entry gate. The canvas never becomes interactive behind it. */
#mobile-desktop-gate[hidden] {
  display: none !important;
}

#mobile-desktop-gate {
  --mobile-gate-text: #102033;
  --mobile-gate-muted: rgba(16, 32, 51, 0.68);
  --mobile-gate-line: rgba(29, 145, 181, 0.2);
  --mobile-gate-accent: #0ea5c6;
  position: fixed !important;
  inset: 0 !important;
  z-index: 50000 !important;
  display: grid !important;
  place-items: center !important;
  box-sizing: border-box !important;
  padding: 24px !important;
  overflow: auto !important;
  background:
    radial-gradient(circle at 12% 14%, rgba(25, 189, 218, 0.2), transparent 38%),
    radial-gradient(circle at 88% 84%, rgba(86, 104, 232, 0.18), transparent 42%),
    linear-gradient(135deg, #eefbff 0%, #f7fbff 48%, #eef2ff 100%) !important;
  color: var(--mobile-gate-text) !important;
  font-family: var(--sw-font-ui, "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif) !important;
}

#mobile-desktop-gate::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(19, 127, 164, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 127, 164, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at 50% 42%, #000 0%, rgba(0, 0, 0, 0.7) 58%, transparent 100%);
}

.mobile-desktop-gate-card {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  box-sizing: border-box;
  padding: 34px 34px 30px;
  border: 1px solid rgba(69, 165, 195, 0.28);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow:
    0 28px 70px rgba(24, 92, 126, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(20px) saturate(1.08);
  -webkit-backdrop-filter: blur(20px) saturate(1.08);
  text-align: center;
}

.mobile-desktop-gate-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border-radius: 15px;
  background: linear-gradient(135deg, #0ea5c6, #536fe7);
  color: #fff;
  box-shadow: 0 12px 28px rgba(38, 143, 190, 0.24);
}

.mobile-desktop-gate-mark svg {
  width: 26px;
  height: 26px;
}

.mobile-desktop-gate-eyebrow {
  margin: 0 0 8px;
  color: var(--mobile-gate-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.mobile-desktop-gate-title {
  margin: 0;
  color: var(--mobile-gate-text);
  font-size: 24px;
  line-height: 1.3;
  font-weight: 750;
  letter-spacing: 0;
}

.mobile-desktop-gate-copy {
  max-width: 340px;
  margin: 12px auto 0;
  color: var(--mobile-gate-muted);
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0;
}

.mobile-desktop-gate-actions {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.mobile-desktop-gate-copy-button {
  appearance: none;
  min-width: 172px;
  height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, #0ea5c6, #356fd9);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(36, 123, 190, 0.2);
}

.mobile-desktop-gate-copy-button:hover,
.mobile-desktop-gate-copy-button:focus-visible {
  filter: brightness(1.04);
  outline: 3px solid rgba(14, 165, 198, 0.18);
  outline-offset: 2px;
}

.mobile-desktop-gate-status {
  min-height: 20px;
  margin-top: 12px;
  color: var(--mobile-gate-muted);
  font-size: 12px;
  line-height: 20px;
}

.mobile-desktop-gate-status[data-state="success"] {
  color: #0a8f78;
}

.mobile-desktop-gate-status[data-state="error"] {
  color: #b44a4a;
}

html.mobile-desktop-gated,
body.mobile-desktop-gated {
  overflow: hidden !important;
}

body.mobile-desktop-gated > *:not(#mobile-desktop-gate) {
  visibility: hidden !important;
  pointer-events: none !important;
}

html.theme-dark #mobile-desktop-gate,
body.theme-dark #mobile-desktop-gate {
  --mobile-gate-text: rgba(235, 248, 255, 0.94);
  --mobile-gate-muted: rgba(206, 231, 244, 0.72);
  --mobile-gate-line: rgba(125, 211, 252, 0.18);
  background:
    radial-gradient(circle at 12% 14%, rgba(45, 212, 239, 0.14), transparent 38%),
    radial-gradient(circle at 88% 84%, rgba(99, 102, 241, 0.14), transparent 42%),
    linear-gradient(135deg, #06192d 0%, #081d34 48%, #0a1530 100%) !important;
}

html.theme-dark .mobile-desktop-gate-card,
body.theme-dark .mobile-desktop-gate-card {
  border-color: rgba(125, 211, 252, 0.18);
  background: rgba(8, 29, 51, 0.78);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(175, 232, 255, 0.08);
}

@media (max-width: 520px) {
  #mobile-desktop-gate {
    padding: 18px;
  }

  .mobile-desktop-gate-card {
    padding: 28px 22px 24px;
    border-radius: 15px;
  }

  .mobile-desktop-gate-title {
    font-size: 22px;
  }
}
