/* 社媒分享：顶栏按钮 + 底部面板（移动端优先） */

.share-trigger {
  flex-shrink: 0;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #f2f2f2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.share-trigger:active {
  background: rgba(255, 255, 255, 0.08);
}

.play-top--has-ad .share-trigger {
  margin-left: 0;
}

.film-card__share {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.film-card__cover {
  position: relative;
}

.share-sheet {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.share-sheet--open {
  opacity: 1;
  pointer-events: auto;
}

.share-sheet__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.share-sheet__panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  overflow: auto;
  background: #1a1a1a;
  border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.share-sheet--open .share-sheet__panel {
  transform: translateY(0);
}

.share-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.share-sheet__title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.share-sheet__close {
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: #9a9a9a;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.share-sheet__preview {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.4;
  color: #9a9a9a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.share-sheet__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 8px;
}

.share-sheet__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 4px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #f2f2f2;
  font-size: 11px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.share-sheet__item:active {
  background: rgba(255, 255, 255, 0.06);
}

.share-sheet__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--share-color, #333);
  color: #fff;
}

.share-sheet__icon svg {
  width: 26px;
  height: 26px;
}

.share-sheet__label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.share-sheet-open {
  overflow: hidden;
}

.share-toast {
  position: fixed;
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  z-index: 9500;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(40, 40, 40, 0.95);
  color: #fff;
  font-size: 14px;
  text-align: center;
  transform: translate(-50%, 12px);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

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

@media (min-width: 640px) {
  .share-sheet {
    align-items: center;
    padding: 16px;
  }

  .share-sheet__panel {
    border-radius: 16px;
    max-height: 85vh;
  }
}
