:root {
  --bg: #fdf8f2;         /* 背景（クリーム系） */
  --ink: #2b2b2b;        /* 文字色（やや柔らかい黒） */
  --muted: #666;         /* 補助文字色 */
  --brand: #1e7732;      /* ブランド色（深緑） */
  --brand-weak: #f4d9d0; /* 薄いピンク（アクセント／選択背景） */
  --line: #e0d8cc;       /* 区切り線 */
  --panel: #fff;         /* パネル背景 */
}

/* 基本リセット */
html, body { height:100%; }
* { box-sizing:border-box; }
body { margin:0; font-family: system-ui, -apple-system, Segoe UI, Roboto, "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif; line-height:1.65; background:var(--bg); color:var(--ink); }
a { color:var(--brand); text-decoration:none; }
a:hover { text-decoration:underline; }
p { margin: 0.5em 0; }

/* 背景用の半透明レイヤ */
.backdrop { position:fixed; inset:0; background:rgba(0,0,0,.25); z-index:1100; opacity:0; visibility:hidden; transition: opacity .2s ease; }
body.menu-open .backdrop { opacity:1; visibility:visible; }
body.menu-open { overflow:hidden; }

body{ padding-top: var(--headerH, 64px); }

/* 低モーション配慮 */
@media (prefers-reduced-motion: reduce) {
header.site-header { transition:none; }
}
/* 印刷 */
@media print { a::after { content:" (" attr(href) ")"; font-size:.85em; } aside.nav { border:none; } }

/* ヘッダーをstickyに。スクロール方向で出し入れ */
header.site-header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  border-bottom:1px solid var(--line);
  background: var(--panel);
  transition: transform .25s ease, box-shadow .2s ease, background-color .2s ease;
  will-change: transform;
}
/* 下方向スクロール時に隠す */
header.site-header.is-hidden { transform: translateY(-100%); }
/* 少しでもスクロールしていたら影を付ける */
body.scrolled header.site-header { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.site-header .inner { max-width:1920px; margin:0 auto; padding:12px 16px; display:flex; align-items:center; gap:16px; }
.brand { font-weight:800; font-size:1.25rem; letter-spacing:.02em; }
.tagline { color:var(--muted); font-size:.9rem; }
.layout { max-width:1920px; margin:0 auto; display:flex; gap:16px; padding:16px; }
/* ナビ */
aside.nav { width:210px; flex:0 0 210px; position:sticky; top:8px; align-self:flex-start; display:flex; flex-direction:column; gap:8px; }
aside.nav > nav { background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:12px; }
.nav h2 { font-size:1rem; margin:0 0 8px; }
nav ul { list-style:none; padding:0; margin:0; }
nav li { border-top:1px solid var(--line); }
nav li:first-child { border-top:none; }
nav a { display:block; padding:10px 8px; }
nav a[aria-current="page"], nav a.active { background:var(--brand-weak); font-weight:700; }
/* 本文 */
main.content { flex:1 1 auto; min-width:0; }
.card { background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:16px; margin-bottom:16px; }
.card h2 { margin-top:0; }
.card img { display:block; max-width:100%; height:auto; border-radius:6px; margin:0 auto 0px; object-fit:cover; }
.meta { color:var(--muted); font-size:.9rem; }
/* フッター */
footer.site-footer { border-top:1px solid var(--line); margin-top:24px; background:var(--panel); }
.site-footer .inner { max-width:1920px; margin:0 auto; padding:16px; color:var(--muted); font-size:.9rem; display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap; }
/* レスポンシブ */
@media (max-width:800px) { .layout { flex-direction:column; } aside.nav { width:100%; position:static; } }
/* 低モーション設定に配慮 */
@media (prefers-reduced-motion: reduce) { header.site-header { transition: none; } }
@media print { a::after { content:" (" attr(href) ")"; font-size:.85em; } aside.nav { border:none; } }

/* 汎用ボタン */
.btn-base {
  display: inline-block;
  padding: 0.6em 1.0em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.15s ease;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .btn-base:hover, .btn2:hover {
    transform: scale(1.12);               /* ← 思い切って“浮かす” */
    box-shadow: 0 14px 28px rgba(0,0,0,.18), 0 8px 12px rgba(0,0,0,.12);
    z-index: 1;
  }
}
.btn-base:active, .btn2:active {
  transform: scale(0.90);
  box-shadow: 0 4px 10px rgba(0,0,0,.18) inset, 0 0 0 rgba(0,0,0,0);
}
.btn2 {
  background: var(--panel);
  color: var(--brand);
  border: 1px solid var(--brand);
}
.btn2:hover {
  background: var(--brand-weak);
}
/* キーボード操作での見やすさも確保 */
.btn-base:focus-visible, .btn2:focus-visible {
  outline: 3px solid var(--brand-weak);
  outline-offset: 2px;
}
/* 並べる用の行。wrap可、gapで余白を管理 */
.btn-row{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap: 16px;          /* ←基本余白。scale(1.12)なら 16〜20pxが目安 */
}
/* 念のためボタンはインラインフレックスに */
.btn-base, .btn2{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
/* 記事詳細ページのメタ情報 */
.article-meta {
  margin-top: 1em;
  margin-bottom: 2em;
  font-size: 0.9rem;
  color: var(--muted);
}

.article-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: -0.5em;
}

.article-meta-row:last-child {
  margin-bottom: 0;
}

.article-meta-date {
  flex: 1;
}

/* ジャンルタグボタン（記事詳細ページ、メタ情報内） */
.major-tag-button {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 4px;
  color: #000 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.major-tag-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* タグセクション（記事詳細ページ下部） */
.tag-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 2em;
  padding-top: 1.5em;
  border-top: 1px solid var(--line);
}
/* ページネーション */
.pagination {
  margin: 2em 0;
  display: flex;
  justify-content: center;
}
.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 0.5em;
  flex-wrap: wrap;
  justify-content: center;
}
.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5em;
  height: 2.5em;
  padding: 0.5em 0.8em;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: var(--panel);
  color: var(--brand);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pagination-btn:hover {
  background: var(--brand);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.pagination-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ページ番号ボタン */
.pagination-number {
  min-width: 2.5em;
}

/* 現在のページ */
.pagination-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5em;
  height: 2.5em;
  padding: 0.5em 0.8em;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 最初/最後のページボタン */
.pagination-first,
.pagination-last {
  font-size: 1.2rem;
  min-width: 2.5em;
}

/* 前/次のページボタン */
.pagination-prev,
.pagination-next {
  font-size: 1.2rem;
  min-width: 2.5em;
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
  .pagination-buttons {
    gap: 0.3em;
  }

  .pagination-btn,
  .pagination-current {
    min-width: 2em;
    height: 2em;
    font-size: 0.9rem;
    padding: 0.4em 0.6em;
  }

  .pagination-first,
  .pagination-last,
  .pagination-prev,
  .pagination-next {
    font-size: 1rem;
  }
}
/* === Wikipediaの目次風：縦積み＋シンプルな開閉 === */
.nav .toc { list-style: none; padding: 0; margin: 0; }
.nav .toc > li { border-top: 1px solid var(--line); }
.nav .toc > li:first-child { border-top: none; }

/* 親見出しはボタン化（誤遷移を防ぐ） */
.toc-parent {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px; background: none; border: none;
  font: inherit; color: var(--ink); text-align: left; cursor: pointer;
}
.toc-parent:hover { text-decoration: underline; }

/* 「＞」→開いたら「∨」に切替（回転ではなく文字差し替え） */
.caret::before { content: "＞"; font-size: .9em; line-height: 1; opacity: .85; }
.toc-parent[aria-expanded="true"] .caret::before { content: "∨"; }

/* 子リストは控えめにインデントだけ（装飾なし） */
.toc-sub { list-style: none; margin: 4px 0 8px 1em; padding: 0; }
.toc-sub li a { display: block; padding: 4px 8px; color: var(--brand); }

/* “目次風”にするため、アクティブ強調は下線へ（背景色は使わない） */
aside.nav nav a[aria-current="page"],
aside.nav nav a.active {
  background: transparent;
  text-decoration: underline;
  font-weight: 700;
}
/* 親メニュー（toc-parent ボタン）をリンク色と同じにする */
.toc-parent {
  display: flex;
  align-items: center;
  gap: 0.4em;   /* 文字と矢印の間隔を少しだけ空ける */
  justify-content: flex-start;  /* ← 左寄せに修正 */
  width: 100%;
  padding: 10px 8px;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  color: var(--brand);
}
.toc-parent .caret::before {
  content: "＞";
}
.toc-parent[aria-expanded="true"] .caret::before {
  content: "∨";
}
.toc-parent:hover {
  background: var(--brand-weak);
}
/* 親メニュー（展開中）の背景色を brand-weak に */
/*.toc-parent[aria-expanded="true"] {
  background: var(--brand-weak);
}*/

/* hover 時は brand-weak を少し薄くする */
.toc-parent:hover {
  background: color-mix(in srgb, var(--brand-weak) 70%, transparent);
}

/* ===== 目次の統一ハイライト（現在地/展開中/ホバー） ===== */

/* 現在地のリンク（子/単独）を brand-weak で塗る */
aside.nav .toc a[aria-current="page"],
aside.nav .toc a.active {
  background: var(--brand-weak);
  text-decoration: none; /* 目次風を保ちたいなら消す/残すは好み */
  font-weight: 700;
}



/* ホバー時は brand-weak を少しだけ薄く */
aside.nav .toc a:hover,
.toc-parent:hover {
  background: color-mix(in srgb, var(--brand-weak) 60%, transparent);
}

/* color-mix 非対応ブラウザ向けフォールバック */
@supports not (color-mix(in srgb, black 0%, white 0%)) {
  aside.nav .toc a:hover,
  .toc-parent:hover {
    /* var(--brand-weak)=#f4d9d0 → 約60%不透明にした色 */
    background: rgba(244, 217, 208, 0.60);
  }
}

/* 見出しなどアンカー到達時の上余白（ヘッダー分） */
:where(h1, h2, h3, h4, h5, h6, [id]) { scroll-margin-top: calc(var(--headerH, 56px) + 8px); }

/* スムーズスクロール（好みで） */
html { scroll-behavior: smooth; }



/* === TOC: article.card .toc-local === */
article.card .toc-local{
  border:1px solid var(--line, #e5e7eb);
  background:var(--panel, #fafafa);
  border-radius:8px;
  padding:12px;
  margin:8px 0 16px;
}
article.card .toc-local strong{display:block;margin-bottom:6px}
article.card .toc-local ol{list-style:none;margin:0;padding-left:.25rem;counter-reset:item}
article.card .toc-local li{ border-color: color-mix(in srgb, var(--line, #e5e7eb) 30%, transparent);}
/*
article.card .toc-local li > ol{
  border-bottom: 1px solid var(--line, #e5e7eb);
  margin-bottom: .35rem;
  padding-bottom: .35rem;
}
*/
article.card .toc-local li:has(> ol) + li{ margin-top: .25rem; }
article.card .toc-local > ol > li:last-child > ol{ border-bottom: none; }
article.card .toc-local li::before{content:counters(item, ".") ". ";opacity:.7;margin-right:.25rem}
article.card .toc-local a{display:block;padding:.25rem .25rem .25rem .5rem;border-radius:6px;text-decoration:none}
article.card .toc-local a:hover{background:var(--brand-weak, #eef2ff)}

:target{
  outline: none; 
  /* background: transparent; ← 消す */
  /* 背景をいじらないこと */
}
:is(h3,h4,h5):target{
  outline: 3px solid var(--brand-weak, #c7d2fe);
  background-color: color-mix(in srgb, var(--brand-weak, #c7d2fe) 20%, transparent);
  /* あるいは背景を汚したくないなら outline/box-shadow だけでも可 */
  /* box-shadow: 0 0 0 9999px color-mix(in srgb, var(--brand-weak) 12%, transparent) inset; */
}
:target:not(:is(h3,h4,h5)){
  outline: none;
  /* background は触らない */
}


/* 任意: 目次をカード上部に固定したい場合に併用 */
article.card .toc-local.toc-sticky{position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto;}

/* === TOC: 番号を消して、入れ子ごとに1chずつ字下げ（上書き） === */
article.card .toc-local ol{ list-style:none; padding-left: 0; counter-reset: none; }
article.card .toc-local li::before{ content: none; }

/* 基本の行内パディングをch基準に置き換え */
article.card .toc-local a{ padding-left: 0.5ch; }            /* 第1階層 */
article.card .toc-local ol ol a{ padding-left: 1.5ch; }      /* 第2階層 */
article.card .toc-local ol ol ol a{ padding-left: 2.0ch; }   /* 第3階層 */
article.card .toc-local ol ol ol ol a{ padding-left: 2.5ch; }/* 第4階層（必要なら） */

/* 視覚ガイド（任意）：入れ子に薄い罫線 */
article.card .toc-local ol ol{ border-left: 1px dashed var(--line, #e5e7eb); margin-left: 1.0ch; padding-left: 2.75ch; }
article.card .toc-local ol ol > li:first-child{
  border-top: 1px solid color-mix(in srgb, var(--line, #e5e7eb) 30%, transparent);
  padding-top: .10rem; /* 線と文字の間のゆとり */
}
/* === 右下 トップへ戻るボタン === */
.to-top { position: fixed; right: 16px; bottom: 16px; z-index: 1400; }
.to-top button {
width: 44px; height: 44px; border-radius: 9999px;
border: 1px solid var(--line); background: var(--brand); color: #fff;
font-weight: 700; line-height: 1; font-size: 1rem;
display: flex; align-items: center; justify-content: center;
box-shadow: 0 4px 12px rgba(0,0,0,.12);
cursor: pointer;
transition: transform .15s ease, opacity .2s ease, background-color .2s ease;
opacity: 0; transform: scale(.9); pointer-events: none; /* 初期は非表示 */
}
.to-top button.show { opacity: 1; transform: scale(1); pointer-events: auto; }
/* マウスのある環境だけ強いホバー効果（SP誤爆を避ける） */
@media (hover: hover) and (pointer: fine) {
  .to-top button.show:hover {
    transform: scale(1.3); /* ← 浮かす */
    box-shadow: 0 14px 28px rgba(0,0,0,.18), 0 8px 12px rgba(0,0,0,.12);
    z-index: 1;
  }
}

.to-top button:focus-visible { outline: 3px solid var(--brand-weak); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .to-top button { transition: none; } }

/* PCではJSでleft座標を与えるのでrightを無効化 */
@media (min-width: 801px) {
  .to-top { right: auto; }              /* ← 既定のright固定を外す */
  .to-top button { bottom: 24px; }      /* 少し上げる（任意） */
}

/* === モーダル内 トップへ戻るボタン === */
.modal-to-top {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  line-height: 1;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  cursor: pointer;
  transition: transform .15s ease, opacity .2s ease, background-color .2s ease;
  opacity: 0;
  transform: scale(.9);
  pointer-events: none;
  z-index: 10;
}

.modal-to-top.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
  .modal-to-top.show:hover {
    transform: scale(1.3);
    box-shadow: 0 14px 28px rgba(0,0,0,.18), 0 8px 12px rgba(0,0,0,.12);
  }
}

.modal-to-top:focus-visible {
  outline: 3px solid var(--brand-weak);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .modal-to-top { transition: none; }
}


/* === 見出しの淡グラデーション背景（左→右で薄く） === */
/* すべて緑系で、h1→h5に向かって薄くなる */
:root{
  /* 濃さ（％）：h1が最も濃く、h5が最も薄い */
  --hd1-left: 25%;  --hd1-right: 8%;
  --hd2-left: 20%;  --hd2-right: 6%;
  --hd3-left: 15%;  --hd3-right: 4%;
  --hd4-left: 10%;  --hd4-right: 3%;
  --hd5-left: 6%;   --hd5-right: 2%;
}

/* 共通の見た目（余白・角丸） */
h1, h2, h3, h4, h5{
  position: relative;
  padding: .5em .8em;
  border-radius: 6px;
  margin-top: 1.5em;
  margin-bottom: .8em;
}

/* h1: 最も濃い緑 */
h1{
  border-left: 8px solid color-mix(in srgb, var(--brand) 60%, transparent);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--brand) var(--hd1-left), transparent) 0%,
    color-mix(in srgb, var(--brand) var(--hd1-right), transparent) 70%,
    transparent 100%
  );
  font-weight: 800;
  font-size: 1.8em;
  margin-bottom: 0.2em;
}

/* h2: やや濃い緑 */
h2{
  border-left: 6px solid color-mix(in srgb, var(--brand) 50%, transparent);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--brand) var(--hd2-left), transparent) 0%,
    color-mix(in srgb, var(--brand) var(--hd2-right), transparent) 70%,
    transparent 100%
  );
  font-weight: 700;
  font-size: 1.5em;
}

/* h3: 中程度の緑 */
h3{
  border-left: 5px solid color-mix(in srgb, var(--brand) 40%, transparent);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--brand) var(--hd3-left), transparent) 0%,
    color-mix(in srgb, var(--brand) var(--hd3-right), transparent) 70%,
    transparent 100%
  );
  font-weight: 700;
  font-size: 1.3em;
}

/* h4: やや薄い緑 */
h4{
  border-left: 4px solid color-mix(in srgb, var(--brand) 30%, transparent);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--brand) var(--hd4-left), transparent) 0%,
    color-mix(in srgb, var(--brand) var(--hd4-right), transparent) 70%,
    transparent 100%
  );
  font-weight: 700;
  font-size: 1.15em;
}

/* h5: 最も薄い緑 */
h5{
  border-left: 3px solid color-mix(in srgb, var(--brand) 20%, transparent);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--brand) var(--hd5-left), transparent) 0%,
    color-mix(in srgb, var(--brand) var(--hd5-right), transparent) 70%,
    transparent 100%
  );
  font-weight: 700;
  font-size: 1.05em;
}

