/* ===== Share Card Modal ===== */
.share-card-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(6px);
  animation: shareOverlayIn 0.28s ease;
}

@keyframes shareOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.share-card-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  max-height: calc(100dvh - max(12px, env(safe-area-inset-top, 0px)));
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #FCFEFF, #F5F9FF);
  border-radius: 32px 32px 0 0;
  border: 1px solid rgba(125, 152, 211, 0.16);
  box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.18);
  animation: shareSheetUp 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
  overflow: hidden;
}

@keyframes shareSheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.share-card-sheet__handle {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
  flex-shrink: 0;
}

.share-card-sheet__handle span {
  width: 48px;
  height: 5px;
  border-radius: 999px;
  background: #E5E7EB;
}

.share-card-sheet__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 20px 14px;
  flex-shrink: 0;
}

.share-card-sheet__icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, #E0F2FE, #EEF2FF);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.share-card-sheet__icon svg {
  width: 22px;
  height: 22px;
  color: #3B82F6;
}

.share-card-sheet__title {
  flex: 1;
  font-size: 20px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.25;
}

.share-card-sheet__close {
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  color: #64748B;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.share-card-sheet__close:hover {
  background: rgba(15, 23, 42, 0.06);
}

/* Preview area */
.share-card-sheet__preview {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 20px 12px;
  display: flex;
  justify-content: center;
  -webkit-overflow-scrolling: touch;
}

.share-card-sheet__preview-inner {
  width: 100%;
  max-width: 360px;
}

/* Actions */
.share-card-sheet__actions {
  display: flex;
  gap: 12px;
  padding: 12px 20px 20px;
  border-top: 1px solid rgba(125, 152, 211, 0.1);
  flex-shrink: 0;
}

.share-card-sheet__btn {
  flex: 1;
  height: 52px;
  border-radius: 18px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.18s;
  font-family: inherit;
}

.share-card-sheet__btn--save {
  background: #fff;
  color: #0F172A;
  border: 1.5px solid #D8E3F8;
}

.share-card-sheet__btn--save:hover {
  background: #F5F9FF;
  border-color: #3B82F6;
}

.share-card-sheet__btn--save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.share-card-sheet__btn svg {
  width: 18px;
  height: 18px;
}

/* ===== Share Card (dark card matching APP style) ===== */
.share-card {
  position: relative;
  min-height: 760px;
  border-radius: 32px;
  overflow: hidden;
  background: linear-gradient(135deg, #0F172A 0%, #14213D 52%, #1D4ED8 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
  color: #fff;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* Ambient glows */
.share-card__glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.share-card__glow--amber {
  top: -60px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25), transparent 70%);
}

.share-card__glow--blue {
  bottom: 40px;
  left: -60px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2), transparent 70%);
}

.share-card__glow--center {
  top: 180px;
  left: 24px;
  right: 24px;
  height: 220px;
  border-radius: 999px;
  background: linear-gradient(180deg,
    rgba(56, 189, 248, 0.16) 0%,
    rgba(245, 158, 11, 0.08) 50%,
    transparent 100%);
}

/* Card content */
.share-card__body {
  position: relative;
  z-index: 1;
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Header */
.share-card__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.share-card__brand {
  flex: 1;
  min-width: 0;
}

.share-card__brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-card__logo {
  width: 32px;
  height: 32px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  flex-shrink: 0;
}

.share-card__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.share-card__logo-fallback {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(135deg, #60A5FA, #3B82F6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
}

.share-card__name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-card__slogan {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.76);
}

/* Profile badge */
.share-card__profile {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 7px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 124px;
  flex-shrink: 0;
}

.share-card__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60A5FA, #38BDF8);
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.24);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: #DBEAFE;
  overflow: hidden;
}

.share-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.share-card__profile-name {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Map hero */
.share-card__map-wrap {
  margin-top: 22px;
  height: 290px;
  padding: 12px 12px 10px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(11, 17, 32, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}

.share-card__map-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.share-card__map-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.share-card__map-badge svg {
  width: 14px;
  height: 14px;
  color: #7DD3FC;
}

.share-card__map-stat {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.share-card__map-area {
  flex: 1;
  margin-top: 12px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, #EEF4FF, #DCEBFF);
  box-shadow: 0 0 30px 2px rgba(245, 158, 11, 0.12);
}

.share-card__map-area svg {
  width: 100%;
  height: 100%;
}

/* Beat users banner */
.share-card__beat {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(245, 158, 11, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
}

.share-card__beat-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.share-card__beat-icon svg {
  width: 18px;
  height: 18px;
  color: #FDE68A;
}

.share-card__beat-text {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.4;
}

.share-card__beat-text strong {
  color: #F59E0B;
  font-size: 16px;
  font-weight: 900;
}

/* Glass metric cards */
.share-card__metrics {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.share-card__metric {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(147, 197, 253, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.share-card__metric--gold {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(252, 211, 77, 0.08));
}

.share-card__metric-value {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  font-family: "Roboto", "Noto Sans SC", sans-serif;
}

.share-card__metric-value--blue {
  color: #93C5FD;
}

.share-card__metric-value--gold {
  color: #FCD34D;
}

.share-card__metric-label {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.share-card__metric-sub {
  margin-top: 4px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
}

/* Mini info cards */
.share-card__info-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.share-card__info {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.share-card__info-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
}

.share-card__info-value {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
}

/* Summary card */
.share-card__summary {
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
}

.share-card__summary-icon {
  width: 30px;
  height: 30px;
  border-radius: 11px;
  background: linear-gradient(135deg, #60A5FA, #3B82F6);
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.share-card__summary-icon svg {
  width: 17px;
  height: 17px;
  color: #fff;
}

.share-card__summary-text {
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
}

/* Footer */
.share-card__footer {
  margin-top: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.share-card__footer-text {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.share-card__footer-domain {
  margin-top: 6px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.54);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #DBEAFE;
  display: inline-block;
}

.share-card__qr {
  width: 74px;
  height: 74px;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.share-card__qr canvas,
.share-card__qr img,
.share-card__qr svg {
  display: block;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
}

/* Toast */
.share-card-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  padding: 12px 24px;
  border-radius: 14px;
  background: #0F172A;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.32);
  animation: shareToastIn 0.3s ease, shareToastOut 0.3s ease 1.7s forwards;
}

@media (max-width: 420px) {
  .share-card-sheet {
    border-radius: 28px 28px 0 0;
  }

  .share-card-sheet__header {
    gap: 10px;
    padding: 6px 16px 12px;
  }

  .share-card-sheet__icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .share-card-sheet__title {
    font-size: 18px;
  }

  .share-card-sheet__close {
    width: 44px;
    height: 44px;
  }

  .share-card-sheet__preview {
    padding: 0 16px 10px;
  }

  .share-card-sheet__actions {
    padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

@keyframes shareToastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes shareToastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(16px); }
}
