body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: #fff;
  color: #333;
}
/* メインコンテンツラッパー */
.wrapper {
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  padding-left: 2cm;
}
h1 {
  font-size: 1.5em;
}

h2 {
  color: #000;
}

a {
  font-weight: bold;
  color: #000;
}
/* キャラの写真 */
.character-image {
  display: block;
  width: 180px;
  height: auto;
  margin: 20px auto;
  border-radius: 8px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

.separator-line {
  border: none;
  border-top: 2px solid #ddd;
  margin: 20px auto;
  width: 90%;
  position: relative;
}

main {
  max-width: 960px;
  margin: auto;
  margin-top: 20px;
  padding: 2em;
  background-color: #fff;
}

.container {
  padding-top: 20px; /* 上の余白 */
  padding-bottom: 20px; /* 下の余白 */
}

.toggle-title {
  background-color: #eee;
  padding: 0.5em;
  cursor: pointer;
  font-weight: bold;
  margin-top: 1em;
  border: 1px solid #ccc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.arrow {
  margin-left: 10px;
  transition: transform 0.3s;
}

.toggle-title.active .arrow {
  transform: rotate(180deg); /* 開いたときに上向きに */
}

.toggle-content {
  display: none;
  padding: 0.5em 1em;
  background: #fafafa;
  border: 1px solid #ddd;
  border-top: none;
}

.term {
  padding-top: 7px; /* 上の余白 */
  padding-bottom: 7px; /* 下の余白 */
}

.yougo-image {
  width: 70%;
  padding: 10px;
}

.search-section {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  margin-bottom: 30px;
}

.search-box {
  width: 90%;
  padding: 15px 20px;
  font-size: 1.1rem;
  border: 2px solid #e9ecef;
  border-radius: 25px;
  outline: none;
  transition: all 0.3s ease;
}

.search-box:focus {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.filter-tabs {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-tab {
  padding: 8px 16px;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
}

.filter-tab.active {
  background: #e74c3c;
  color: white;
  border-color: #e74c3c;
}

.category-section {
  margin-bottom: 40px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 15px 0;
  border-bottom: 3px solid #e74c3c;
}

.category-icon {
  font-size: 1.5rem;
}

.category-title {
  font-size: 1.8rem;
  color: #2c3e50;
  font-weight: bold;
}

.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
}

.term-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #3498db;
  transition: all 0.3s ease;
}

.term-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.rescue .term-card {
  border-left-color: #e74c3c;
}

.personality .term-card {
  border-left-color: #9b59b6;
}

.decode .term-card {
  border-left-color: #f39c12;
}

.survivor .term-card {
  border-left-color: #27ae60;
}

.hunter .term-card {
  border-left-color: #34495e;
}

.other .term-card {
  border-left-color: #95a5a6;
}

.term-name {
  font-size: 1.3rem;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.term-reading {
  font-size: 0.9rem;
  color: #7f8c8d;
  font-style: italic;
}

.term-description {
  color: #5d6d7e;
  line-height: 1.7;
}

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

@media (max-width: 1210px) {
  body {
    line-height: 1.4;
  }

  .wrapper {
    flex-direction: column; /* レイアウトを縦方向に */
    padding-left: 1cm;
    padding-right: 1cm;
  }
}

/* スマホ対応のレスポンシブデザイン */
@media (max-width: 768px) {
  .terms-grid {
    grid-template-columns: 1fr;
  }

  .filter-tabs {
    justify-content: flex-start;
  }

  .character-image {
    max-width: 200px;
    margin: 10px auto;
    border-radius: 5px;
  }
}
