/* 側邊工具區專用；不改共用導覽、活動廣告或Cookie提示的樣式。 */
#toolboxArea,
#toolboxArea * { box-sizing: border-box; }
#toolboxArea[hidden],
#toolboxArea [hidden] { display: none !important; }
#toolboxArea {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(var(--toolbox-bottom, 24px), env(safe-area-inset-bottom));
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: inherit;
}
#toolboxArea .toolboxLinks { display: flex; flex-direction: column; gap: 10px; }
#toolboxArea .toolboxButton {
  /* Plus 全域 body a 設有 overflow:hidden，需覆寫才不會裁掉按鈕外側的桌面提示文字。 */
  overflow: visible;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 1px solid #e3dbea;
  border-radius: 50%;
  background: #fff;
  color: #51008a;
  box-shadow: 0 2px 10px rgb(35 10 51 / 16%);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
#toolboxArea .toolboxButton:hover { background: #f5effa; }
#toolboxArea .toolboxButton:focus-visible { outline: 3px solid #75c719; outline-offset: 4px; }
#toolboxArea .toolboxButton img,
#toolboxArea .toolboxButton svg { width: 26px; height: 26px; flex-shrink: 0; }
#toolboxArea .material-symbols-outlined { font-size: 26px; line-height: 1; }
/* 現有社群SVG為白色標誌，須搭配品牌底色，避免白底上看不見。 */
#toolboxArea [data-toolbox-item="line"] { background: #06a94d; border-color: #06a94d; }
#toolboxArea [data-toolbox-item="facebook"] { background: #1877f2; border-color: #1877f2; }
#toolboxArea [data-toolbox-item="line"]:hover { background: #07873f; }
#toolboxArea [data-toolbox-item="facebook"]:hover { background: #1261c6; }
#toolboxArea [data-toolbox-item="instagram"] { color: #b62270; }
#toolboxArea .toolboxLabel {
  position: absolute;
  right: calc(100% + 10px);
  padding: 7px 12px;
  border-radius: 8px;
  background: #fff;
  color: #333;
  box-shadow: 0 2px 10px rgb(35 10 51 / 16%);
  font-size: 14px;
  line-height: 1.5;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
#toolboxArea .toolboxButton:hover .toolboxLabel,
#toolboxArea .toolboxButton:focus-visible .toolboxLabel { opacity: 1; }
#toolboxArea [data-toolbox-toggle] { background: #51008a; color: #fff; }
#toolboxArea [data-toolbox-toggle]:hover { background: #6f22bf; }
#toolboxArea .toolboxToggleText { font-size: 11px; line-height: 1.2; }
@media (max-width: 768px) {
  #toolboxArea { right: max(16px, env(safe-area-inset-right)); gap: 10px; }
  #toolboxArea [data-toolbox-toggle] { flex-direction: column; gap: 1px; }
  #toolboxArea [data-toolbox-toggle] .material-symbols-outlined { font-size: 23px; }
  #toolboxArea .toolboxLinks {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    width: min(208px, calc(100vw - 32px));
    max-height: max(48px, calc(100dvh - var(--toolbox-bottom, 16px) - 140px));
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #e3dbea;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 24px rgb(35 10 51 / 18%);
    gap: 4px;
  }
  #toolboxArea .toolboxLinks .toolboxButton {
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    box-shadow: none;
  }
  #toolboxArea .toolboxLinks [data-toolbox-item="line"],
  #toolboxArea .toolboxLinks [data-toolbox-item="facebook"] { background: #fff; }
  #toolboxArea .toolboxLinks [data-toolbox-item="line"]:hover,
  #toolboxArea .toolboxLinks [data-toolbox-item="facebook"]:hover { background: #f5effa; }
  #toolboxArea .toolboxLinks img { border-radius: 50%; padding: 3px; }
  #toolboxArea .toolboxLinks [data-toolbox-item="line"] img { background: #06a94d; }
  #toolboxArea .toolboxLinks [data-toolbox-item="facebook"] img { background: #1877f2; }
  #toolboxArea .toolboxLinks .toolboxLabel {
    position: static;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
  }
  /* 回頂端的無障礙名稱由aria-label提供，手機不靠hover浮出文字。 */
  #toolboxArea [data-toolbox-top] .toolboxLabel { display: none; }
}
/* Plus 全站整合：手機全螢幕選單或首頁使用中卡片預覽開啟時，暫時讓出畫面，不改工具區自身狀態。 */
body:has(nav .introArea.on) #toolboxArea,
body:has(#cardQuickView:not(.off)) #toolboxArea { display: none !important; }
