.xm-share-open {
  overflow: hidden;
}

.xm-share-root[hidden] {
  display: none !important;
}

.xm-share-root {
  position: fixed;
  inset: 0;
  z-index: 2147482100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.xm-share-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.34);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: auto;
}

.xm-share-root.is-open .xm-share-backdrop {
  opacity: 1;
}

.xm-share-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  max-height: min(88dvh, 860px);
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px 20px 0 0;
  background: #ffffff;
  box-shadow: 0 -24px 60px rgba(15, 23, 42, 0.2);
  transform: translateY(100%);
  transition: transform 220ms ease;
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
}

.xm-share-root.is-open .xm-share-sheet {
  transform: translateY(0);
}

.xm-share-handle {
  display: block;
  width: 44px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: #cbd5e1;
}

.xm-share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.xm-share-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0;
}

.xm-share-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
}

.xm-share-preview-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #f8fafc;
}

.xm-share-preview-image {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  object-fit: cover;
  background: #e0f2fe;
}

.xm-share-preview-copy {
  min-width: 0;
}

.xm-share-preview-copy strong {
  display: block;
  overflow: hidden;
  color: #0f172a;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.28;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xm-share-preview-copy span,
.xm-share-preview-copy small {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xm-share-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 14px;
  margin-top: 14px;
}

.xm-share-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.xm-share-action {
  display: flex;
  min-width: 0;
  min-height: 82px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 6px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.xm-share-action:active {
  transform: scale(0.98);
}

.xm-share-action-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 14px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
}

.xm-share-action[data-share-action="line"] .xm-share-action-mark,
.xm-share-action[data-share-action="wechat"] .xm-share-action-mark {
  background: #dcfce7;
  color: #16a34a;
}

.xm-share-action[data-share-action="whatsapp"] .xm-share-action-mark {
  background: #dcfce7;
  color: #15803d;
}

.xm-share-action[data-share-action="facebook"] .xm-share-action-mark,
.xm-share-action[data-share-action="messenger"] .xm-share-action-mark {
  background: #dbeafe;
  color: #1d4ed8;
}

.xm-share-poster-box {
  min-height: 214px;
  padding: 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.xm-share-poster-placeholder {
  display: flex;
  height: 194px;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: #64748b;
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
}

.xm-share-poster-preview {
  display: block;
  width: 100%;
  max-height: 310px;
  border-radius: 14px;
  object-fit: contain;
  background: #f8fafc;
}

.xm-share-notice {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.xm-share-notice[hidden] {
  display: none;
}

.xm-share-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 2147482200;
  max-width: min(320px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.xm-share-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 720px) {
  .xm-share-root {
    align-items: center;
    padding: 24px;
  }

  .xm-share-sheet {
    border-radius: 20px;
  }
}

@media (max-width: 430px) {
  .xm-share-sheet {
    width: 100%;
    max-height: 90dvh;
    padding-right: 12px;
    padding-left: 12px;
    border-radius: 20px 20px 0 0;
  }

  .xm-share-body {
    grid-template-columns: 1fr;
  }

  .xm-share-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .xm-share-action {
    min-height: 76px;
    border-radius: 16px;
    font-size: 11px;
  }

  .xm-share-poster-box {
    min-height: 176px;
  }

  .xm-share-poster-placeholder {
    height: 156px;
  }
}
