/* ================================================================================
   AI用語集 スタイルシート
   デザイン: 学術的・アーカイブ風
   参考: 国立国会図書館デジタルコレクション
   更新日: 2025-12-19
   ================================================================================ */

/* カラーパレット */
:root {
  --primary-color: #1a3a5c;      /* 濃紺 */
  --secondary-color: #2c5282;    /* 紺 */
  --accent-color: #8b4513;       /* セピア */
  --text-color: #333;
  --text-light: #666;
  --border-color: #d4d4d4;
  --bg-light: #fafafa;
  --bg-cream: #f9f7f4;           /* クリーム */
  --link-color: #1a3a5c;
}

/* 基本フォント設定 */
body {
  font-family: 'Noto Serif JP', 'Yu Mincho', '游明朝', 'Hiragino Mincho ProN', 'HG明朝E', serif;
  font-weight: 400;
  color: var(--text-color);
  line-height: 1.8;
  background-color: #fff;
}

/* 見出し */
h1, h2, h3 {
  font-family: 'Noto Serif JP', 'Yu Mincho', '游明朝', serif;
  font-weight: 600;
  color: var(--primary-color);
}

/* 用語名 */
.term-name, th {
  font-family: 'Noto Sans JP', 'Meiryo', 'メイリオ', sans-serif;
  font-weight: 500;
}

/* 説明文 */
.glossary-description, td {
  font-family: 'Noto Serif JP', 'Yu Mincho', '游明朝', serif;
  line-height: 1.8;
}

/* ================================================================================
   レイアウト
   ================================================================================ */

.glossary-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 20px;
}

.glossary-header {
  margin-bottom: 25px;
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.glossary-header h1 {
  font-size: 24px;
  color: var(--primary-color);
  margin-bottom: 10px;
  letter-spacing: 0.15em;
  font-weight: 400;
}

.glossary-description {
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.7;
}

/* ================================================================================
   フィルター・検索エリア
   ================================================================================ */

.filter-container {
  background: var(--bg-cream);
  padding: 15px 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  border-radius: 0;
}

.search-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

input[type='text'] {
  flex-grow: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 0;
  font-size: 14px;
  font-family: 'Noto Sans JP', sans-serif;
  background: #fff;
}

input[type='text']:focus {
  outline: none;
  border-color: var(--primary-color);
}

input[type='text']::placeholder {
  color: #999;
}

select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 0;
  background-color: #fff;
  font-size: 13px;
  min-width: 140px;
  font-family: 'Noto Sans JP', sans-serif;
  cursor: pointer;
  color: var(--text-color);
}

select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.search-button {
  padding: 8px 20px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: 0.05em;
  transition: background-color 0.2s;
}

.search-button:hover {
  background-color: var(--secondary-color);
}

/* ================================================================================
   頭文字フィルター
   ================================================================================ */

.initial-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.initial-link {
  display: inline-block;
  padding: 4px 8px;
  text-decoration: none;
  color: var(--link-color);
  font-size: 12px;
  font-family: 'Noto Sans JP', sans-serif;
  transition: all 0.2s;
  background: transparent;
  border: none;
}

.initial-link:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.initial-link.active {
  color: #fff;
  background-color: var(--primary-color);
  text-decoration: none;
}

/* ================================================================================
   テーブル
   ================================================================================ */