/* color-mix 非対応ブラウザ向けフォールバック */
@supports not (color-mix(in srgb, black 0%, white 0%)){
  h1{ background: linear-gradient(90deg, rgba(30,119,50,.25) 0%, rgba(30,119,50,.08) 70%, rgba(30,119,50,0) 100%); border-left: 8px solid rgba(30,119,50,.60); }
  h2{ background: linear-gradient(90deg, rgba(30,119,50,.20) 0%, rgba(30,119,50,.06) 70%, rgba(30,119,50,0) 100%); border-left: 6px solid rgba(30,119,50,.50); }
  h3{ background: linear-gradient(90deg, rgba(30,119,50,.15) 0%, rgba(30,119,50,.04) 70%, rgba(30,119,50,0) 100%); border-left: 5px solid rgba(30,119,50,.40); }
  h4{ background: linear-gradient(90deg, rgba(30,119,50,.10) 0%, rgba(30,119,50,.03) 70%, rgba(30,119,50,0) 100%); border-left: 4px solid rgba(30,119,50,.30); }
  h5{ background: linear-gradient(90deg, rgba(30,119,50,.06) 0%, rgba(30,119,50,.02) 70%, rgba(30,119,50,0) 100%); border-left: 3px solid rgba(30,119,50,.20); }
}

/* 余白の整え（任意） */
h1:not(:first-child), h2:not(:first-child), h3:not(:first-child), h4:not(:first-child){ margin-top: 1.0em; }

/* article.cardの最初のh1は上余白を削除 */
article.card > h1:first-child {
  margin-top: 0;
}

/* ===== 記事カード一覧グリッド（レアカード風） ===== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* デフォルト: 3列 */
  gap: 24px;
  margin-top: 24px;
  max-width: 100%;
}

/* 大画面: 6列 */
@media (min-width: 1400px) {
  .article-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
  }
}

/* 中画面: 4列 */
@media (min-width: 1000px) and (max-width: 1399px) {
  .article-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
}

/* タブレット: 3列 */
@media (min-width: 700px) and (max-width: 999px) {
  .article-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .article-card-meta-wrapper {
    padding: 70px 4px 12px; /* 横幅最大化・下枠拡大 */
  }

  .article-card-meta {
    font-size: 0.8rem;
    -webkit-line-clamp: 4; /* 3→4行 */
    padding: 5px 8px;
  }
}

/* 記事カード本体（5:7比率） */
.article-card {
  display: block;
  position: relative;
  text-decoration: none;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.1s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 8px 16px rgba(0,0,0,0.25), 0 4px 8px rgba(0,0,0,0.15);
  transform-style: preserve-3d;
  perspective: 1000px;
  /* クリアな外枠 */
  border: 5px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%);
  aspect-ratio: 5 / 7;
  width: 100%;
}

.article-card:hover {
  box-shadow: 0 16px 32px rgba(0,0,0,0.3), 0 8px 16px rgba(0,0,0,0.2), 0 0 30px rgba(30,119,50,0.2);
  border-color: rgba(0, 191, 255, 0.7); /* 水色（ディープスカイブルー） */
}

/* 画像エリア（正方形固定） */
.article-card-image {
  position: relative;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* タイトル部分（上部・MTG風） */
.article-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px;
  z-index: 2;
}

/* カードタイトル（MTG風の名前枠） */
.article-card-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.4;
  /* MTG風の枠スタイル */
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  padding: 8px 12px;
  text-shadow: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  /* タイトルを1行に収める（JavaScriptで自動調整） */
  white-space: nowrap;
  overflow: hidden;
}

/* メタ情報部分（下部・グラデーション付き） */
.article-card-meta-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 60px 8px 8px;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.95) 20%,
    rgba(255, 255, 255, 0.90) 35%,
    rgba(255, 255, 255, 0.75) 50%,
    rgba(255, 255, 255, 0.45) 65%,
    rgba(255, 255, 255, 0.2) 80%,
    rgba(255, 255, 255, 0) 100%
  );
  z-index: 1;
}

/* カスタムカラー対応（淡い色・透明感） */
.article-card-title[data-color] {
  position: relative;
  background: color-mix(in srgb, var(--title-color) 50%, white) !important;
  color: #2b2b2b !important;
  text-shadow: none;
  border-color: color-mix(in srgb, var(--title-color) 70%, transparent) !important;
}

/* color-mix 非対応ブラウザ向けフォールバック */
@supports not (color-mix(in srgb, black 0%, white 0%)) {
  .article-card-title[data-color] {
    background: var(--title-color) !important;
    color: #2b2b2b !important;
    border-color: var(--title-color) !important;
    opacity: 0.8;
  }
}

/* カードメタ情報 */
.article-card-meta {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-shadow: none;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(200, 200, 200, 0.5);
  padding: 6px 10px;
  border-radius: 4px;
  /* テキストを3行で省略 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

/* ジャンルタグ（タイトルの下、右寄せ） */
.article-major-tag {
  display: inline-block;
  margin-top: 6px;
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 3px;
  color: #000 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  line-height: 1;
  text-align: right;
  width: fit-content;
  float: right;
  clear: both;
}

/* スマホ: 2列（600px以下） */
@media (max-width: 600px) {
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .article-card-image {
    height: 240px;
  }

  /* スマホ版ではジャンルタグを少し小さく */
  .article-card-title {
    font-size: 1rem;
    padding: 6px 10px;
  }

  .article-major-tag {
    font-size: 0.65rem;
    padding: 2px 5px;
    margin-top: 4px;
  }

  /* スマホ版でもメタ情報は横並びを維持 */
  .article-meta {
    font-size: 0.85rem;
  }

  .article-meta-row {
    gap: 8px;
  }

  .major-tag-button {
    font-size: 0.7rem;
    padding: 4px 8px;
  }
}

/* ===== 光沢エフェクト（メタリック・鉄のような質感） ===== */
.article-card[data-shine="true"] {
  position: relative;
  overflow: hidden;
}

.article-card[data-shine="true"]::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -100%;
  width: 60%;
  height: 200%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(25deg);
  z-index: 10;
  pointer-events: none;
  animation: shine-loop 3s ease-in-out infinite;
}

@keyframes shine-loop {
  0% {
    left: -100%;
  }
  33% {
    left: 150%;
  }
  100% {
    left: 150%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-card[data-shine="true"]::before {
    animation: none;
    opacity: 0;
  }
}

/* ===== 作品グリッド（最大2列） ===== */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

@media (max-width: 900px) {
  .work-grid {
    grid-template-columns: 1fr;  /* モバイルは1列 */
    gap: 20px;
  }
}

/* ===== 作品カード（横長・縦並び） ===== */
.work-card {
  display: block;
  position: relative;
  text-decoration: none;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.1s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 8px 16px rgba(0,0,0,0.25), 0 4px 8px rgba(0,0,0,0.15);
  transform-style: preserve-3d;
  perspective: 1000px;
  border: 5px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%);
}

.work-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.3), 0 8px 16px rgba(0,0,0,0.2), 0 0 30px rgba(30,119,50,0.2);
  border-color: rgba(0, 191, 255, 0.7);
}

/* 作品カード画像（16:9固定） */
.work-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* グラデーションオーバーレイ（4隅指定可能） */
.work-card-overlay {
  position: absolute;
  padding: 24px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 右上・右下（右側配置） */
.work-card-overlay.top-right,
.work-card-overlay.bottom-right {
  right: 0;
  max-width: 45%;
  background: linear-gradient(
    to left,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.92) 15%,
    rgba(255, 255, 255, 0.88) 30%,
    rgba(255, 255, 255, 0.80) 45%,
    rgba(255, 255, 255, 0.65) 60%,
    rgba(255, 255, 255, 0.40) 75%,
    rgba(255, 255, 255, 0.15) 90%,
    rgba(255, 255, 255, 0) 100%
  );
}

/* 左上・左下（左側配置） */
.work-card-overlay.top-left,
.work-card-overlay.bottom-left {
  left: 0;
  max-width: 45%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.92) 15%,
    rgba(255, 255, 255, 0.88) 30%,
    rgba(255, 255, 255, 0.80) 45%,
    rgba(255, 255, 255, 0.65) 60%,
    rgba(255, 255, 255, 0.40) 75%,
    rgba(255, 255, 255, 0.15) 90%,
    rgba(255, 255, 255, 0) 100%
  );
}

/* 上下位置 */
.work-card-overlay.top-right,
.work-card-overlay.top-left {
  top: 0;
}

.work-card-overlay.bottom-right,
.work-card-overlay.bottom-left {
  bottom: 0;
}

