
/* ==========================================================================
  分享彈出視窗樣式
   ========================================================================== */
/* 全局遮罩外框 */
.share-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999 !important; /* 確保疊在網頁最上層，包括導覽列 */
  display: flex;
  justify-content: center;
  align-items: flex-end; /* 手機版預設靠底 */
  visibility: hidden; /* 預設完全隱藏（不影響點擊） */
  transition: visibility 0.3s ease;
}

/* 黑色半透明背景襯底 */
.share-sheet-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0); /* 預設透明 */
  transition: background-color 0.3s ease;
}

/* 彈出面板本體 (電腦版預設樣式：優雅的置中彈窗) */
.share-sheet-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  background-color: #ffffff;
  border-radius: 16px 16px 16px 16px;
  padding: 30px;
  box-sizing: border-box;
  margin-bottom: auto; /* 電報版垂直置中 */
  margin-top: auto;   /* 電報版垂直置中 */
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  /* 動態核心：電腦版預設用「縮放與淡入」登場 */
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
}

/* 當激活狀態時 (.active) 的轉場效果 */
.share-sheet-overlay.active {
  visibility: visible;
}
.share-sheet-overlay.active .share-sheet-bg {
  background-color: rgba(0, 0, 0, 0.5); /* 背景變半透明黑 */
}
.share-sheet-overlay.active .share-sheet-content {
  transform: scale(1);
  opacity: 1;
}

/* 裝飾線條與標題 */
.share-sheet-drag-handle {
  display: none; /* 電腦版不顯示 */
}

.share-sheet-title {
  font-size: 20px;
  color: #2F2F2F;
  font-weight: 500;
  text-align: center;
  margin: 0 0 25px 0;
}

/* 四個選項的 Grid 網格排版 */
.share-options-grid {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

.share-option-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  flex: 1;
  outline: none;
}

/* 圖示外圈圓圈 */
.share-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  transition: transform 0.2s ease;
}
.share-option-item:hover .share-icon-wrap {
  transform: scale(1.08); /* 滑鼠懸庭微微放大 */
}

.share-icon-wrap img {
  width: 100%;
  height: auto;
}

.share-text {
  font-size: 14px;
  color: #5f6368;
  font-weight: 500;
}

/* 取消按鈕 */
.share-sheet-close {
  width: 100%;
  padding: 12px 0;
  background-color: #f1f3f4;
  color: #5f6368;
  font-size: 16px;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}
.share-sheet-close:hover {
  background-color: #e8eaed;
}

/* ==========================================================================
    RWD 手機版斷點變形 (768px 以下)：100% 轉為從頁面底部滑出的面板
   ========================================================================== */
@media (max-width: 768px) {
  .share-sheet-overlay {
    align-items: flex-end; /* 強制靠螢幕最底端 */
  }
  .share-sheet-content {
    max-width: 100%;
    border-radius: 20px 20px 0 0; /* 只留上方圓角 */
    padding: 20px 20px 30px 20px;
    margin-bottom: 0; /* 緊貼底部 */
    margin-top: 0;
    /* 核心變形：手機版改為從螢幕下方 100% 的位置往上滑入 */
    transform: translateY(100%);
    opacity: 1; /* 手機版不需要淡入，靠滑動即可 */
    transition: transform 0.35s cubic-bezier(0.15, 1, 0.3, 1);
  }
  /* 激活狀態覆寫 */
  .share-sheet-overlay.active .share-sheet-content {
    transform: translateY(0); /* 回歸原位，即滑出畫面 */
  }
  /* 手機版上方的拉條裝飾 */
  .share-sheet-drag-handle {
    display: block;
    width: 40px;
    height: 4px;
    background-color: #e8eaed;
    border-radius: 2px;
    margin: 0 auto 15px auto;
  }
  .share-sheet-title {
    font-size: 18px;
    margin-bottom: 20px;
  }
  .share-icon-wrap {
    width: 54px;
    height: 54px;
  }
}