:root {
  --bg: rgba(0, 0, 0, .5);
  --panel: #111;
  --text: #fff;
  --muted: #bbb;
  --accent: #4f9cff;
  --radius: 16px;
}

.share-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 1000;
}

.share-overlay.show {
  display: flex;
}

.share-dialog {
  width: min(540px, 92vw);
  background: var(--panel);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  padding: 20px 20px 16px;
  position: relative;
  display: grid;
  grid-template-rows: 50px 2fr 1fr;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 讓子元素水平置中 */
  justify-content: center;
  margin: auto;
}

.share-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
}

.share-close:hover {
  color: var(--text);
}

#share-title {
  margin: 4px 8px 12px;
  font-size: 18px;
  font-weight: 700;
}

.share-label {
  display: block;
  margin: 8px 8px 6px;
  color: var(--muted);
  font-size: 12px;
}

.share-link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 0 8px;
}

.share-link-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #2a2a2a;
  background: #0c0c0c;
  color: var(--text);
  font-size: 14px;
}

.share-copy-btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.share-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  /* 四等分 */
  gap: 10px;
  padding: 10px 12px;
  /* 比較扁，不會拖到下面 */
  margin: -8px 0 0;
  /* 減少底部空白 */
}

@media (max-width: 520px) {
  .share-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 8px 10px;
  }
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 12px 10px;
  background: #181818;
  color: var(--text);
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.share-btn:hover {
  background: #1f1f1f;
}

.share-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* .share-media {
  display: flex;
  align-items: center;
  flex-direction: column;
  font-weight: 600;
  font-size: 14px;
  font-family: "monospace", "Noto Sans", "Noto Sans TC", sans-serif;
} */
.share-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  height: 86px;
  /* 高度統一 */
  border-radius: 12px;
  background: transparent;

  color: #eaeaea;
  transition: transform .12s ease, background .12s ease;
  cursor: pointer;
}

/* hover/active 手感 */
.share-media:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}

.share-media:active {
  transform: translateY(0);
}


.share-media svg {
  width: 28px;
  height: 28px;
  margin-bottom: 6px;
  fill: currentColor;
  flex: 0 0 auto;
}

.share-media span {
  font: 600 13px/1 "Noto Sans", "Noto Sans TC", system-ui, sans-serif;
  letter-spacing: .2px;
  white-space: nowrap;
}

#share-fb:hover {
  color: #1877f2;
}

#share-threads:hover {
  color: #000;
  background: #fff;
  /* hover 時反轉 */
}

#share-line:hover {
  color: #00c300;
}

#share-messenger:hover {
  color: #00b2ff;
}


.share-toast {
  min-height: 20px;
  margin: 8px 10px 0;
  color: #7ee787;
  font-size: 12px;
}

/* .share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
} */




.link-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #2d2d2d;
  border-radius: 12px;
  overflow: hidden;
  background: #1c1c1c;
  /* 深色背景 */
  color: #f5f5f5;
  text-decoration: none;
  max-width: 480px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.link-card .thumb {
  width: 100%;
  aspect-ratio: 1.91 / 1;
  /* FB/LINE 預設比例 1200x630 */
  background: #2a2a2a;
  overflow: hidden;
}

.link-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-card .meta {
  padding: 12px 14px;
  font-family: "Noto Sans TC", "Noto Sans", "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
}

.link-card .domain {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 6px;
}

.link-card .title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
  color: #fff;
}

.link-card .desc {
  font-size: 13px;
  color: #ccc;
  max-height: 2.8em;
  overflow: hidden;
  text-overflow: ellipsis;
}