/* 作品タイトル（MTG風の枠） */
.work-card-title {
  margin: 0 0 8px 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  /* MTG風の枠スタイル */
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  padding: 8px 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 作品タイトルのカスタムカラー対応 */
.work-card-title[data-color] {
  position: relative;
  background: color-mix(in srgb, var(--title-color) 50%, white) !important;
  color: #2b2b2b !important;
  border-color: color-mix(in srgb, var(--title-color) 70%, transparent) !important;
}

/* color-mix 非対応ブラウザ向けフォールバック */
@supports not (color-mix(in srgb, black 0%, white 0%)) {
  .work-card-title[data-color] {
    background: var(--title-color) !important;
    color: #2b2b2b !important;
    border-color: var(--title-color) !important;
    opacity: 0.8;
  }
}

/* 作品説明（タイトルなし想定で調整） */
.work-card-desc {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.6;
  font-weight: 600;
  text-shadow:
    0 0 4px white,
    0 0 4px white,
    0 0 4px white,
    0 0 6px white,
    0 0 6px white,
    0 0 8px white,
    0 0 10px white;
}

/* タイトルがある場合は上マージン */
.work-card-title + .work-card-desc {
  margin-top: 8px;
}

/* テキスト配置の調整 */
.work-card-overlay.top-right,
.work-card-overlay.bottom-right {
  text-align: right;
}

.work-card-overlay.top-left,
.work-card-overlay.bottom-left {
  text-align: left;
}

/* レスポンシブ（作品カード） */
@media (max-width: 600px) {
  /* aspect-ratioで自動調整されるのでheightは不要 */

  .work-card-overlay {
    max-width: 50% !important;
    padding: 16px;
  }

  .work-card-title {
    font-size: 0.9rem;
    padding: 5px 8px;
    margin-bottom: 4px;
  }

  .work-card-desc {
    font-size: 0.75rem;
    line-height: 1.4;
  }

  /* 記事カード（スマホ版の追加スタイル） */
  .article-card {
    width: 100%;
    min-height: 250px; /* 最小でも250pxは確保 */
  }

  .article-card-overlay {
    padding: 8px;
  }

  .article-card-title {
    font-size: 0.85rem;
    padding: 5px 8px;
  }

  .article-card-meta-wrapper {
    padding: 50px 3px 3px; /* 横幅最大化・下枠拡大 */
  }

  .article-card-meta {
    font-size: 0.68rem;
    line-height: 1.4;
    -webkit-line-clamp: 4; /* 2→3行 */
    padding: 4px 6px;
  }
}

/* ===== Steam風画像ギャラリー ===== */
.screenshot-gallery {
  margin: 24px 0;
}

/* メイン画像表示エリア */
.screenshot-main {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}

.screenshot-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* 前後ナビゲーションエリア */
.screenshot-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 25%;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: white;
  font-size: 3rem;
  font-weight: 100;
}

.screenshot-main:hover .screenshot-nav {
  opacity: 1;
}

.screenshot-nav.prev {
  left: 0;
  justify-content: flex-start;
  padding-left: 24px;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.5) 0%,
    rgba(0, 0, 0, 0.3) 70%,
    rgba(0, 0, 0, 0) 100%
  );
}

.screenshot-nav.next {
  right: 0;
  justify-content: flex-end;
  padding-right: 24px;
  background: linear-gradient(
    to left,
    rgba(0, 0, 0, 0.5) 0%,
    rgba(0, 0, 0, 0.3) 70%,
    rgba(0, 0, 0, 0) 100%
  );
}

/* サムネイル一覧 */
.screenshot-thumbnails {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 0;
}

.screenshot-thumb {
  flex: 0 0 auto;
  width: 150px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.screenshot-thumb:hover {
  transform: scale(1.05);
  border-color: var(--brand-weak);
}

.screenshot-thumb.active {
  border-color: var(--brand);
}

.screenshot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* スマホ対応 */
@media (max-width: 600px) {
  .screenshot-nav {
    font-size: 2rem;
  }

  .screenshot-nav.prev {
    padding-left: 12px;
  }

  .screenshot-nav.next {
    padding-right: 12px;
  }

  .screenshot-thumb {
    width: 100px;
  }
}

/* ピンク基調の見出し（必要なときだけ .is-rose を付与） */
.is-rose{
  border-left-color: color-mix(in srgb, var(--brand-weak) 60%, transparent);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--brand-weak) 46%, transparent) 0%,
    color-mix(in srgb, var(--brand-weak) 16%, transparent) 60%,
    transparent 100%
  );
}
@supports not (color-mix(in srgb, black 0%, white 0%)){
  .is-rose{
    border-left-color: rgba(244,217,208,.60);
    background: linear-gradient(90deg, rgba(244,217,208,.46) 0%, rgba(244,217,208,.16) 60%, rgba(244,217,208,0) 100%);
  }
}
/* 既定は隠す（PC想定） */
.menu-button { display: none; }

/* スマホ幅だけ表示 */
@media (max-width: 800px){
  .menu-button{
    display: inline-flex; /* 見た目の整え */
    align-items: center;
    gap: 6px;
  }
}
/* ヘッダー右側のグループ */
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* SNSアイコン */
.sns-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sns-icons a {
  display: block;
  line-height: 0;
}

.sns-icons img {
  height: 32px;
  width: auto;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sns-icons a:hover img {
  opacity: 0.7;
  transform: scale(1.1);
}

/* スマホ版でSNSアイコンを小さく */
@media (max-width: 600px) {
  .sns-icons img {
    height: 24px;
  }

  .header-right {
    gap: 12px;
  }

  .sns-icons {
    gap: 6px;
  }
}

/* ヘッダー右のハンバーガー */
.menu-button{
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--panel);
}
.menu-button:focus-visible{ outline:3px solid var(--brand-weak); outline-offset:2px; }
.bars{ display:inline-block; width:22px; height:14px; position:relative; }
.bars > span,
.bars::before,
.bars::after{
  content:""; position:absolute; left:0; right:0; height:2px; background:var(--ink);
}
.bars > span{ top:6px; }
.bars::before{ top:0; }
.bars::after{ bottom:0; }

/* ===== モバイル（<=800px）でサイドナビをオフキャンバス化 ===== */
@media (max-width:800px){
  aside.nav{
    position: fixed;
    top: var(--headerH,56px);
    left: 0;
    height: calc(100dvh - var(--headerH,56px));
    width: min(86vw, 320px);
    max-width: 92vw;
    z-index: 1200;
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow:auto;
  }
  /* 開いた状態 */
  body.menu-open aside.nav{ transform: translateX(0); }
  /* レイアウト本体は縦積みでOK（既存） */
  /* .layout { flex-direction: column; } は既にあるのでそのまま */
}

blockquote{
  margin: 1em 0;                 /* 中央寄りに見えるUAの左右インデントを撤去 */
  padding: .8em 1em;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--ink) 4%, var(--panel)); /* ごく薄い灰 */
  font-style: normal;            /* UAの斜体化をやめる（好み） */
}

/* 余計な上下マージンを詰めて見栄え安定 */
blockquote > :first-child{ margin-top: 0; }
blockquote > :last-child{  margin-bottom: 0; }

/* ネスト時は左帯だけで深さを示す（任意） */
blockquote blockquote{
  background: color-mix(in srgb, var(--ink) 2%, var(--panel));
  border-left-width: 4px;
}

/* 行内コード */
code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Noto Sans Mono", monospace;
  font-size: .95em;
  padding: .1em .3em;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 3%, var(--panel));
}

/* 複数行（pre>code） */
pre{
  margin: 1em 0;
  padding: .9em 1em;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--ink) 4%, var(--panel));
  overflow: auto;
}
pre code{ border: none; background: transparent; padding: 0; font-size: .95em; }

article { --minihead-gap: .1rem; }
/* 既存：テキスト直下に線（そのまま） */
article .minihead{
  display:inline-block;
  position:relative;
  padding-bottom: .5rem;
  font-weight:600;
  letter-spacing:.02em;
  color: #003d2e;
   --mini-overshoot: 40px;
  padding-inline-end: var(--mini-overshoot);

  /* 右端を越えないためのガード */
  max-inline-size: 100%;
  overflow: hidden;                    /* 端でスパッと切る */
}
/* 線はベタ色＋右端へ向かうマスク、幅で伸ばす */
article .minihead::after{
  content:"";
  position:absolute;
  left:0; bottom:2px;
  height:5px;

  /* 幅アニメ：最初は0、可視化で100%へ */
  inline-size: 0;
  transition: inline-size .5s ease;
  will-change: inline-size;

  /* 緑から透明へのグラデーション */
  background: linear-gradient(90deg, #00704A 0%, rgba(0, 112, 74, 0.3) 70%, rgba(0, 112, 74, 0) 100%);
}

/* 表示トリガ（既存の is-visible を使う） */
article .minihead.is-visible::after{ inline-size: 100%; }

/* 低評価用minihead（水色系） */
article .minihead--bad{
  color: #0a5563; /* 深い水色 */
}
article .minihead--bad::after{
  /* 水色から透明へのグラデーション */
  background: linear-gradient(90deg, #0891b2 0%, rgba(8, 145, 178, 0.3) 70%, rgba(8, 145, 178, 0) 100%);
}

/* 低評価2用minihead（灰色） */
article .minihead--bad2{
  color: #374151; /* 濃いグレー */
}
article .minihead--bad2::after{
  /* グレーから透明へのグラデーション */
  background: linear-gradient(90deg, #6b7280 0%, rgba(107, 114, 128, 0.3) 70%, rgba(107, 114, 128, 0) 100%);
}

@media (prefers-reduced-motion: reduce){
  article .minihead::after{ transition:none; inline-size:100%; }
}


/* 右端まで線を引くタイプ */
/* rule版はフレックスの“線”だけを幅アニメ＋マスク */
article .minihead--rule{
  display:flex;
  align-items:baseline;
  gap:.75rem;
}
article .minihead--rule::after{
  content:"";
  height:2px;
  background: var(--brand, #6b7cff);

  /* 幅アニメ */
  inline-size: 0;
  transition: inline-size .5s ease;
  will-change: inline-size;

  /* 右へ行くほど透ける */
  -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0,0,0,.85) 30%, rgba(0,0,0,0) 100%);
          mask-image: linear-gradient(90deg, #000 0%, rgba(0,0,0,.85) 10%, rgba(0,0,0,0) 90%);
}
article .minihead + :where(p,ul,ol,pre,blockquote){
  margin-block-start: var(--minihead-gap);  /* 既定1emを詰める */
}

article .minihead--rule.is-visible::after{ inline-size: 100%; }

@media (prefers-reduced-motion: reduce){
  article .minihead--rule::after{ transition:none; inline-size:100%; }
}
/* 中央寄せ：テキスト下だけ線 */
article .minihead.minihead--center{
  /* 中央寄せが効く形にする */
  display: block;                 /* ← inline-block をやめる */
  width: max-content;             /* あるいは width: fit-content; でも可 */
  margin-inline: auto;            /* ← これで中央へ */
  position: relative;             /* ::after のため */
  text-align: center;             /* 念押し（なくてもOK） */
   padding-inline-start: 70px;
   padding-inline-end: 70px;
}

/* 下線はそのまま（幅アニメ＋中央最濃マスク） */
article .minihead.minihead--center::after{
  content:"";
  position:absolute;
  left:0; bottom:0; height:2px;
  inline-size:0; transition:inline-size .5s ease; will-change:inline-size;
  background: var(--brand, #6b7cff);
  -webkit-mask-image: radial-gradient(120% 180% at 50% 50%,
      #000 0%, rgba(0,0,0,.1) 35%, rgba(0,0,0,.1) 2%, rgba(0,0,0,0) 10%);
          mask-image: radial-gradient(120% 180% at 50% 50%,
      #000 0%, rgba(0,0,0,.1) 35%, rgba(0,0,0,.1) 2%, rgba(0,0,0,0) 10%);
}
article .minihead.minihead--center.is-visible::after{ inline-size:100%; }

/* トップページロゴ */
.top-logo {
  display: block;
  margin: 0 auto 24px;
  max-width: 100%;
  height: auto;
}

/* スマホ版では小さいロゴを表示 */
@media (max-width: 800px) {
  .top-logo {
    content: url('/img/parts/logo_half.png');
  }
}

/* ヘッダーロゴ */
.header-logo {
  display: block;
  height: 40px;
  width: auto;
}

/* ===== 商品レビューページ ===== */
/* 商品画像コンテナ */
.product-images {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 0px 0;
  flex-wrap: wrap;
}

.product-images img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: block;
  object-fit: contain;
}

/* 1枚の場合: 最大幅を制限して中央寄せ */
.product-images img:only-child {
  max-width: 600px;
}

/* 2枚の場合: それぞれ均等に幅を取る */
.product-images img:first-child:nth-last-child(2),
.product-images img:first-child:nth-last-child(2) ~ img {
  flex: 1 1 0;
  max-width: calc(50% - 8px);
  min-width: 280px;
}

/* スマホ対応 */
@media (max-width: 600px) {
  .product-images {
    flex-direction: column;
    gap: 12px;
  }

  .product-images img:first-child:nth-last-child(2),
  .product-images img:first-child:nth-last-child(2) ~ img {
    max-width: 100%;
  }
}

/* 評価アイコンを見出しと横並びに */
.review-item h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-item h3 img.rating-icon {
  flex-shrink: 0;
  margin: 0;
}

.review-item {
  margin-bottom: 24px;
}

.review-text {
  margin-top: 8px;
  line-height: 1.8;
}

/* 高評価は緑色（デフォルトのまま） */
.review-item.good h3 {
  border-left: 5px solid color-mix(in srgb, var(--brand) 40%, transparent);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--brand) var(--hd3-left), transparent) 0%,
    color-mix(in srgb, var(--brand) var(--hd3-right), transparent) 70%,
    transparent 100%
  );
}

/* 高評価2も緑色 */
.review-item.good2 h3 {
  border-left: 5px solid color-mix(in srgb, var(--brand) 40%, transparent);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--brand) var(--hd3-left), transparent) 0%,
    color-mix(in srgb, var(--brand) var(--hd3-right), transparent) 70%,
    transparent 100%
  );
}

