/* share.css：浮動分享按鈕 + 分享選單 modal */

/* 保險：確保 share-entry 用 absolute 時有定位基準 */
.card { position: relative; }

/* ===== 浮動分享按鈕（桌機：貼 card 右側） ===== */
#share-entry{
  position: absolute;
  right: -58px;                 /* 貼在 card 外側 */
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  display: none;
}

#share-entry button{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

#share-entry button:hover { transform: translateY(-1px); }

#share-entry .hint{
  margin-top: 6px;
  font-size: 11px;
  color: #666;
  text-align: center;
  max-width: 64px;
  line-height: 1.25;
}

/* ✅ 手機 / LINE：固定在螢幕內右下角，永遠可點 */
@media (max-width: 520px){
  #share-entry{
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(90px, env(safe-area-inset-bottom)); /* 避開底部工具列 */
    top: auto;
    transform: none;
  }

  #share-entry .hint{
    font-size: 10px;
    max-width: 72px;
  }
}

/* ===== 分享選單（Modal / Action Sheet） ===== */
.share-modal { position: fixed; inset: 0; z-index: 10000; }

.share-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
}

.share-sheet{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 32px));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.22);
  padding: 14px;
}

.share-title{
  font-weight: 800;
  color: #333;
  font-size: 15px;
  margin: 6px 6px 12px;
}

.share-action{
  width: 100%;
  text-align: left;
  border: 1px solid #eee;
  background: #fff;
  border-radius: 14px;
  padding: 12px 12px;
  cursor: pointer;
  margin: 10px 0;
  font-weight: 800;
  font-size: 15px;
  color: #222;
}

.share-action:hover{
  background:#fffaf8;
  border-color:#ffe0d0;
}

.share-sub{
  display:block;
  font-weight: 600;
  color:#777;
  font-size: 12px;
  margin-top: 4px;
}

.share-cancel{
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border: none;
  border-radius: 14px;
  background: #f2f2f2;
  cursor: pointer;
  font-weight: 800;
  color:#444;
}

/* 手機：改成底部彈出比較像 App */
@media (max-width: 520px){
  .share-sheet{
    top: auto;
    bottom: max(14px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    border-radius: 18px;
  }
}