/* 目次全体のコンテナ */
.index {
  max-width: 100%;
  margin: 15px auto;
  border: 1px solid #ffd700; /* 黄色の枠線 */
  border-radius: 8px;
  background-color: #f0f7ff; /* 薄い青色の背景 */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* 目次のヘッダー部分 */
.index-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background-color: #ffffff;
  border-bottom: 1px solid #f0f0f0;
}

/* 目次のタイトル */
.index-title {
  font-size: 15px;
  font-weight: 500;
  color: #333;
  margin: 0;
  display: flex;
  align-items: center;
}

/* 目次タイトルのアイコン */
.index-title::before {
  content: "☰";
  margin-right: 8px;
  color: #666;
}

/* 展開ボタン */
.expand-button {
  color: #1a76ff;
  font-size: 14px;
  font-weight: normal;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

/* 目次リストのコンテナ */
.index-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 目次の各項目 */
.index-list-item {
  border-bottom: 1px solid #f0f0f0;
  background-color: #ffffff;
  margin: 0;
  padding: 0;
}

/* 初期状態で6番目以降の項目を非表示 */
.index-list-item:nth-child(n+6) {
  display: none;
}

/* 展開状態では全項目を表示 */
.index-list.expanded .index-list-item:nth-child(n+6) {
  display: block;
}

/* 目次の最後の項目はボーダーなし */
.index-list-item:last-child {
  border-bottom: none;
}

/* 目次リンク */
.index-link {
  display: block;
  padding: 10px 15px;
  color: #1a76ff;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
}

/* 目次リンクホバー時 */
.index-link:hover {
  background-color: #f8f8f8;
}

/* 目次アプリ画像サムネイル */
.app-thumbnail {
  width: 40px;
  height: 40px;
  margin-right: 10px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #e0e0e0;
  background-color: #f9f9f9;
}

/* 目次リンクのテキスト部分 */
.index-link-text {
  flex: 1;
}

/* 項目数表示 - 展開ボタンの隣に表示する小さなカウンター */
.item-counter {
  font-size: 12px;
  color: #999;
  margin-right: 8px;
}

/* 展開状態の「もっと見る」ボタン表示 */
.more-indicator {
  display: inline-block;
  transition: transform 0.3s;
}

.index-list.expanded + .index-header .more-indicator {
  transform: rotate(180deg);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .index {
    margin: 10px auto;
  }
  
  .index-title {
    font-size: 14px;
  }
  
  .index-link {
    padding: 8px 15px;
    font-size: 13px;
  }
  
  .app-thumbnail {
    width: 30px;
    height: 30px;
    margin-right: 8px;
  }
}