/* 低評価は青～水色 */
.review-item.bad h3 {
  --bad-color: #0891b2; /* シアン・水色系 */
  border-left: 5px solid color-mix(in srgb, var(--bad-color) 40%, transparent);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--bad-color) var(--hd3-left), transparent) 0%,
    color-mix(in srgb, var(--bad-color) var(--hd3-right), transparent) 70%,
    transparent 100%
  );
}

/* 低評価2も青色 */
.review-item.bad2 h3 {
  --bad-color: #0891b2; /* シアン・水色系 */
  border-left: 5px solid color-mix(in srgb, var(--bad-color) 40%, transparent);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--bad-color) var(--hd3-left), transparent) 0%,
    color-mix(in srgb, var(--bad-color) var(--hd3-right), transparent) 70%,
    transparent 100%
  );
}

/* 普通は灰色 */
.review-item.normal h3 {
  --normal-color: #6b7280; /* グレー */
  border-left: 5px solid color-mix(in srgb, var(--normal-color) 40%, transparent);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--normal-color) var(--hd3-left), transparent) 0%,
    color-mix(in srgb, var(--normal-color) var(--hd3-right), transparent) 70%,
    transparent 100%
  );
}

/* 激ヤバも灰色 */
.review-item.danger h3 {
  --danger-color: #6b7280; /* グレー */
  border-left: 5px solid color-mix(in srgb, var(--danger-color) 40%, transparent);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--danger-color) var(--hd3-left), transparent) 0%,
    color-mix(in srgb, var(--danger-color) var(--hd3-right), transparent) 70%,
    transparent 100%
  );
}

/* color-mix 非対応ブラウザ向けフォールバック */
@supports not (color-mix(in srgb, black 0%, white 0%)) {
  .review-item.good h3,
  .review-item.good2 h3 {
    background: linear-gradient(90deg, rgba(30,119,50,.15) 0%, rgba(30,119,50,.04) 70%, rgba(30,119,50,0) 100%);
    border-left: 5px solid rgba(30,119,50,.40);
  }
  .review-item.bad h3,
  .review-item.bad2 h3 {
    background: linear-gradient(90deg, rgba(8,145,178,.15) 0%, rgba(8,145,178,.04) 70%, rgba(8,145,178,0) 100%);
    border-left: 5px solid rgba(8,145,178,.40);
  }
  .review-item.normal h3,
  .review-item.danger h3 {
    background: linear-gradient(90deg, rgba(107,114,128,.15) 0%, rgba(107,114,128,.04) 70%, rgba(107,114,128,0) 100%);
    border-left: 5px solid rgba(107,114,128,.40);
  }
}

/* ========================================
   Wiki階層構造のスタイル
   ======================================== */
.wiki-tree {
  list-style: none;
  padding: 0;
  margin: 1em 0;
}

/* Wikiフラットリスト（親+子表示用） */
.wiki-list {
  list-style: none;
  padding: 0;
  margin: 1em 0;
}

.wiki-list .wiki-tree-item {
  margin: 0.75em 0;
}

.wiki-tree .wiki-tree {
  margin-left: 2em;
  padding-left: 1em;
  border-left: 2px solid var(--line);
  margin-top: 0.5em;
}

.wiki-tree-item {
  margin: 0.5em 0;
}

.wiki-link {
  display: block;
  position: relative;
  padding: 0.75em 1em;
  border-radius: 6px;
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: all 0.2s ease;
  overflow: hidden;
  min-height: 60px;
}

.wiki-link:hover {
  border-color: var(--brand);
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* サムネイル画像背景 */
.wiki-link-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 60%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1;
  /* 画像の左端を透明に */
  mask-image: linear-gradient(to right, transparent 0%, black 25%, black 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 25%, black 100%);
}

/* 左側グラデーションオーバーレイ（背景色の変化用） */
.wiki-link-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 2;
  pointer-events: none;
}

.wiki-link:hover .wiki-link-overlay {
  background: var(--brand-weak);
  opacity: 0.3;
}

/* テキストコンテンツ */
.wiki-link-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
}

.wiki-title {
  display: block;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--brand);
  margin-bottom: 0.25em;
}

.wiki-desc {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

/* パンくずリスト */
.breadcrumb {
  margin-bottom: 0em;
  padding: 0em 0;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  list-style: none;
  padding: 0;
  margin: 0;
  border: none;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  border: none;
  border-top: none;
  border-bottom: none;
}

.breadcrumb li:not(:last-child)::after {
  content: "›";
  margin-left: 0.5em;
  color: var(--muted);
  font-weight: bold;
}

.breadcrumb a {
  color: var(--brand);
  text-decoration: none;
}

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

.breadcrumb li[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

/* パンくずリストと編集ボタンのコンテナ */
.breadcrumb-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1em;
  margin-bottom: 1em;
  flex-wrap: wrap;
}

/* Wiki編集ボタン */
.wiki-edit-btn {
  display: inline-block;
  padding: 0.4em 1em;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.wiki-edit-btn:hover {
  background: #155a24;
  text-decoration: none;
}

/* Wiki メタ情報 */
.wiki-meta {
  margin-top: 0.5em;
  margin-bottom: 1.5em;
  font-size: 0.9rem;
  color: var(--muted);
}

/* 子ページリスト */
.wiki-children {
  margin-top: 3em;
  padding-top: 2em;
  border-top: 2px solid var(--line);
}

.wiki-children h2 {
  font-size: 1.3rem;
  margin-bottom: 1em;
  color: var(--text);
}

.wiki-children ul {
  list-style: none;
  padding: 0;
}

.wiki-children li {
  margin: 0.75em 0;
}

.wiki-child-link {
  display: block;
  position: relative;
  padding: 0.75em 1em;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: all 0.2s ease;
  text-decoration: none;
  overflow: hidden;
  min-height: 60px;
}

.wiki-child-link:hover {
  border-color: var(--brand);
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 子ページサムネイル背景 */
.wiki-child-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 60%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1;
  /* 画像の左端を透明に */
  mask-image: linear-gradient(to right, transparent 0%, black 25%, black 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 25%, black 100%);
}

/* 子ページグラデーションオーバーレイ（背景色の変化用） */
.wiki-child-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 2;
  pointer-events: none;
}

.wiki-child-link:hover .wiki-child-overlay {
  background: var(--brand-weak);
  opacity: 0.3;
}

/* 子ページテキストコンテンツ */
.wiki-child-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
}

.wiki-child-title {
  display: block;
  color: var(--brand);
  font-weight: 600;
  margin-bottom: 0.25em;
}

.wiki-child-desc {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ===========================
   Interactive Checklist Styles
   =========================== */

.interactive-checklist-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
  table-layout: fixed;
}

/* 列幅の設定 */
.interactive-checklist-table th.col-checkbox,
.interactive-checklist-table td.col-checkbox {
  width: 60px;
  text-align: center;
}

.interactive-checklist-table th.col-priority,
.interactive-checklist-table td.col-priority {
  width: 100px;
}

.interactive-checklist-table th.col-content,
.interactive-checklist-table td.col-content {
  width: 45%;
}

.interactive-checklist-table th.col-notes,
.interactive-checklist-table td.col-notes {
  width: 45%;
}

.interactive-checklist-table thead {
  background: linear-gradient(135deg, #00704A 0%, #0d9488 100%);
  color: white;
}

.interactive-checklist-table th {
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  border: 1px solid #555;
  font-size: 14px;
}

.interactive-checklist-table td {
  padding: 8px;
  border: 1px solid #ddd;
  transition: background-color 0.3s ease;
  vertical-align: middle;
}

.interactive-checklist-table tbody tr {
  transition: background-color 0.2s ease;
}

.interactive-checklist-table tbody tr:hover {
  background-color: #f8f9fa;
}

/* チェック済み行のスタイル（灰色表示） */
.checklist-row-checked {
  background-color: #f0f0f0 !important;
  color: #666;
}

.checklist-row-checked td {
  text-decoration: line-through;
  opacity: 0.7;
}

.checklist-row-checked:hover {
  background-color: #e8e8e8 !important;
}

/* 入力フィールドのスタイル */
.interactive-checklist-table input[type="text"],
.interactive-checklist-table textarea,
.interactive-checklist-table select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* textareaの特別なスタイル */
.interactive-checklist-table textarea.checklist-textarea {
  resize: vertical;
  overflow: hidden;
  min-height: 32px;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* 優先度のカラースタイル */
.interactive-checklist-table select.priority-select option[value="High"],
.interactive-checklist-table select.priority-select[value="High"] {
  background-color: #fee !important;
  color: #c00;
  font-weight: bold;
}

.interactive-checklist-table select.priority-select option[value="Med"],
.interactive-checklist-table select.priority-select[value="Med"] {
  background-color: #ffc !important;
  color: #860;
  font-weight: bold;
}

.interactive-checklist-table select.priority-select option[value="Low"],
.interactive-checklist-table select.priority-select[value="Low"] {
  background-color: #eff !important;
  color: #068;
  font-weight: bold;
}

.interactive-checklist-table input[type="text"]:focus,
.interactive-checklist-table textarea:focus,
.interactive-checklist-table select:focus {
  outline: none;
  border-color: #00704A;
  box-shadow: 0 0 0 3px rgba(0, 112, 74, 0.1);
}

.interactive-checklist-table input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #00704A;
}

/* 無効化状態 */
.interactive-checklist-table input:disabled,
.interactive-checklist-table textarea:disabled,
.interactive-checklist-table select:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  background-color: #f5f5f5;
}

.interactive-checklist-table input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* 編集無効メッセージ */
.checklist-edit-disabled {
  font-size: 13px;
  color: #dc3545;
  margin-top: 8px;
  padding: 8px 12px;
  background: #f8d7da;
  border-left: 4px solid #dc3545;
  border-radius: 4px;
  line-height: 1.5;
}

/* 行追加ボタン */
.checklist-add-row-btn {
  display: block;
  margin-top: 8px;
  padding: 6px 14px;
  font-size: 13px;
  color: #0d9488;
  background: transparent;
  border: 1px dashed #0d9488;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.checklist-add-row-btn:hover {
  background: #f0fdfa;
}

.checklist-add-row-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .interactive-checklist-table {
    font-size: 14px;
  }

  .interactive-checklist-table th,
  .interactive-checklist-table td {
    padding: 6px 4px;
  }

  /* モバイルでの列幅調整 */
  .interactive-checklist-table th.col-checkbox,
  .interactive-checklist-table td.col-checkbox {
    width: 50px;
  }

  .interactive-checklist-table th.col-priority,
  .interactive-checklist-table td.col-priority {
    width: 80px;
  }

  .interactive-checklist-table th {
    font-size: 13px;
  }

  .interactive-checklist-table input[type="text"],
  .interactive-checklist-table textarea,
  .interactive-checklist-table select {
    padding: 4px 6px;
    font-size: 13px;
  }

  .interactive-checklist-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 480px) {
  .interactive-checklist-table {
    font-size: 12px;
  }

  .interactive-checklist-table th,
  .interactive-checklist-table td {
    padding: 4px 2px;
  }

  .interactive-checklist-table th {
    font-size: 12px;
  }

  .interactive-checklist-table input[type="text"],
  .interactive-checklist-table textarea,
  .interactive-checklist-table select {
    padding: 3px 4px;
    font-size: 12px;
  }

  .interactive-checklist-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
  }

  .checklist-edit-disabled {
    font-size: 12px;
  }
}

/* ===== キャラクター会話（オモコロ風） ===== */
.character-dialogue {
  display: flex;
  gap: 16px;
  margin: 24px 0;
  align-items: flex-start;
}

/* キャラクター画像 */
.character-image {
  flex: 0 0 auto;
  width: 80px;
  height: 80px;
  overflow: hidden;
  background: var(--panel);
}

.character-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* テキスト部分の共通スタイル */
.dialogue-text {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  padding: 16px 20px;
  line-height: 1.8;
}

/* 1. 通常の文字のみ（背景なし） */
.dialogue-normal {
  background: none;
  padding: 8px 0;
  border: none;
}

/* 2. フキダシ（通常） */
.dialogue-bubble {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
}

.dialogue-bubble::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 20px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 10px 10px 0;
  border-color: transparent var(--line) transparent transparent;
}

.dialogue-bubble::after {
  content: '';
  position: absolute;
  left: -7px;
  top: 22px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 8px 8px 0;
  border-color: transparent #fff transparent transparent;
}

