body {
  margin: 0;
  background: #fff;
  font-family: Arial, Helvetica, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "メイリオ", Meiryo, sans-serif;
  color: #222;
}
body a:hover {
  opacity: 0.6;
  transition: opacity 0.1s ease-in-out;
}

.ranking-container {
  width: 1280px;
  margin: 0 auto;
  position: relative;
}

/* 初期のヘッダ定義は下段のテンプレ用に統合 */

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-menu {
  background: none;
  border: none;
  padding: 0 8px 0 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 32px;
  width: 36px;
  cursor: pointer;
}
.menu-bar {
  display: block;
  width: 22px;
  height: 3px;
  background: #333;
  margin: 3px 0;
  border-radius: 2px;
}
.ranking-header .header-logo {
  width: 140px;
}
.header-cart {
  background: none;
  border: none;
  padding: 0;
  margin-left: auto;
  height: 32px;
  cursor: pointer;
}
.header-search-row {
  width: 100%;
  margin-top: 8px;
  display: flex;
}
.header-search {
  width: 100%;
  font-size: 16px;
  padding: 8px 12px;
  border: 1px solid #e3e7ed;
  border-radius: 6px;
  background: #fafbfc;
  box-sizing: border-box;
}

.breadcrumb {
  font-size: 12px;
  color: #6C757D;
  margin: 20px 0 35px 0;
}
.breadcrumb ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow-x: scroll;
}
.breadcrumb li:not(:last-child)::after {
  content: ">";
  margin: 0 4px;
  color: #bbb;
}
.ranking-main {
  display: flex;
  flex-direction: column-reverse;
  margin: 10px 0 60px;
  gap: 24px;
}

/* Sidebar */
.sidebar {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding-top: 10px;
}
.sidebar-section {
  background: rgba(30, 50, 70, 0.05);
  border-radius: 4px;
  padding: 18px;
  margin-bottom: 24px;
}
.sidebar-section-releteditem {
  border-top: 1px solid #e3e7ed;
  padding-top: 24px;
}
.sidebar-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}
.genre-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}
.genre-list li {
  font-size: 14px;
  padding: 4px 0;
  border-radius: 2px;
}
.genre-list li.active {
  background: #e5e5e5;
  font-weight: 600;
  color: #007BB0;
}
.sidebar-more, .sidebar-close {
  width: 100%;
  padding: 12px 0;
  border: 1px solid rgba(30, 50, 70, 0.2);
  background: #fff;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  color: #222;
}

