/**
 * WeChat browser guide v12.2
 * A compact, site-neutral browser handoff screen.
 */
:root {
  --wxd-bg: #0b1220;
  --wxd-surface: #111c2f;
  --wxd-surface-strong: #f8fafc;
  --wxd-line: rgba(255, 255, 255, 0.12);
  --wxd-text: #f8fafc;
  --wxd-muted: #aebbd0;
  --wxd-faint: #74839b;
  --wxd-accent: #38bdf8;
  --wxd-success: #5eead4;
  --wxd-ink: #10203a;
}

.wechat-detector-overlay,
.wechat-detector-overlay * {
  box-sizing: border-box;
}

.wechat-detector-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  visibility: visible !important;
  color: var(--wxd-text);
  background-color: var(--wxd-bg);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 32px 32px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.wechat-detector-modal {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  max-width: 480px;
  min-height: 100%;
  margin: 0 auto;
  padding:
    calc(18px + env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    calc(16px + env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
}

.wechat-detector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wxd-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.wxd-brand-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--wxd-line);
  border-radius: 8px;
  color: var(--wxd-accent);
  background: rgba(255, 255, 255, 0.06);
}

.wxd-brand-icon svg {
  width: 20px;
  height: 20px;
}

.wxd-brand-title {
  overflow: hidden;
  color: var(--wxd-text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wxd-brand-sub {
  margin-top: 2px;
  color: var(--wxd-faint);
  font-size: 11px;
  line-height: 1.3;
}

.wxd-header-right {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  padding-right: 2px;
}

.wxd-arrow-hint {
  width: 62px;
  height: 36px;
  overflow: visible;
}

.wxd-arrow-hint path {
  fill: none;
  stroke: var(--wxd-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wechat-detector-hero {
  display: flex;
  min-height: 0;
  align-items: center;
  padding: 30px 0 24px;
}

.wechat-detector-hero-copy {
  width: 100%;
}

.wxd-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--wxd-success);
  font-size: 12px;
  font-weight: 700;
}

.wxd-eyebrow::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wxd-success);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.1);
  content: "";
}

.wechat-detector-hero-copy h2 {
  max-width: 360px;
  margin: 14px 0 0;
  color: var(--wxd-text);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.26;
  letter-spacing: 0;
}

.wxd-actions {
  margin-top: 28px;
  border-top: 1px solid var(--wxd-line);
}

.wxd-action {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--wxd-line);
}

.wxd-action-num {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  color: var(--wxd-accent);
  background: rgba(56, 189, 248, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.wxd-action-title {
  color: var(--wxd-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.wxd-action-desc {
  margin-top: 3px;
  color: var(--wxd-muted);
  font-size: 12px;
  line-height: 1.5;
}

.wechat-detector-panel {
  padding-top: 15px;
  border-top: 1px solid var(--wxd-line);
}

.wxd-panel-heading {
  color: var(--wxd-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.wxd-panel-sub {
  display: none;
}

.wechat-detector-url-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  margin-top: 9px;
  padding: 11px 11px 11px 13px;
  border-radius: 8px;
  color: var(--wxd-ink);
  background: var(--wxd-surface-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.wxd-url-icon {
  display: none;
}

.wxd-url-copy {
  min-width: 0;
}

.wxd-url-site {
  overflow: hidden;
  color: var(--wxd-ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wxd-url-full {
  overflow: hidden;
  margin-top: 3px;
  color: #62718a;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wechat-detector-copy-btn {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #06243d;
  background: var(--wxd-accent);
  box-shadow: 0 8px 18px rgba(56, 189, 248, 0.22);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.wechat-detector-copy-btn:active {
  transform: scale(0.96);
}

.wechat-detector-copy-btn svg {
  width: 19px;
  height: 19px;
}

.wechat-detector-copy-btn .wxd-check-icon,
.wechat-detector-copy-btn.is-copied .wxd-copy-icon {
  display: none;
}

.wechat-detector-copy-btn.is-copied .wxd-check-icon {
  display: block;
}

.wechat-detector-copy-btn.is-copied {
  color: #052d29;
  background: var(--wxd-success);
}

.wechat-detector-steps {
  display: none;
}

.wxd-hint {
  margin-top: 9px;
  color: var(--wxd-faint);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.wechat-detector-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 100000;
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border: 1px solid var(--wxd-line);
  border-radius: 8px;
  color: var(--wxd-text);
  background: rgba(17, 28, 47, 0.96);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.wechat-detector-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.wxd-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.wechat-detector-overlay ::selection {
  color: #06243d;
  background: var(--wxd-success);
}

.wechat-detector-navbar,
.wechat-detector-notice-style,
.wechat-detector-notice-icon,
.wechat-detector-notice-title,
.wechat-detector-notice-desc,
.wechat-detector-url-section,
.wechat-detector-url-label,
.wechat-detector-main-content,
.wechat-detector-guide-section,
.wechat-detector-guide-content,
.wechat-detector-guide-icon,
.wechat-detector-guide-text,
.wechat-detector-bottom-tip,
.wechat-detector-close-btn,
.wxd-flow,
.wxd-flow-dot {
  display: none !important;
}

@media (max-height: 700px) {
  .wechat-detector-modal {
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .wechat-detector-hero {
    padding: 18px 0 16px;
  }

  .wechat-detector-hero-copy h2 {
    font-size: 25px;
  }

  .wxd-actions {
    margin-top: 18px;
  }

  .wxd-action {
    padding: 10px 0;
  }
}

@media (max-width: 360px) {
  .wechat-detector-modal {
    padding-right: 14px;
    padding-left: 14px;
  }

  .wxd-brand-sub {
    display: none;
  }

  .wxd-arrow-hint {
    width: 52px;
  }

  .wechat-detector-hero-copy h2 {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wechat-detector-overlay *,
  .wechat-detector-overlay *::before,
  .wechat-detector-overlay *::after {
    animation: none !important;
    transition: none !important;
  }
}
