.analytics-consent {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 80;
  width: min(420px, calc(100vw - 32px));
  box-sizing: border-box;
  padding: 20px;
  border: 1px solid #e4e4e7;
  border-radius: 20px;
  background: #fff;
  color: #18181b;
  box-shadow: 0 4px 20px #18181b14;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
.analytics-consent[hidden], .analytics-consent [hidden] { display: none; }
.analytics-consent__header { display: flex; align-items: center; gap: 8px; height: 24px; margin-bottom: 8px; }
.analytics-consent h2 { margin: 0; min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 650; }
.analytics-consent__allow-close { flex: none; height: 24px; padding: 0; border: 0; background: transparent; color: #52525b; font: inherit; font-size: 11px; line-height: 24px; white-space: nowrap; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.analytics-consent__allow-close:hover { color: #18181b; }
.analytics-consent__header { cursor: grab; touch-action: none; user-select: none; }
.analytics-consent__header.is-dragging { cursor: grabbing; }
.analytics-consent p { margin: 0 0 12px; }
.analytics-consent a { color: #2563eb; text-decoration: underline; }
.analytics-consent__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.analytics-consent__actions button {
  flex: 1 1 150px;
  min-height: 44px;
  border: 1px solid #a1a1aa;
  border-radius: 999px;
  padding: 8px 14px;
  background: #fff;
  color: #18181b;
  font: inherit;
  cursor: pointer;
}
.analytics-consent__actions button:hover { background: #f4f4f5; }
.analytics-consent button:focus-visible, [data-analytics-settings]:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
.analytics-consent [role="alert"] { margin-top: 12px; color: #b91c1c; }
[data-analytics-settings] { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; }
@media (max-width: 600px) {
  body:has(.analytics-consent:not([hidden])) { padding-bottom: 360px; }
}
/* 优先展示已有邀请选择或模态操作，避免两个浮层争用手机视口。 */
body:has([aria-labelledby="referral-consent-title"]) .analytics-consent,
body:has([aria-modal="true"]) .analytics-consent { display: none; }
.auth-legal-links [data-analytics-settings] { margin-inline-start: 8px; }