/* メインコンテンツ */
.main-content {
  width: 810px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.main-title-row h1 {
  font-size: 24px;
  font-weight: bold;
  margin: 0;
}
.main-title-row p {
  margin: 6px 0 0 0;
}
.main-content a {
  color: #007BB0;
  text-decoration: none;
}

.update-date {
  font-size: 14px;
  color: #6C757D;
}

/* ランキングカード */
.ranking-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 25px;
}
.ranking-card {
  border: 1px solid #e3e7ed;
  border-radius: 6px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.card-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.card-info {
  width: 100%;
}
.card-reviews {
  margin-top: 18px;
}
.card-title a {
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
}
.card-title { margin: 0; }
.card-rating {
  font-size: 14px;
  color: #FFC300;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.card-rating .stars {
  font-size: 14px;
  vertical-align: middle;
  letter-spacing: -2px;
}
.card-rating .rating-val {
  font-size: 1.1em;
}
.card-reviews-row {
  display: flex;
  gap: 16px;
}

/* レビュー抜粋ボックスの共通スタイル（HTML内の重複を集約） */
.card-review-box {
  background: #fff;
  border: 1px solid #e2e7ed;
  border-radius: 6px;
  padding: 18px 18px 14px 18px;
  flex: 1 1 0;
  min-width: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  font-size: 1.1rem;
  justify-content: flex-start;
}
.review-title {
  font-weight: bold;
  font-size: 1.0rem;
  margin-bottom: 2px;
  letter-spacing: 0;
}
.review-stars { color: #ffb800; font-size: 1.0rem; letter-spacing: -1px; vertical-align: middle; margin-right: 2px; }
.review-score { font-weight: bold; font-size: 1.0rem; margin-left: 3px; vertical-align: middle; }
.review-detail-link { color: #007BB0; display: block; margin-top: 10px; text-decoration: none; font-size: 0.8rem; }
.card-meta span { margin-right: 12px; }
.plan-price { font-size: 1.3rem; font-weight: 700; }
.plan-type { font-size: 1.0rem; }
.card-review-box .review-body { color: #666; font-size: 12px; margin-top: 4px; }
.card-plan-row {
  display: flex;
  gap: 12px;
  margin: 12px 0;
  background: rgba(30, 50, 70, 0.05);
  border-radius: 6px;
  padding: 10px 14px;
  max-width: fit-content;
}
.plan-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  box-sizing: border-box;
}
.plan-block:nth-of-type(2){
  border-left: 1px solid #ccc;
  padding-left: 18px;
}
.plan-type {
  font-size: 14px;
  color: #222;
}
.plan-price {
  font-size: 22px;
  font-weight: 700;
}
.plan-price .unit {
  font-size: 15px;
  font-weight: 400;
  margin-left: 2px;
}
.card-meta {
  font-size: 0.8em;
  color: #666;
  display: flex;
  column-gap: 12px;
  row-gap: 6px;
  flex-wrap: wrap;
  line-height: 1.1;
}
.card-meta span:not(:first-child) {
  padding-left: 12px;
  border-left: 1px solid #e3e7ed;
}
.card-review {
  flex: 1;
  background: #fff;
  border: 1px solid #e3e7ed;
  border-radius: 6px;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  box-shadow: none;
  min-width: 0;
}
.review-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 6px;
}
.review-label {
  font-weight: bold;
  color: #222;
}
.stars {
  color: #FFC300;
  margin-right: 4px;
}
.rating-val {
  color: #222;
  font-weight: 600;
  font-size: 1.1em;
}
.review-text {
  font-size: 12px;
  color: #6C757D;
  word-break: break-all;
}
.card-review-box .review-body {
  /* 3行まで表示し、それ以上は自動で三点リーダー。3行以内なら表示しない */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3; /* compatibility */
  overflow: hidden;
  text-overflow: ellipsis;
}
.review-num {
  color: #007BB0;
}


/* もっと見るリンク */
    .more-link-row {
      text-align: center;
    }
    .more-link {
      display: inline-block;
      width: 100%;
      background: rgba(30, 50, 70, 0.05);
      border-radius: 6px;
      padding: 18px 40px;
      color: #007BB0;
      font-size: 15px;
      font-weight: 600;
      text-decoration: none;
      box-sizing: border-box;
    }
.more-link:hover {
  background: #e9ecef;
}

/* 注意事項 */
.notice-box {
  background: rgba(30, 50, 70, 0.05);
  border-radius: 6px;
  padding: 12px;
  margin-top: 24px;
}
h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}
.notice-box ul {
  margin: 0;
  padding-left: 20px;
}
.notice-box li {
  font-size: 13px;
  margin-bottom: 6px;
}

.genre-textlink a {
  font-size: 14px;
  line-height: 2;
}
.genre-textlink a:not(:first-child)::after {
  padding-left: 6px;
  content: "|";
  color: #ccc;
}

.card-thumb {
  display: block;
  margin: 0;
  max-width: 150px;
  width: 100%;
  text-align: center;
}

/* 旧カードランク定義は下段の統一定義に集約 */

/* パンくずリスト用 */
.breadcrumb a {
  color: #7b858e;
}
/* AIサマリーボックス */
.ai-summary-box {
  background: rgba(30, 50, 70, 0.05);
  border: 1px solid #e3e7ed;
  border-radius: 6px;
  padding: 12px 18px;
  box-shadow: 0 2px 8px rgba(30,50,70,0.04);
}
.ai-summary-title {
  font-size: 17px;
  font-weight: bold;
  color: #007BB0;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}
.ai-summary-text {
  font-size: 15px;
  color: #222;
  line-height: 1.6;
}

.genre-list {
  /* アニメーションの初期値 */
  /* max-height: 140px; 5件分の高さに調整 */
  /* overflow: hidden; */
  transition: max-height 0.2s cubic-bezier(.4,0,.2,1), opacity 0.2s;
  opacity: 1;
}
.genre-list a {
  text-decoration: none;
  color: #222;
}
.genre-list.show-all {
  max-height: 1000px; /* 十分大きな値にして全件表示 */
  opacity: 1;
  transition: max-height 0.2s cubic-bezier(.4,0,.2,1), opacity 0.2s;
}
.genre-list.hide {
  opacity: 0;
  transition: opacity 0.2s;
}

/* リスト項目の出現アニメーション（オプション） */
.genre-list li {
  transition: opacity 0.4s, transform 0.4s;
}
.genre-list:not(.show-all) .hidden-item {
  opacity: 0;
  transform: translateY(0px);
  pointer-events: none;
}
.genre-list.show-all .hidden-item {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  display: list-item;
}

/* PCサイドバー用 */
.genre-list .path1 { margin-left: 0; font-weight: bold; }
.genre-list .path2 { margin-left: 0.5em; }
.genre-list .path3 { margin-left: 1em; }

@media (max-width: 768px) {
  .pc-only { display: none !important; }
  .sp-only { display: block !important; }

  .ranking-container,
  .main-content,
  .sp-ranking {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }
  .ranking-container {
    padding: 0 15px;
  }
  .card-review:nth-child(2) {
    margin-top:6px;
  }
}


/* テンプレート追加のスタイル */
.ranking-header {
  background: #fff;
  border-bottom: 1px solid #e3e7ed;
  padding: 14px 0 10px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.ranking-header .header-logo {
  width: 140px;
}
.ranking-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}
.ranking-main {
  display: flex;
  gap: 30px;
}
.main-title-row h1 {
  font-size: 1.6rem;
  color: #333;
  margin: 0 0 8px 0;
}
.update-date {
  color: #666;
  font-size: 0.9rem;
  margin: 0;
}

.ranking-cards {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ranking-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 0;
  display: flex;
  gap: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.ranking-card-row {
  display: flex;
  flex-direction: column;
}
.card-rank {
  flex: 0 0 60px;
  text-align: left;
  font-size: 24px;
  font-weight: bold;
  color: #000;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-left: 2px;
}
.rank-icon { width: 28px; height: 28px; vertical-align: middle; margin-right: 4px; }
.card-main {
  flex: 1;
  display: flex;
  gap: 20px;
}
.card-info {
  flex: 1;
  margin-top: 5px; /* 商品情報とレビューの間隔調整 */
}


  .unit {
    font-size: 0.9rem;
    font-weight: normal;
  }

@media (min-width: 769px) {
  .pc-only { display: block !important; }
  .sp-only { display: none !important; }
  .ranking-main {
    flex-direction: row;
    gap: 80px;
  }
  .ranking-card {
    padding: 18px;
  }
  .card-title {
    font-size: 1.1em;
    margin-bottom: 4px;
  }
  .card-rank {
    justify-content: start;
    margin-top: -10px;
  }
  .card-main {
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
  }
  .card-thumb {
    width: 130px;
    height: 130px;
    max-width: 130px;
    max-height: 130px;
  }
  .card-reviews {
    display: flex;
    gap: 12px;
  }
  .plan-block {
    width: 220px;
  }
  .more-link {
    width: 50%;
  }
  .sidebar {
    width: 310px;
  }
  .genre-list li {
    padding: 6px 0 6px 15px;
  }

  .notice-box {
    padding: 18px;
  }
  .ai-summary-box {
    padding: 18px 24px;
  }
  .breadcrumb ol {
    overflow-x: hidden;
  }

  .ranking-card-row{
    display:grid !important;
    grid-template-columns:180px 1fr;   /* 左180px／右残り */
    grid-template-areas:
      "header info"
      "reviews reviews";
    column-gap:24px;
    row-gap: 10px;   /* 商品レビューとのすき間調整 */
  }

  .card-main{display:contents;}  /* 子要素を直接グリッド参加 */

  .card-header      {grid-area:header;}
  .card-info        {grid-area:info;}
  .card-reviews-row {grid-area:reviews;}
  .breadcrumb { margin-top: 1px; }   /* ヘッダーとパンくずとのすき間調整 */

}

/* モバイル対応 */
@media (max-width: 768px) {
  .pc-only { display: none !important; }
  .sp-only { display: block !important; }

  .ranking-container,
  .main-content,
  .sp-ranking {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }
  .ranking-container {
    padding: 0 15px;
  }
  .card-review:nth-child(2) {
    margin-top:6px;
  }
  
  /* レビューボックスのモバイル対応 */
  .card-reviews-row {
    flex-direction: column;
    gap: 12px;
  }
  .card-review-box {
    padding: 14px;
    font-size: 1.1rem;
  }
  .review-title {
    font-size: 0.9rem;
  }
  .card-review-box .review-body {
    font-size: 1.0rem;
    line-height: 1.5;
  }
  .card-header{ width:140px; gap:10px; align-items:center !important; margin:0 auto !important; margin-top: -10px !important; }
  .card-thumb{ width:140px; height:140px; margin:0 auto !important; }
  .card-rank{ justify-content:center !important; flex-direction:row !important; }
  .ranking-card-row{row-gap: 10px}
  .card-review-box{max-width:100% !important; }
}

.card-header{
  display:flex !important;
  flex-direction:column;
  align-items:flex-start; /* 左寄せ */
  gap:2px;
  width:180px;
}
.card-thumb{
  width:180px; height:180px; object-fit:contain;
}

/* PC ではレビュー 2 枚横並び */
.card-reviews-row{flex-wrap:nowrap}
.card-review-box{max-width:calc(50% - 8px)}


  