/* 3. フキダシ（思考） */
.dialogue-think {
  background: #f0f8ff;
  border: 2px dashed #99ccff;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
}

.dialogue-think::before {
  content: '';
  position: absolute;
  left: -31px;
  top: 10px;
  width: 8px;
  height: 8px;
  background: #f0f8ff;
  border: 2px dashed #99ccff;
  border-radius: 50%;
}

.dialogue-think::after {
  content: '';
  position: absolute;
  left: -20px;
  top: 0px;
  width: 15px;
  height: 15px;
  background: #f0f8ff;
  border: 2px dashed #99ccff;
  border-radius: 50%;
}

/* 4. フキダシ（叫ぶ） */
.dialogue-shout {
  background: #fff9e6;
  border: 3px solid #ff6b6b;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
  font-weight: 700;
  font-size: 1.1em;
  position: relative;
}

.dialogue-shout::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 20px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 12px 12px 12px 0;
  border-color: transparent #ff6b6b transparent transparent;
}

.dialogue-shout::after {
  content: '';
  position: absolute;
  left: -8px;
  top: 23px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 9px 9px 9px 0;
  border-color: transparent #fff9e6 transparent transparent;
}

/* ==========================================
   Posts Styling
   ========================================== */

/* --- Compact Style (Nav Sidebar) --- */
.posts-section {
  margin-top: 16px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.posts-heading {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand);
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.posts-list-compact {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-item-compact {
  padding: 8px;
  margin-bottom: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  border-left: 3px solid var(--brand-weak);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  transition: background 0.2s ease;
}

.post-item-compact:last-child {
  border-bottom: none;
}

.post-item-compact:hover {
  background: var(--brand-weak);
}

.post-date-compact {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.post-content-compact {
  display: block;
  color: var(--ink);
  /* 全文表示のため、省略表示は無効化 */
}

.post-empty,
.post-loading,
.post-error {
  display: block;
  padding: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  font-style: italic;
}

/* --- Detailed Style (About Me Page) --- */
.posts-detailed-section {
  margin-top: 24px;
}

.posts-list-detailed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-item-detailed {
  padding: 16px;
  border-left: 4px solid var(--brand);
  background: var(--bg);
  border-radius: 4px;
  transition: box-shadow 0.2s ease;
}

.post-item-detailed:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.post-date-detailed {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.post-content-detailed {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap; /* Preserve line breaks */
  word-wrap: break-word;
}

.post-empty-detailed,
.post-loading-detailed,
.post-error-detailed {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
  .character-dialogue {
    gap: 12px;
    margin: 16px 0;
  }

  .character-image {
    width: 60px;
    height: 60px;
  }

  .dialogue-text {
    padding: 12px 16px;
    font-size: 0.95em;
  }

  .dialogue-shout {
    font-size: 1em;
  }
}

/* ===============================================
   YouTube動画埋め込み
   =============================================== */

/* 基本スタイル */
.youtube-video-container {
  margin: 2px auto;
  text-align: center;
}

.youtube-video-wrapper {
  position: relative;
  width: 100%;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* アスペクト比（通常動画 16:9） */
.youtube-video-container.video-normal .youtube-video-wrapper {
  padding-bottom: 56.25%;
  max-width: 640px;
}

/* 通常動画100%の場合はmax-width制限を解除 */
.youtube-video-container.video-normal.video-size-100 .youtube-video-wrapper {
  max-width: none;
}

/* アスペクト比（Short動画 9:16） */
.youtube-video-container.video-short .youtube-video-wrapper {
  padding-bottom: 177.78%;
  max-width: 360px;
}

/* Short動画のサイズプリセット（コンテナに適用） */
.youtube-video-container.video-short.video-size-25 {
  max-width: 30%;
}

.youtube-video-container.video-short.video-size-35 {
  max-width: 45%;
}

.youtube-video-container.video-short.video-size-50 {
  max-width: 60%;
}

/* iframe 絶対配置 */
.youtube-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* 通常動画のサイズプリセット（コンテナに適用） */
.youtube-video-container.video-normal.video-size-50 {
  max-width: 50%;
}

.youtube-video-container.video-normal.video-size-70 {
  max-width: 70%;
}

.youtube-video-container.video-normal.video-size-100 {
  max-width: 100%;
}

/* 2列グリッドコンテナ */
.youtube-video-grid {
  display: flex;
  gap: 24px;
  margin: 2px auto;
  justify-content: center;
  align-items: flex-start;
}

/* 通常動画グリッドのサイズプリセット */
.youtube-video-grid.video-normal.video-size-50 {
  max-width: 50%;
}

.youtube-video-grid.video-normal.video-size-70 {
  max-width: 70%;
}

.youtube-video-grid.video-normal.video-size-100 {
  max-width: 100%;
}

/* Short動画グリッドのサイズプリセット */
.youtube-video-grid.video-short.video-size-25 {
  max-width: 60%;
}

.youtube-video-grid.video-short.video-size-35 {
  max-width: 80%;
}

.youtube-video-grid.video-short.video-size-50 {
  max-width: 100%;
}

.youtube-video-grid .youtube-grid-item {
  flex: 1;
  min-width: 0; /* flexboxのバグ対策 */
  margin: 0;
}

/* タブレット（767px以下） */
@media (max-width: 767px) {
  .youtube-video-grid {
    flex-direction: column;
    max-width: 90% !important;
  }

  /* グリッドアイテムを100%幅に */
  .youtube-video-grid .youtube-grid-item {
    flex: none;
    width: 100%;
  }

  /* 通常動画 */
  .youtube-video-container.video-normal.video-size-50,
  .youtube-video-container.video-normal.video-size-70 {
    max-width: 90%;
  }

  /* グリッド内のコンテナは幅100%に */
  .youtube-video-grid .youtube-video-container.video-normal {
    max-width: 100%;
  }

  /* Short動画 */
  .youtube-video-container.video-short.video-size-25,
  .youtube-video-container.video-short.video-size-35,
  .youtube-video-container.video-short.video-size-50 {
    max-width: 90%;
  }

  /* グリッド内のShort動画コンテナは幅100%、中央寄せ */
  .youtube-video-grid .youtube-video-container.video-short {
    max-width: 100%;
  }

  .youtube-video-container.video-short .youtube-video-wrapper {
    max-width: 280px;
    margin: 0 auto; /* 中央寄せ */
  }
}

/* スマホ（600px以下） */
@media (max-width: 600px) {
  .youtube-video-container {
    margin: 12px auto;
  }

  .youtube-video-grid {
    flex-direction: column;
    margin: 12px auto;
    gap: 12px;
    max-width: 100% !important;
  }

  /* グリッドアイテムを100%幅に */
  .youtube-video-grid .youtube-grid-item {
    flex: none;
    width: 100%;
  }

  /* 通常動画 */
  .youtube-video-container.video-normal.video-size-50,
  .youtube-video-container.video-normal.video-size-70,
  .youtube-video-container.video-normal.video-size-100 {
    max-width: 100%;
  }

  /* グリッド内のコンテナは幅100%に */
  .youtube-video-grid .youtube-video-container.video-normal {
    max-width: 100%;
  }

  /* Short動画 */
  .youtube-video-container.video-short.video-size-25,
  .youtube-video-container.video-short.video-size-35,
  .youtube-video-container.video-short.video-size-50 {
    max-width: 100%;
  }

  /* グリッド内のShort動画コンテナは幅100%、中央寄せ */
  .youtube-video-grid .youtube-video-container.video-short {
    max-width: 100%;
  }

  .youtube-video-container.video-short .youtube-video-wrapper {
    max-width: 100%;
  }
}

/* ===============================================
   ハズレページ専用スタイル
   =============================================== */

/* ハズレページの説明文 */
.hazure-description {
  margin: 16px 0 24px;
  font-size: 1rem;
  color: var(--muted);
  text-align: center;
}

/* バナー一覧コンテナ（3列グリッド） */
.hazure-banner-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-top: 24px;
}

/* ページネーションコンテナ */
#pagination-container {
  margin-top: 32px;
}

/* ハズレバナーカード */
.hazure-banner {
  display: block;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.1s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 8px 16px rgba(0,0,0,0.25), 0 4px 8px rgba(0,0,0,0.15);
  aspect-ratio: 16 / 9;
  border: 5px solid rgba(255, 255, 255, 0.1);
}

.hazure-banner:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.3), 0 8px 16px rgba(0,0,0,0.2);
  border-color: rgba(0, 191, 255, 0.7);
}

/* バナー背景画像 */
.hazure-banner-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  position: relative;
}

/* タイトルのフェードオーバーレイ（左上） */
.hazure-banner-title-overlay {
  position: absolute;
  top: 0;
  left: 0;
  padding: 10px 14px;
  background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.85) 50%, rgba(255, 255, 255, 0) 100%);
  border-radius: 0 0 20px 0;
  max-width: 65%;
}

/* タイトル */
.hazure-banner-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: bold;
  color: var(--ink);
  line-height: 1.3;
  text-shadow:
    0 0 4px white,
    0 0 4px white,
    0 0 4px white,
    0 0 6px white,
    0 0 6px white,
    0 0 8px white,
    0 0 10px white;
}