.term-table-container {
  margin-top: 15px;
  border: 1px solid var(--border-color);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th, td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #e8e8e8;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

th {
  background-color: var(--bg-cream);
  font-weight: 500;
  font-size: 13px;
  color: var(--primary-color);
  border-bottom: 2px solid var(--border-color);
  letter-spacing: 0.05em;
}

td {
  font-size: 14px;
  color: var(--text-color);
  line-height: 1.7;
}

tr:hover {
  background-color: #f8f8f6;
}

/* 用語名のスタイル */
td.term-name {
  color: var(--primary-color);
  font-weight: 500;
}

/* 英語名 */
.term-en {
  display: block;
  font-size: 11px;
  color: var(--text-light);
  font-weight: 400;
  font-style: italic;
  margin-top: 2px;
  font-family: 'Noto Sans JP', sans-serif;
}

/* ================================================================================
   WEB検索ボタン
   ================================================================================ */

.web-search-btn {
  display: inline-block;
  padding: 3px 8px;
  background-color: transparent;
  color: var(--link-color);
  text-decoration: none;
  border: 1px solid var(--border-color);
  font-size: 11px;
  font-family: 'Noto Sans JP', sans-serif;
  transition: all 0.2s;
}

.web-search-btn:hover {
  background-color: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

/* カテゴリタグ */
.category-tag {
  display: inline-block;
  background-color: var(--bg-cream);
  color: var(--text-light);
  padding: 2px 8px;
  font-size: 11px;
  border: 1px solid var(--border-color);
}

/* ================================================================================
   結果サマリー・パンくず
   ================================================================================ */

.result-summary {
  margin: 10px 0;
  font-size: 12px;
  color: var(--text-light);
  font-family: 'Noto Sans JP', sans-serif;
}

.breadcrumbs {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-light);
  font-family: 'Noto Sans JP', sans-serif;
}

.breadcrumbs a {
  color: var(--link-color);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs span {
  color: var(--text-color);
}

/* ================================================================================
   広告エリア
   ================================================================================ */

.ad-container {
  text-align: center;
  margin: 30px auto;
  padding: 20px 0;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

/* ================================================================================
   ページネーション
   ================================================================================ */

.pagination {
  display: flex;
  justify-content: center;
  margin: 25px 0;
}

.pagination a, .pagination span {
  display: inline-block;
  padding: 6px 12px;
  margin: 0 2px;
  border: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--link-color);
  font-size: 12px;
  font-family: 'Noto Sans JP', sans-serif;
}

.pagination a:hover {
  background-color: var(--bg-cream);
}

.pagination .active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.pagination .disabled {
  color: #aaa;
  cursor: not-allowed;
  background-color: var(--bg-light);
}

/* ================================================================================
   モバイル対応
   ================================================================================ */

@media (max-width: 768px) {
  .glossary-container {
    padding: 15px;
  }
  
  .glossary-header h1 {
    font-size: 20px;
  }
  
  .glossary-description {
    font-size: 12px;
  }
  
  .filter-container {
    padding: 12px;
  }
  
  .search-form {
    flex-direction: column;
    width: 100%;
  }
  
  input[type='text'], select {
    width: 100%;
    font-size: 16px;
    padding: 10px 12px;
  }
  
  select {
    min-width: auto;
  }
  
  .search-button {
    width: 100%;
    padding: 10px 20px;
    font-size: 14px;
  }
  
  /* テーブルをカード形式に */
  .term-table-container {
    border: none;
    background: transparent;
  }
  
  table, thead, tbody, th, td, tr {
    display: block;
  }
  
  thead tr {
    display: none;
  }
  
  tr {
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 12px;
  }
  
  td {
    border: none;
    padding: 4px 0;
  }
  
  tr {
    position: relative;
  }
  
  /* 用語名 */
  td:nth-child(1) {
    font-size: 15px;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 6px;
    padding-right: 70px;
  }
  
  /* 定義 */
  td:nth-child(2) {
    color: var(--text-color);
    line-height: 1.6;
    font-size: 13px;
  }
  
  /* 検索ボタン */
  td:nth-child(3) {
    position: absolute;
    top: 12px;
    right: 12px;
  }
  
  .web-search-btn {
    font-size: 10px;
    padding: 2px 6px;
  }
  
  /* パンくず */
  .breadcrumbs {
    font-size: 11px;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* タブレット */
@media (min-width: 769px) and (max-width: 1024px) {
  .glossary-container {
    padding: 20px;
  }
  
  .search-form {
    flex-wrap: wrap;
  }
  
  input[type='text'] {
    width: 100%;
    margin-bottom: 8px;
  }
}
