#searchResults .result-item {
  padding: 0.5rem;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
}

#searchResults .result-item:hover {
  background-color: #f0f8ff;
}

.highlighted {
  background: yellow !important;
  background-color: yellow !important;
  color: #111 !important;
  -webkit-text-fill-color: #111 !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  border-radius: 2px !important;
}

/* markタグ（HTMLデフォルト色を上書き） */
mark.highlighted {
  background: yellow !important;
  background-color: yellow !important;
  color: #111 !important;
  -webkit-text-fill-color: #111 !important;
}

/* スクロール連動型ハイブリッドボタンのスタイル */
#topBtn {
  /* 位置の制御 */
  position: fixed !important;
  right: 25px !important;
  bottom: 25px !important;
  z-index: 1030 !important;

  /* 文字崩れの修正（縦書きの強制解除） */
  writing-mode: horizontal-tb !important;
  white-space: nowrap !important;
  text-indent: 0 !important;
  text-align: center !important;

  /* 形状と余白 */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  min-width: 100px !important;
  min-height: 48px !important;
  padding: 10px 20px !important;
  border-radius: 25px !important;

  /* フォントと装飾 */
  font-family: inherit !important;
  font-size: 1rem !important;
  font-weight: bold !important;
  color: #fff !important;
  text-decoration: none !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
  border: none !important;
  
  /* アニメーションと状態変化 */
  transition: background-color 0.3s ease, opacity 0.3s ease, transform 0.3s ease !important;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

/* ボタンが表示状態のとき */
#topBtn.visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

/* 検索ボタンモード（青色） */
#topBtn.search-mode {
  background-color: #007bff !important;
}
#topBtn.search-mode:hover {
  background-color: #0056b3 !important;
  transform: scale(1.05) !important;
}

/* トップへ戻るボタンモード（オレンジ色） */
#topBtn.top-mode {
  background-color: #fd7e14 !important;
}
#topBtn.top-mode:hover {
  background-color: #ca6510 !important;
  transform: scale(1.05) !important;
}

/* フッター到達時などの一時的な非表示用 */
#topBtn.footer-hide {
  opacity: 0 !important;
  transform: translateY(20px) !important;
  pointer-events: none !important;
}

/* スマートフォン向けの調整（画面幅768px以下） */
@media (max-width: 768px) {
  #topBtn {
    right: 15px !important;
    bottom: 15px !important;
    min-width: 80px !important;
    min-height: 40px !important;
    padding: 8px 14px !important;
    font-size: 0.85rem !important;
    border-radius: 20px !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2) !important;
  }
}

/* 固定ヘッダー（navbar）に被らないようにスクロール位置を調整 */
section[id],
div[id] {
  scroll-margin-top: 90px !important;
}

/* グラデーションテキスト内のハイライトが正しく表示されるように調整 */
.gradient-text mark,
.blue-gradient-text mark,
.gradient-text .highlighted,
.blue-gradient-text .highlighted,
h1 mark, h2 mark, h3 mark, h4 mark, h5 mark, h6 mark,
h1 .highlighted, h2 .highlighted, h3 .highlighted, h4 .highlighted, h5 .highlighted, h6 .highlighted {
  -webkit-text-fill-color: #111 !important;
  color: #111 !important;
  background: yellow !important;
  background-color: yellow !important;
  -webkit-background-clip: unset !important;
  box-shadow: none !important;
  border-radius: 2px !important;
}