/* 説明文のフェードオーバーレイ（右下） */
.hazure-banner-description-overlay {
  position: absolute;
  bottom: 0;
  right: 0;
  padding: 8px 12px;
  background: linear-gradient(to left, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
  border-radius: 20px 0 0 0;
  max-width: 90%;
  text-align: right;
  font-weight: bold;
}

/* 説明文 */
.hazure-banner-description {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.4;
  text-shadow:
    0 0 4px white,
    0 0 4px white,
    0 0 4px white,
    0 0 6px white,
    0 0 6px white,
    0 0 8px white,
    0 0 10px white;
}

/* レスポンシブ対応（中画面: 3列） */
@media (max-width: 1400px) {
  .hazure-banner-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* レスポンシブ対応（タブレット: 2列） */
@media (max-width: 1100px) {
  .hazure-banner-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* レスポンシブ対応（スマホ: 1列） */
@media (max-width: 900px) {
  .hazure-banner-list {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hazure-banner-title {
    font-size: 0.95rem;
  }

  .hazure-banner-description {
    font-size: 0.75rem;
  }

  .hazure-banner-title-overlay {
    padding: 8px 12px;
    max-width: 70%;
  }

  .hazure-banner-description-overlay {
    padding: 6px 10px;
    max-width: 60%;
  }
}

/* ===================================
   ハズレページ無限スクロール
   =================================== */

/* センチネル要素（監視用） */
.hazure-scroll-sentinel {
  width: 100%;
  padding: 20px;
  text-align: center;
}

/* ローディングインジケーター */
.hazure-loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted, #888);
  font-size: 0.9rem;
  padding: 20px 0;
}

/* ローディングスピナー */
.hazure-loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border, #ddd);
  border-top-color: var(--accent, #6366f1);
  border-radius: 50%;
  animation: hazureSpinnerRotate 0.8s linear infinite;
}

@keyframes hazureSpinnerRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 終了メッセージ */
.hazure-end-message {
  color: var(--text-muted, #888);
  font-size: 0.85rem;
  padding: 30px 0;
  text-align: center;
  border-top: 1px solid var(--border, #eee);
  margin-top: 10px;
}

/* エラーメッセージ */
.hazure-error-message {
  text-align: center;
  padding: 20px;
  color: var(--danger, #dc3545);
}

.hazure-error-message p {
  margin: 0 0 12px 0;
}

.hazure-error-message button {
  background: var(--accent, #6366f1);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}

.hazure-error-message button:hover {
  background: var(--accent-hover, #4f46e5);
}

/* ===================================
   セクションヘッダー画像
   =================================== */

.section-header-image {
  text-align: center;
  margin: 2px 0 16px 0;
}

.section-header-image:first-child {
  margin-top: 0;
}

.section-header-image img {
  max-width: 100%;
  height: auto;
}

/* ===================================
   ハズレページフィードカード（本文表示）
   =================================== */

/* フィードコンテナ（1列レイアウト） */
.hazure-feed-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* フィードカード（cardクラスと併用） */
.hazure-feed-card.card {
  /* cardクラスのスタイルを継承、追加のパディングは不要 */
}

/* フィードヘッダー */
.hazure-feed-header {
  margin-bottom: 20px;
}

/* フィードタイトル（H1相当のサイズ） */
h1.hazure-feed-title {
  margin: 0 0 12px 0;
  font-size: 1.75rem;
  font-weight: bold;
  line-height: 1.3;
}

h1.hazure-feed-title a {
  color: var(--ink, #333);
  text-decoration: none;
  transition: color 0.2s ease;
}

h1.hazure-feed-title a:hover {
  color: var(--accent, #6366f1);
}

/* フィードメタ情報 */
.hazure-feed-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted, #888);
}

/* トラッシュタグ */
.hazure-feed-trash-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: white;
}

/* 日付 */
.hazure-feed-date {
  color: var(--text-muted, #888);
}

/* フィード本文 */
.hazure-feed-content {
  line-height: 1.8;
  color: var(--ink, #333);
}

/* 本文内の画像 */
.hazure-feed-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 12px 0;
}

/* 本文内のiframe（YouTube等） */
.hazure-feed-content iframe {
  max-width: 100%;
  border-radius: 8px;
  margin: 12px 0;
}

/* 本文内の見出し */
.hazure-feed-content h2,
.hazure-feed-content h3,
.hazure-feed-content h4 {
  margin-top: 20px;
  margin-bottom: 12px;
}

/* 本文内のリスト */
.hazure-feed-content ul,
.hazure-feed-content ol {
  margin: 12px 0;
  padding-left: 24px;
}

/* 本文内の引用 */
.hazure-feed-content blockquote {
  margin: 16px 0;
  padding: 12px 20px;
  border-left: 4px solid var(--accent, #6366f1);
  background: var(--bg-muted, #f8f8f8);
  border-radius: 0 8px 8px 0;
}

/* 本文内のコード */
.hazure-feed-content code {
  background: var(--bg-muted, #f0f0f0);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.hazure-feed-content pre {
  background: var(--bg-muted, #f0f0f0);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
}

.hazure-feed-content pre code {
  background: none;
  padding: 0;
}

/* レスポンシブ対応（スマホ） */
@media (max-width: 768px) {
  .section-header-image {
    margin: 24px 0 12px 0;
  }

  h1.hazure-feed-title {
    font-size: 1.3rem;
  }

  .hazure-feed-meta {
    flex-wrap: wrap;
    gap: 8px;
  }

  .hazure-feed-content {
    font-size: 0.95rem;
  }
}

/* ===================================
   記事詳細モーダル（3D回転アニメーション）
   =================================== */

.article-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  perspective: 2000px;
}

.article-modal.active {
  display: flex;
}

.article-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(80, 80, 80, 0);
  backdrop-filter: blur(8px);
  transition: background 0.6s ease;
}

.article-modal.active .article-modal-backdrop {
  background: rgba(60, 60, 60, 0.75);
}

/* フェードアウトアニメーション（閉じる時） */
.article-modal.closing .article-modal-backdrop {
  background: rgba(80, 80, 80, 0);
  transition: background 0.25s ease;
}

.article-modal.closing .article-modal-content {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.article-modal-content {
  position: relative;
  width: 90%;
  max-width: 1100px;
  height: 95vh;
  max-height: 95vh;
  background: transparent;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  z-index: 10000;
  perspective: 2000px;
}

/* カードフリッパー（3D回転コンテナ） */
.card-flipper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 400px;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-transition: -webkit-transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 表面（記事カード） */
.card-front {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-front .article-card {
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
}

/* モーダル内のカード画像は常に100%の高さを維持（スマホ版のメディアクエリをオーバーライド） */
.card-front .article-card-image {
  height: 100% !important;
}

.card-front .hazure-banner {
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
}

/* モーダル内のハズレページバナー画像も常に100%の高さを維持 */
.card-front .hazure-banner-image {
  height: 100% !important;
}

/* 裏面（記事詳細） */
.card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
}

/* 3D回転アニメーション */
.article-modal-content.animating {
  animation: cardMove 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-modal-content.animating .card-flipper {
  animation: cardRotate 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  animation-fill-mode: forwards;
}

/* カードの移動・拡大アニメーション */
@keyframes cardMove {
  0% {
    transform:
      translate(var(--card-translate-x), var(--card-translate-y))
      scale(var(--card-scale));
    opacity: 1;
  }
  100% {
    transform:
      translate(0, 0)
      scale(1);
    opacity: 1;
  }
}

/* カードの回転アニメーション */
@keyframes cardRotate {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(180deg);
  }
}

/* アニメーションなし（直リンクアクセス時） */
.article-modal-content.no-animation {
  animation: fadeIn 0.3s ease;
}

.article-modal-content.no-animation .card-flipper {
  transform: rotateY(180deg);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 閉じるボタン */
.article-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
  transition: all 0.3s ease;
  color: white;
}

.article-modal-close:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: var(--brand);
  transform: rotate(90deg);
}

.article-modal-close:active {
  transform: rotate(90deg) scale(0.9);
}

/* スクロールコンテナ */
.article-modal-scroll-container {
  width: 100%;
  max-height: 95vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 60px 40px 40px;
  background: var(--panel);
  scrollbar-width: thin;
  scrollbar-color: var(--brand) rgba(0, 0, 0, 0.1);
}

/* Webkit系ブラウザのスクロールバー */
.article-modal-scroll-container::-webkit-scrollbar {
  width: 8px;
}

.article-modal-scroll-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.article-modal-scroll-container::-webkit-scrollbar-thumb {
  background: var(--brand);
  border-radius: 4px;
}

.article-modal-scroll-container::-webkit-scrollbar-thumb:hover {
  background: var(--brand-hover);
}

/* モーダル内の記事詳細 */
.article-modal-detail {
  width: 100%;
}

.article-modal-detail .card {
  background: var(--panel);
  box-shadow: none;
  margin: 0;
  padding: 2rem;
  border-radius: 8px;
}

.article-modal-detail h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.article-modal-detail .article-meta {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.article-modal-detail .article-tags {
  margin-bottom: 2rem;
}

.article-modal-detail .article-content {
  font-size: 1rem;
  line-height: 1.8;
}

/* ========================================
   TinyMCEテーブルスタイル（共通）
   ======================================== */
/* 記事、Wiki、ハズレページ、作品ページのコンテンツ内テーブル */
/* .cardクラス内のテーブル（記事モーダルなど）と各コンテンツ領域 */
.card table:not(.interactive-checklist-table),
.article-content table:not(.interactive-checklist-table),
.wiki-content table:not(.interactive-checklist-table),
.hazure-content table:not(.interactive-checklist-table),
.work-content table:not(.interactive-checklist-table),
.article-modal-detail table:not(.interactive-checklist-table) {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  border: 1px solid #ddd;
}

.card table:not(.interactive-checklist-table) th,
.article-content table:not(.interactive-checklist-table) th,
.wiki-content table:not(.interactive-checklist-table) th,
.hazure-content table:not(.interactive-checklist-table) th,
.work-content table:not(.interactive-checklist-table) th,
.article-modal-detail table:not(.interactive-checklist-table) th {
  background-color: #f5f5f5;
  font-weight: bold;
  padding: 12px 16px;
  border: 1px solid #ddd;
  text-align: left;
}

.card table:not(.interactive-checklist-table) td,
.article-content table:not(.interactive-checklist-table) td,
.wiki-content table:not(.interactive-checklist-table) td,
.hazure-content table:not(.interactive-checklist-table) td,
.work-content table:not(.interactive-checklist-table) td,
.article-modal-detail table:not(.interactive-checklist-table) td {
  padding: 10px 16px;
  border: 1px solid #ddd;
  vertical-align: top;
}

.card table:not(.interactive-checklist-table) tbody tr:nth-child(even),
.article-content table:not(.interactive-checklist-table) tbody tr:nth-child(even),
.wiki-content table:not(.interactive-checklist-table) tbody tr:nth-child(even),
.hazure-content table:not(.interactive-checklist-table) tbody tr:nth-child(even),
.work-content table:not(.interactive-checklist-table) tbody tr:nth-child(even),
.article-modal-detail table:not(.interactive-checklist-table) tbody tr:nth-child(even) {
  background-color: #fafafa;
}

.card table:not(.interactive-checklist-table) tbody tr:hover,
.article-content table:not(.interactive-checklist-table) tbody tr:hover,
.wiki-content table:not(.interactive-checklist-table) tbody tr:hover,
.hazure-content table:not(.interactive-checklist-table) tbody tr:hover,
.work-content table:not(.interactive-checklist-table) tbody tr:hover,
.article-modal-detail table:not(.interactive-checklist-table) tbody tr:hover {
  background-color: #f0f0f0;
}

/* テーブルのレスポンシブ対応 */
@media (max-width: 768px) {
  .card table:not(.interactive-checklist-table),
  .article-content table:not(.interactive-checklist-table),
  .wiki-content table:not(.interactive-checklist-table),
  .hazure-content table:not(.interactive-checklist-table),
  .work-content table:not(.interactive-checklist-table),
  .article-modal-detail table:not(.interactive-checklist-table) {
    font-size: 0.85rem;
  }

  .card table:not(.interactive-checklist-table) th,
  .article-content table:not(.interactive-checklist-table) th,
  .wiki-content table:not(.interactive-checklist-table) th,
  .hazure-content table:not(.interactive-checklist-table) th,
  .work-content table:not(.interactive-checklist-table) th,
  .article-modal-detail table:not(.interactive-checklist-table) th,
  .card table:not(.interactive-checklist-table) td,
  .article-content table:not(.interactive-checklist-table) td,
  .wiki-content table:not(.interactive-checklist-table) td,
  .hazure-content table:not(.interactive-checklist-table) td,
  .work-content table:not(.interactive-checklist-table) td,
  .article-modal-detail table:not(.interactive-checklist-table) td {
    padding: 8px 10px;
  }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .article-modal-content {
    width: 95%;
    max-width: none;
    max-height: 95vh;
    border-radius: 8px;
  }

  .article-modal-scroll-container {
    padding: 60px 20px 30px;
    max-height: 95vh;
  }

  .article-modal-close {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }

  .article-modal-detail h1 {
    font-size: 1.5rem;
  }

  /* スマホではアニメーションを簡略化 */
  .article-modal-content.animating .card-flipper {
    animation: cardRotateMobile 0.5s ease-out;
    animation-fill-mode: forwards;
  }

  @keyframes cardRotateMobile {
    0% {
      transform: rotateY(0deg);
    }
    100% {
      transform: rotateY(180deg);
    }
  }
}

@media (max-width: 480px) {
  .article-modal-scroll-container {
    padding: 50px 16px 24px;
  }

  .article-modal-detail h1 {
    font-size: 1.3rem;
  }

  .article-modal-detail .article-content {
    font-size: 0.95rem;
  }
}


/* ========================================
   トラッシュタグスタイル（ハズレページ用）
   ======================================== */

/* バナー右上のトラッシュタグ */
.hazure-trash-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 12px;
  color: #000;
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  text-shadow:
    0 0 4px #fff,
    0 0 4px #fff,
    0 0 4px #fff,
    0 0 6px #fff,
    0 0 6px #fff,
    0 0 8px #fff,
    0 0 10px #fff;
  z-index: 2;
}

/* 詳細ページのトラッシュタグボタン */
.trash-tag-btn {
  display: inline-block;
  padding: 6px 16px;
  color: #000;
  font-size: 0.875rem;
  font-weight: bold;
  border-radius: 4px;
  text-decoration: none;
  margin-left: auto;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  text-shadow:
    -1px -1px 0 #fff,
     1px -1px 0 #fff,
    -1px  1px 0 #fff,
     1px  1px 0 #fff;
  transition: transform 0.2s, box-shadow 0.2s;
}

.trash-tag-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* ===================================
   Search Page Styles
   =================================== */

/* 検索フォーム */
.search-form {
  margin-bottom: 2rem;
}

.search-input-wrapper {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: #007bff;
}

.search-button {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: bold;
  background-color: #2e6e1d;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.search-button:hover {
  background-color: #1e4e0d;
}

.search-button:active {
  transform: scale(0.98);
}

/* 検索フィルター */
.search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.filter-label {
  font-weight: bold;
  margin-right: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.checkbox-label:hover span {
  color: #007bff;
}

/* 検索結果ヘッダー */
.search-results-header {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #ddd;
}

.search-results-header p {
  font-size: 1.1rem;
  color: #333;
}

.result-count {
  font-weight: bold;
  color: #007bff;
}

/* 検索結果リスト */
.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* 検索結果アイテム */
.search-result-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.search-result-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* サムネイル */
.search-result-thumbnail {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  overflow: hidden;
  border-radius: 8px;
  background-color: #f5f5f5;
}

.search-result-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.search-result-thumbnail:hover img {
  transform: scale(1.05);
}

/* 検索結果コンテンツ */
.search-result-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.search-result-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* コンテンツタイプバッジ */
.content-type-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: bold;
  border-radius: 4px;
  color: white;
  white-space: nowrap;
}

.badge-article {
  background-color: #007bff;
}

.badge-hazure {
  background-color: #dc3545;
}

.badge-work {
  background-color: #28a745;
}

.badge-wiki {
  background-color: #ffc107;
  color: #333;
}

.badge-default {
  background-color: #6c757d;
}

/* 検索結果タイトル */
.search-result-title {
  font-size: 1.25rem;
  font-weight: bold;
  color: #333;
  text-decoration: none;
  transition: color 0.2s;
}

.search-result-title:hover {
  color: #007bff;
  text-decoration: underline;
}

/* マッチテキスト */
.search-result-match {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ハイライト */
.search-highlight {
  background-color: #ffeb3b;
  padding: 0.1rem 0.2rem;
  font-weight: bold;
  border-radius: 2px;
}

/* タグ表示 */
.search-result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tag-badge,
.major-tag-badge,
.trash-tag-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 4px;
  white-space: nowrap;
}

.tag-badge {
  background-color: #e9ecef;
  color: #495057;
}

.major-tag-badge,
.trash-tag-badge {
  color: #000;
  font-weight: bold;
  text-shadow:
    -1px -1px 0 #fff,
     1px -1px 0 #fff,
    -1px  1px 0 #fff,
     1px  1px 0 #fff;
}

/* メッセージ表示 */
.search-hint,
.search-loading,
.search-error {
  padding: 2rem;
  text-align: center;
  font-size: 1.1rem;
  color: #666;
}

.search-loading {
  color: #007bff;
}

.search-error {
  color: #dc3545;
}

.search-no-results {
  padding: 2rem;
  text-align: center;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.search-no-results p {
  margin: 0.5rem 0;
  font-size: 1.1rem;
  color: #666;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .search-result-item {
    flex-direction: column;
    gap: 1rem;
  }

  .search-result-thumbnail {
    width: 100%;
    height: 200px;
  }

  .search-input-wrapper {
    flex-direction: column;
  }

  .search-button {
    width: 100%;
  }
}

/* ========================================
   タグクラウド
   ======================================== */

.tag-cloud-section {
  margin-top: 16px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tag-cloud-heading {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand);
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* タグクラウドコンテナ - Masonry Layout（レンガ積み） */
.tag-cloud-container {
  column-count: auto;
  column-width: 180px;
  column-gap: 12px;
  line-height: 1.8;
}

/* タグクラウドアイテム */
.tag-cloud-item {
  display: inline-block;
  width: 100%;
  padding: 4px 12px;
  margin-bottom: 8px;
  background: var(--secondary);
  color: var(--ink);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-weight: 500;
  word-wrap: break-word;
  overflow-wrap: break-word;
  break-inside: avoid;
  box-sizing: border-box;
  text-align: center;
}

/* btn2クラスがある場合（通常タグ）はパディングを減らして文字をギリギリまで詰める */
.tag-cloud-item.btn2 {
  padding: 0.3em 0.5em;
}

.tag-cloud-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

/* タグが背景色を持つ場合のスタイルはJavaScriptでインライン指定 */

/* 読み込み中・エラー表示 */
.tag-loading,
.no-tags {
  padding: 12px;
  text-align: center;
  color: var(--muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
  /* スマホ版ではカラムレイアウトを無効化してflexboxで敷き詰め */
  .tag-cloud-container {
    column-count: unset;
    column-width: unset;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
  }

  .tag-cloud-item {
    width: auto; /* 文字の長さに合わせる */
    padding: 6px 12px;
    margin-bottom: 0; /* flexboxのgapを使用 */
    font-size: 0.9rem !important; /* フォントサイズを固定 */
  }

  .tag-cloud-item.btn2 {
    padding: 6px 12px; /* 通常タグも同じパディング */
  }
}

/* ========================================
   イメージログ（ImageLog）
   ======================================== */

/* イメージログ一覧グリッド */
.imagelog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

/* イメージログカード */
.imagelog-card {
  display: flex;
  flex-direction: column;
  background: transparent;  /* 背景を透明に */
  border-radius: 8px;
  overflow: visible;  /* 手札がはみ出せるように */
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  min-height: 240px;  /* 最小高さを設定 */
}

.imagelog-card:hover {
  transform: scale(1.02);
  text-decoration: none;
}

/* 手札風サムネイル表示エリア */
.imagelog-card-thumbnails {
  width: 100%;
  height: 240px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 1枚だけの場合は通常表示 */
.imagelog-card-thumbnails.single {
  height: 240px;
  padding: 0;
}

.imagelog-card-thumbnails.single .imagelog-thumbnail {
  position: absolute;
  width: 200px;
  height: 200px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* 個別のサムネイル画像 */
.imagelog-thumbnail {
  position: absolute;
  width: 180px;
  height: 180px;
  background-size: cover;
  background-position: center;
  background-color: var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, z-index 0s;
}

/* カードゲームの手札風に配置（3枚重ね） */
.imagelog-thumbnail.card-1 {
  transform: rotate(-8deg) translateX(-30px);
  z-index: 1;
}

.imagelog-thumbnail.card-2 {
  transform: rotate(0deg) translateX(0);
  z-index: 2;
}

.imagelog-thumbnail.card-3 {
  transform: rotate(8deg) translateX(30px);
  z-index: 3;
}

/* ホバー時に手札を広げる */
.imagelog-card:hover .imagelog-thumbnail.card-1 {
  transform: rotate(-12deg) translateX(-60px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.imagelog-card:hover .imagelog-thumbnail.card-2 {
  transform: rotate(0deg) translateX(0) scale(1.08);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.imagelog-card:hover .imagelog-thumbnail.card-3 {
  transform: rotate(12deg) translateX(60px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* ホバー時にタイトルと画像枚数を少し拡大 */
.imagelog-card:hover .imagelog-card-title {
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.imagelog-card:hover .imagelog-card-meta {
  transform: scale(1.05);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.25),
    0 0 0 2px white;
}

/* プレースホルダー（画像なし） */
.imagelog-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

/* カード情報（手札画像の下に配置） */
.imagelog-card-info {
  position: absolute;
  bottom: -20px;  /* さらに下に配置 */
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;  /* クリックを透過して手札をクリック可能に */
}

/* タイトル：中央寄せ、半透明背景、黒文字+白アウトライン */
.imagelog-card-title {
  position: relative;  /* 画像枚数の位置基準 */
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  padding: 10px 24px;
  color: var(--ink);
  background: rgba(100, 200, 120, 0.62);  /* ユーザー設定の緑系背景 */
  border: none;  /* 枠なし */
  border-radius: 24px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  white-space: nowrap;
  overflow: visible;  /* 画像枚数が見えるように変更 */
  max-width: 75%;
  text-shadow:
    -1px -1px 0 white,
    1px -1px 0 white,
    -1px 1px 0 white,
    1px 1px 0 white,
    -2px 0 0 white,
    2px 0 0 white,
    0 -2px 0 white,
    0 2px 0 white;  /* 白アウトライン */
}

/* タイトルが長すぎる場合は文字サイズを小さく */
.imagelog-card-title.long-title {
  font-size: 1rem;
}

.imagelog-card-title.very-long-title {
  font-size: 0.9rem;
  max-width: 70%;
}

/* 画像枚数（○○枚）：タイトル枠の右上に被せる（通知バッジ風） */
.imagelog-card-meta {
  position: absolute;
  top: -8px;  /* タイトル枠の上にはみ出す */
  right: -24px;  /* タイトル枠の右にはみ出す */
  font-size: 0.9rem;
  font-weight: 700;
  color: white;
  padding: 6px 10px;
  background: rgba(0, 100, 0, 0.7);  /* ユーザー設定の濃い緑 */
  border-radius: 16px;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.2),
    0 0 0 2px white;  /* 白アウトライン */
  line-height: 1;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  pointer-events: auto;  /* クリック可能に */
  text-shadow: none;  /* タイトルの白アウトラインを無効化 */
}

.imagelog-card-description {
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.5;
  margin: 10px auto 0;  /* マージンを減らして説明文を近づける */
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 12px;
  max-width: 80%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* イメージログ詳細ページ */
.imagelog-description {
  margin: 16px 0 24px 0;
  line-height: 1.6;
  color: var(--ink);
}

/* ソート切り替えボタン */
.imagelog-sort-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.sort-btn {
  padding: 8px 16px;
  background: var(--secondary);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sort-btn:hover {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.sort-btn.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

/* イメージギャラリー - 新しい3列グリッドレイアウト */
.imagelog-gallery-new {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
  max-width: 100%;  /* コンテンツ領域いっぱいに表示 */
  margin-left: auto;
  margin-right: auto;
  padding: 0 20px;  /* 左右に少し余白 */
}

/* 行コンテナ */
.imagelog-row {
  display: grid;
  gap: 16px;
  width: 100%;
}

/* パターン1: 横長1 + 正方形1 */
.imagelog-row-wide-square,
.imagelog-row-square-wide {
  grid-template-columns: 2fr 1fr;
}

/* パターン2: 横長2 */
.imagelog-row-wide-wide {
  grid-template-columns: 1fr 1fr;
}

/* パターン3: 正方形3 */
.imagelog-row-square-square-square {
  grid-template-columns: 1fr 1fr 1fr;
}

/* パターン4,5: 縦長1 + 横長2 */
.imagelog-row-tall-wide-wide-left,
.imagelog-row-tall-wide-wide-right {
  grid-template-columns: 1fr 2fr;
  grid-template-rows: 1fr 1fr;
}

.imagelog-row-tall-wide-wide-left .item-tall {
  grid-row: 1 / 3;
  grid-column: 1;
}

.imagelog-row-tall-wide-wide-right .item-tall {
  grid-row: 1 / 3;
  grid-column: 2;
}

.imagelog-row-tall-wide-wide-left .item-wide-small:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}

.imagelog-row-tall-wide-wide-left .item-wide-small:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

.imagelog-row-tall-wide-wide-right .item-wide-small:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.imagelog-row-tall-wide-wide-right .item-wide-small:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

/* 画像アイテム */
.imagelog-item {
  cursor: pointer;
  overflow: visible;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  line-height: 0;
  position: relative;
  background: transparent;
  z-index: 1;  /* デフォルトで z-index を設定 */
}

.imagelog-item:hover {
  transform: scale(1.02);
  z-index: 100;  /* ホバー時に最前面に */
}

.imagelog-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  box-shadow: 0 8px 10px rgba(0, 0, 0, 0.7);  /* シャドウを画像自体に適用 */
  transition: box-shadow 0.2s ease;
}

.imagelog-item:hover img {
  box-shadow: 0 9px 40px rgba(0, 100, 50, 1.0);  /* ホバー時のシャドウも画像に */
}

/* 横長画像は横幅に合わせて表示 */
.imagelog-item.item-wide img {
  max-height: 500px;
}

/* 正方形画像 */
.imagelog-item.item-square img {
  aspect-ratio: 1;
  max-height: 500px;
}

/* 縦長画像は縦幅に合わせて表示 */
.imagelog-item.item-tall img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  max-height: 600px;
}

/* 縦パターンの横長画像（小さめ）をもう少し横長風に */
.imagelog-item.item-wide-small img {
  max-height: 280px;
  object-fit: cover;
}

/* キャプション：メモ風デザイン */
.imagelog-caption-memo {
  position: absolute;
  background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
  padding: 10px 14px;
  border-radius: 2px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.1),
    0 4px 8px rgba(0, 0, 0, 0.15);
  font-size: 0.8rem;
  color: #374151;
  max-width: 180px;
  line-height: 1.4;
  font-family: 'Comic Sans MS', cursive, sans-serif;
  word-wrap: break-word;
  z-index: 1000;  /* メモを常に最前面に表示 */
  pointer-events: none;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

/* メモ位置の4パターン */
.imagelog-caption-memo.memo-top-left {
  top: 8px;
  left: 8px;
}

.imagelog-caption-memo.memo-top-right {
  top: 8px;
  right: 8px;
}

.imagelog-caption-memo.memo-bottom-left {
  bottom: 8px;
  left: 8px;
}

.imagelog-caption-memo.memo-bottom-right {
  bottom: 8px;
  right: 8px;
}

/* Lightbox Modal */
.imagelog-lightbox {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-info {
  margin-top: 16px;
  text-align: center;
  color: white;
}

.lightbox-info p {
  margin: 4px 0;
  font-size: 0.9rem;
}

#lightbox-caption {
  font-weight: 600;
}

#lightbox-date {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

/* Lightbox 閉じるボタン */
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 40px;
  font-size: 40px;
  font-weight: bold;
  color: white;
  cursor: pointer;
  transition: opacity 0.2s ease;
  z-index: 10001;
}

.lightbox-close:hover {
  opacity: 0.7;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  /* 一覧ページ */
  .imagelog-grid {
    grid-template-columns: 1fr;  /* スマホでは1カラム */
    gap: 20px;
  }

  .imagelog-card {
    min-height: 200px;
  }

  .imagelog-card-thumbnails,
  .imagelog-card-thumbnails.single {
    height: 180px;
  }

  .imagelog-thumbnail {
    width: 130px;
    height: 130px;
  }

  .imagelog-card-thumbnails.single .imagelog-thumbnail {
    width: 150px;
    height: 150px;
  }

  .imagelog-thumbnail.card-1 {
    transform: rotate(-8deg) translateX(-20px);
  }

  .imagelog-thumbnail.card-3 {
    transform: rotate(8deg) translateX(20px);
  }

  .imagelog-card:hover .imagelog-thumbnail.card-1 {
    transform: rotate(-10deg) translateX(-30px);
  }

  .imagelog-card:hover .imagelog-thumbnail.card-2 {
    transform: rotate(0deg) translateX(0) scale(1.05);
  }

  .imagelog-card:hover .imagelog-thumbnail.card-3 {
    transform: rotate(10deg) translateX(30px);
  }

  .imagelog-card-info {
    bottom: -25px;  /* スマホではさらに下に */
  }

  .imagelog-card-title {
    font-size: 1rem;
    padding: 8px 18px;
    max-width: 75%;
    text-shadow:
      -1px -1px 0 white,
      1px -1px 0 white,
      -1px 1px 0 white,
      1px 1px 0 white;  /* スマホでは薄めの白アウトライン */
  }

  .imagelog-card-title.long-title {
    font-size: 0.9rem;
    max-width: 70%;
  }

  .imagelog-card-title.very-long-title {
    font-size: 0.8rem;
    max-width: 65%;
  }

  .imagelog-card-description {
    font-size: 0.75rem;
    padding: 6px 12px;
    max-width: 85%;
    margin-top: 8px;  /* マージンを減らす */
  }

  .imagelog-card-meta {
    font-size: 0.85rem;
    padding: 5px 9px;
    top: -6px;
    right: -26px;
  }

  /* 詳細ページ：スマホ版は1列表示 */
  .imagelog-gallery-new {
    gap: 12px;
  }

  /* スマホ版：すべての行を1列に */
  .imagelog-row {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
  }

  /* スマホ版：すべての画像アイテムを1列で表示 */
  .imagelog-item {
    width: 100%;
    height: auto;
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  .imagelog-item img {
    width: 100%;
    height: auto !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    object-fit: contain;
  }

  /* キャプションメモ：小さい画面では少し控えめに */
  .imagelog-caption-memo {
    font-size: 0.7rem;
    padding: 6px 10px;
    max-width: 140px;
  }

  /* スマホ版：メモ位置の4パターン */
  .imagelog-caption-memo.memo-top-left {
    top: 3px;
    left: 3px;
  }

  .imagelog-caption-memo.memo-top-right {
    top: 3px;
    right: 3px;
  }

  .imagelog-caption-memo.memo-bottom-left {
    bottom: 3px;
    left: 3px;
  }

  .imagelog-caption-memo.memo-bottom-right {
    bottom: 3px;
    right: 3px;
  }

  .lightbox-close {
    top: 10px;
    right: 20px;
    font-size: 30px;
  }
}

/* タブレット版（769px - 1024px）：2列グリッドレイアウト */
@media (min-width: 769px) and (max-width: 1024px) {
  .imagelog-gallery-new {
    max-width: 900px;
  }

  .imagelog-row-wide-square,
  .imagelog-row-square-wide {
    grid-template-columns: 1.5fr 1fr;
  }

  .imagelog-row-square-square-square {
    grid-template-columns: 1fr 1fr;
  }

  .imagelog-row-tall-wide-wide-left,
  .imagelog-row-tall-wide-wide-right {
    grid-template-columns: 1fr 1.5fr;
  }
}

/* ========================================
   Twitch配信プレイヤー
   ======================================== */

/* Twitch配信コンテナ */
#twitch-stream-container {
  margin-bottom: 2rem;
}

/* Twitch配信ラッパー */
.twitch-stream-wrapper {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}

.twitch-stream-wrapper:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* 配信ヘッダー */
.twitch-stream-header {
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #6441a5 0%, #9147ff 100%);
  color: white;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* LIVEバッジ */
.live-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.85rem;
}

.live-indicator {
  width: 10px;
  height: 10px;
  background: #ff4444;
  border-radius: 50%;
  animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

.live-text {
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* 配信タイトル */
.stream-title {
  flex: 1;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
  line-height: 1.4;
}

/* 視聴者数 */
.viewer-count {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  padding: 0.3rem 0.8rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

/* プレイヤーコンテナ（16:9アスペクト比） */
.twitch-player-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 ratio */
  background: #000;
}

.twitch-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ゲーム名 */
.stream-game {
  padding: 0.8rem 1.5rem;
  background: var(--card-bg, #f8f9fa);
  color: var(--text-color, #333);
  font-size: 0.9rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .twitch-stream-header {
    padding: 0.8rem 1rem;
    gap: 0.8rem;
  }

  .stream-title {
    font-size: 1rem;
    width: 100%;
  }

  .viewer-count {
    font-size: 0.85rem;
  }

  .live-badge {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }

  .stream-game {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
}

/* =============================================
   折りたたみ（Collapsible）
   ============================================= */
.collapsible {
  margin: 1em 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  overflow: hidden;
}

.collapsible-toggle {
  display: block;
  padding: 0.8em 1em;
  background: linear-gradient(135deg, #f8f6f3 0%, #f0ece6 100%);
  border-bottom: 1px solid var(--line);
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease;
  user-select: none;
}

.collapsible-toggle:hover {
  background: linear-gradient(135deg, #f0ece6 0%, #e8e4dc 100%);
  text-decoration: none;
}

.collapsible-toggle::before {
  content: "\25B6";
  display: inline-block;
  margin-right: 0.5em;
  font-size: 0.8em;
  transition: transform 0.2s ease;
}

.collapsible.is-open .collapsible-toggle::before {
  transform: rotate(90deg);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 1em;
}

.collapsible.is-open .collapsible-content {
  max-height: 5000px;
  padding: 1em;
}

/* 折りたたみ内のテキスト */
.collapsible-content p:first-child {
  margin-top: 0;
}

.collapsible-content p:last-child {
  margin-bottom: 0;
}

/* レスポンシブ */
@media (max-width: 768px) {
  .collapsible-toggle {
    padding: 0.6em 0.8em;
    font-size: 0.95rem;
  }

  .collapsible.is-open .collapsible-content {
    padding: 0.8em;
  }
}

/* ===========================
   食品レビュー
   =========================== */

/* 検索エリア */
.food-review-search-area {
  margin-bottom: 16px;
}

.food-review-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.food-review-search-box input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  min-width: 0;
}

.food-review-search-box input:focus {
  outline: 2px solid var(--accent, #888);
  outline-offset: 1px;
}

.food-review-search-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted, #888);
  font-size: 1.1rem;
  padding: 4px 8px;
  line-height: 1;
  flex-shrink: 0;
}

.food-review-search-clear:hover {
  color: var(--text);
}

/* 食品ジャンルタグ クイックフィルター */
.food-review-genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.food-genre-tag-btn {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: none;
  border-radius: 12px;
  font-size: 0.78rem;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
  line-height: 1.4;
}

.food-genre-tag-btn:hover {
  opacity: 0.8;
}

/* アクティブ星フィルター ラベル表示（スマホのみ） */
.food-star-active-labels {
  display: none;
}

/* 星フィルターボタン群 */
.food-review-star-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.food-star-filter-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 5px 7px;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.15s, border-color 0.15s;
}

.food-star-filter-btn:hover {
  opacity: 0.75;
}

.food-star-filter-btn.active {
  opacity: 1;
  border-color: var(--accent, #888);
}

.food-star-filter-btn img {
  width: 28px;
  height: 28px;
  display: block;
}

.food-star-filter-btn span {
  font-size: 0.65rem;
  color: var(--text);
  white-space: nowrap;
}

/* クリッカブルタグ（モーダル内） */
.food-review-tag--clickable {
  cursor: pointer;
  transition: opacity 0.15s;
}

.food-review-tag--clickable:hover {
  opacity: 0.75;
}

/* 一覧グリッド（PC: 5列 → 縮小に応じて減少） */
.food-review-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 20px;
}

/* 商品カード（クリック可能なサムネ） */
.food-review-card {
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.food-review-card:hover,
.food-review-card:focus {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.22);
  outline: none;
}

/* サムネ本体（1:1 正方形・中央クロップ） */
.food-review-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #222;
}

.food-review-card-thumb > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* 上部オーバーレイ: タイトル + タグ */
.food-review-card-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 6px 7px 14px;
  background: linear-gradient(to bottom,
    rgba(0,0,0,0.32) 0%,
    rgba(0,0,0,0.18) 20%,
    rgba(0,0,0,0) 50%);
}

.food-review-card-name {
  font-size: 0.78rem;
  font-weight: bold;
  color: #fff;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

/* 複数回レビュー済みカウント */
.food-review-count {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: normal;
  background: rgba(255,255,255,0.25);
  color: #fff;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}

/* タグ（右寄せ） */
.food-review-tags--card {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: flex-end;
}

/* 下部オーバーレイ: 星 */
.food-review-card-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 7px 6px;
  background: linear-gradient(to top,
    rgba(0,0,0,0.72) 0%,
    rgba(0,0,0,0.48) 30%,
    rgba(0,0,0,0) 60%);
}

/* カード内の星: 7等分グリッドで端から端まで敷き詰め */
.food-review-card-bottom .food-review-stars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.food-review-card-bottom .food-star-icon {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

/* 星アイコン共通 */
.food-review-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
}

.food-star-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.food-star-icon--large {
  width: 30px;
  height: 30px;
}

/* タグ（共通） */
.food-review-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.food-review-tag {
  display: inline-block;
  font-size: 0.65rem;
  color: #fff;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  line-height: 1.4;
}

/* ===========================
   食品レビュー モーダル
   =========================== */

.food-review-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.food-review-modal.active {
  display: flex;
}

.food-review-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.food-review-modal-container {
  position: relative;
  background: var(--panel);
  border-radius: 12px;
  width: 100%;
  max-width: min(90vw, 1800px);
  max-height: 95vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  animation: foodModalIn 0.2s ease;
}

@keyframes foodModalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.food-review-modal-close {
  position: sticky;
  top: 12px;
  float: right;
  margin: 12px 12px 0 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.15s;
}

.food-review-modal-close:hover {
  background: var(--line);
}

.food-review-modal-body {
  padding: 16px 24px 24px;
  clear: both;
}

.food-review-modal-header {
  margin-bottom: 16px;
}

.food-review-modal-name {
  font-size: 1.4rem;
  font-weight: bold;
  margin: 0 0 8px 0;
}

.food-review-modal-main {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.food-review-modal-image-wrap {
  flex: 0 0 auto;
  width: 500px;
  max-width: 60%;
}

.food-review-modal-image {
  width: 100%;
  border-radius: 8px;
  display: block;
  object-fit: cover;
}

.food-review-modal-detail {
  flex: 1;
}

.food-review-stars--modal {
  margin-bottom: 10px;
}

.food-review-star-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.food-review-star-label {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.food-review-star-label--on {
  background: var(--brand);
  color: #fff;
}

.food-review-star-label--off {
  background: #e0e0e0;
  color: var(--muted);
}

.food-review-modal-date {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 8px 0;
}

.food-review-modal-comment {
  background: var(--bg);
  border-left: 3px solid var(--brand);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  font-size: 0.9rem;
  margin-top: 8px;
}

.food-review-modal-comment p {
  margin: 0;
}

/* レビュー追加画像（横長16:9想定・幅フィット） */
.food-review-modal-extra-images {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.food-review-modal-extra-image {
  width: 100%;
}

.food-review-modal-extra-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  object-fit: contain;
}

.food-review-modal-extra-caption {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 4px 0 0;
  text-align: center;
}

/* 複数レビューの区切り線 */
.food-review-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

/* PC版: カード内の文字をやや大きく */
@media (min-width: 800px) {
  .food-review-card-name {
    font-size: 0.75rem;
  }

  .food-review-tag {
    font-size: 0.75rem;
    padding: 2px 6px;
  }
}

/* レスポンシブ（orientation対応） */
/* タブレット横画面: 4列 */
@media (orientation: landscape) and (min-width: 501px) and (max-width: 1400px) {
  .food-review-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* タブレット縦画面: 3列 */
@media (orientation: portrait) and (min-width: 501px) {
  .food-review-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* スマホ: 2列 */
@media (max-width: 500px) {
  .food-review-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .food-review-modal-main {
    flex-direction: column;
  }

  .food-review-modal-image-wrap {
    width: 100%;
    max-width: 100%;
  }

  /* 星フィルター: 7等分グリッド1行ストレッチ */
  .food-review-star-filter {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
  }

  .food-star-filter-btn {
    padding: 4px 2px;
    width: 100%;
  }

  .food-star-filter-btn img {
    width: 100%;
    height: auto;
  }

  .food-star-filter-btn span {
    display: none;
  }

  /* アクティブ星フィルターのラベルをテキスト表示 */
  .food-star-active-labels {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted, #888);
    margin-top: 5px;
    min-height: 1em;
  }
}

/* ===========================
   糧星タグクラウド (frtc-)
   =========================== */

/* カテゴリ絞り込みボタン群 */
.frtc-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.frtc-filter-btn {
  padding: 6px 18px;
  border: 2px solid var(--brand);
  border-radius: 20px;
  background: transparent;
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}

.frtc-filter-btn.active {
  background: var(--brand);
  color: #fff;
}

.frtc-filter-btn:not(.active):hover {
  background: var(--brand-weak);
}

/* カテゴリセクション */
.frtc-section {
  margin-bottom: 32px;
}

.frtc-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  margin: 0 0 14px;
}

/* タグクラウド本体 */
.frtc-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: baseline;
}

/* 個別タグ */
.frtc-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: opacity 0.15s, transform 0.1s;
}

.frtc-tag:hover {
  opacity: 0.8;
  transform: scale(1.06);
  text-decoration: none;
}

/* ==============================
   画像フロート（テキスト回り込み）
   PC/タブレット: 横並び
   スマホ: 縦積み（画像→テキスト）
   ============================== */
.img-float-wrap {
  display: flex;
  gap: 1.5em;
  align-items: flex-start;
  margin: 1.5em 0;
}

.img-float-wrap--right {
  flex-direction: row-reverse;
}

.img-float-wrap > img {
  flex-shrink: 0;
  height: auto;
  max-width: 60%;
}

.img-float-text {
  flex: 1;
  min-width: 0;
}

.img-float-text > *:first-child {
  margin-top: 0;
}

.img-float-text > *:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .img-float-wrap,
  .img-float-wrap--right {
    flex-direction: column;
  }

  .img-float-wrap > img {
    width: 100% !important;
    max-width: 100%;
  }
}

