.page.glossary-page {
  max-width: 900px;
}

.breadcrumb {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 20px;
}

/* 2026-09-02、ジャンル別一覧ページ(genre.template系)のみ、言語切替+テーマ切替を
   h1の行からパンくずリストの行に移し、パンくずと同じ高さに並べる指定
   (about/glossary/favoritesの.back-link-rowと同じ考え方。term.template系は
   .favorite-starがh1行に挟まる構造の違いがあり、ユーザー判断で対象外) */
.breadcrumb-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 20px;
}
.breadcrumb-row .breadcrumb {
  margin-bottom: 0;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumb a:hover {
  text-decoration: underline;
}
.breadcrumb-sep {
  margin: 0 6px;
  color: var(--text-sub);
}

.page-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0 0 24px;
}
.page-title-row h1 {
  margin: 0;
}
.favorite-star {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  color: var(--text-sub);
  opacity: 0.55;
}
.favorite-star:hover {
  opacity: 1;
  color: var(--accent);
}
.favorite-star.is-active {
  opacity: 1;
  color: #f5c451;
}
.page-title-row .favorite-star {
  font-size: 20px;
  align-self: center;
}
.glossary-entry dt .favorite-star {
  font-size: 13px;
  margin-left: 4px;
  vertical-align: middle;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  color: var(--text-sub);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  cursor: pointer;
  align-self: center;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--text-main);
}

/* 2026-09-02、言語→テーマの並び順に統一(index.html側と揃える)。about.cssと同じ理由
   (h1が長いページで.theme-toggleだけ単独ではみ出す不具合が発覚)で、
   .page-title-actionsラッパーで両方をまとめてmargin-left: autoを持たせている */
.page-title-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.lang-dropdown {
  position: relative;
  align-self: center;
}
.lang-dropdown-toggle {
  display: inline-block;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  padding: 5px 10px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  list-style: none;
  user-select: none;
  white-space: nowrap;
}
.lang-dropdown-toggle::-webkit-details-marker { display: none; }
.lang-dropdown-toggle::after { content: " \25BE"; }
.lang-dropdown-toggle:hover {
  border-color: var(--accent);
}
.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 130px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.lang-switch {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 6px;
}
.lang-switch:hover {
  color: var(--text-main);
  background: rgba(255,255,255,0.06);
}

.glossary-genre-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.glossary-genre-head h2 {
  margin: 40px 0 0;
}
.glossary-genre:first-of-type .glossary-genre-head h2 {
  margin-top: 0;
}

.genre-view-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.genre-view-link:hover {
  text-decoration: underline;
}

.total-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
  margin-left: 8px;
}

.search-box {
  margin: 20px 0;
}
.search-box input[type="search"] {
  width: 100%;
  max-width: 360px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  box-sizing: border-box;
}
.search-box input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
}

.search-no-results {
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 10px;
}

.genre-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 40px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 10px;
}

.genre-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 5px 12px;
}
.genre-nav-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.genre-nav-count {
  font-size: 11px;
  color: var(--text-sub);
}

.glossary-genre {
  margin-top: 48px;
  scroll-margin-top: 20px;
}
.glossary-genre:first-of-type {
  margin-top: 0;
}

.genre-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
  margin-left: 6px;
}

.glossary-list {
  margin: 16px 0 0;
}

/* 2026-09-02、用語一覧の最後の行だけコピーライトとの間隔が広く見える不具合を修正。
   .glossary-entry:last-childはborder-bottomを消しているが、後続の.copyright側が
   margin-top: 40px(about.css)を持つため、通常の行間(border+padding 14px×2で約28px)
   に対して最後だけ54px+と大きく空いて見えていた。ここでのみmargin-topを縮めて
   通常の行間に近づける(genre.template系は.glossary-listが.copyrightの直前の
   兄弟要素、glossary.template系は最後の.glossary-genreが直前の兄弟要素なので両方指定) */
.glossary-list + .copyright,
.glossary-genre + .copyright {
  margin-top: 16px;
}

.glossary-entry {
  padding: 14px 0;
  border-bottom: 1px solid var(--card-border);
  scroll-margin-top: 20px;
}
.glossary-entry:last-child {
  border-bottom: none;
}

.glossary-entry:target {
  background: rgba(108, 194, 255, 0.08);
  border-radius: 8px;
  padding-left: 10px;
  padding-right: 10px;
  margin-left: -10px;
  margin-right: -10px;
}

.glossary-entry dt {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.glossary-entry dt a {
  color: var(--text-main);
  text-decoration: none;
  border-bottom: 1px dotted var(--card-border);
}
.glossary-entry dt a:hover {
  color: var(--accent);
  text-decoration: underline;
  border-bottom-color: var(--accent);
}
.glossary-entry dt a::after {
  content: " ›";
  color: var(--text-sub);
  font-weight: 400;
}

.glossary-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(108, 194, 255, 0.12);
  border-radius: 4px;
  padding: 2px 7px;
  margin-left: 6px;
  vertical-align: middle;
}

.glossary-entry dd {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
  line-height: 1.7;
}

.term-page-tag {
  margin-bottom: 10px;
}

.related-terms {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.related-terms li {
  margin: 0;
}

.related-terms a {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 5px 12px;
}
.related-terms a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
