/* すべてのフォルダ名・ファイル名の位置 */
body {
  font-size: 100%;
  color: #333;
  background-color: #FFF6D2;
}
#main li {margin: 0;}
.tree li {
  list-style-type: none;
  position: relative;
  padding-left: 1em; /* 3em → 2.2em にして線と箱を近づける */
  margin: 0.3em 0;
}

/* すべての横線 */
.tree ul li::before {
  content: "";
  position: absolute;
  top: 1.1em;   /* 0.7em → 1.1em にしてノードの中心に寄せる */
  left: 0;
  width: 1em;
  border-top: 1px solid var(--tk-text-mid);
}

.tree li .node {
  display: inline-block;
  background: var(--tk-text-mid);
  color: var(--tk-white);
  border: 4px solid var(--tk-white);
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  box-shadow: 0 3px 10px var(--tk-text-mid);
}

/* 第１階層（ルート） */
.tree {
  line-height: 1.8;
  padding: 0;
  margin-left: 10px; /* 40px → 10px くらいに詰める */
}

/* 第2階層以降の位置 */
.tree ul {
  position: relative;
  margin: 0;
  margin-left: 0.3em;
  padding: 0;
}

/* 縦線 */
.tree ul::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-left: 1px solid var(--tk-text-mid);
}

/* すべての横線 */
.tree ul li::before {
  content: "";
  position: absolute;
  top: 1.1em;   /* 0.7em → 1.1em にしてノードの中心に寄せる */
  left: 0;
  width: 1em;
  border-top: 1px solid var(--tk-text-mid);
}

/* 各階層liの最後の縦線を └ に */
.tree ul li:last-child::before {
  height: calc(100% - 1.2em);
  background-color: var(--tk-white);
}

.entry-title {
  color: var(--tk-accent);
  font-size: 1.4rem;
  font-weight: 700;
  margin: .5em 0;
  padding: .5em .5em .5em 1.2em; /* 左の余白は少しだけ */
  display: block;
  text-decoration: none;
  position: relative;
  text-align: center; /* 文字を中央揃え */
}

/* h1 の直前に ■ を置く（絶対配置しない） */
h1.entry-title::before {
  content: "■";
  display: inline-block;
  margin-right: 0.35em; /* ← ここで隙間を調整 */
  font-size: 1.1em;
  color: var(--tk-accent);
  position: static; /* 絶対配置を解除 */
}
/* ---------------------------
   テーブルラッパー（中央寄せ）
   --------------------------- */
.table-wrapper.table-center {
  display: flex;
  justify-content: center;
  width: 100%;
  overflow-x: auto; /* 横スクロールを許容 */
}

/* ---------------------------
   テーブル本体（中央寄せ・最大幅）
   display: table / inline-table の切替は必要に応じて変更
   --------------------------- */
.gunreibu-table {
  display: table;
  width: auto;           /* 重要：親幅いっぱいにしない */
  max-width: 980px;      /* 必要に応じて調整 */
  margin: 0;             /* ラッパーで中央寄せするため */
  border-collapse: collapse;
  overflow-x: auto;
}

/* 列タイプ */
.col-text { }
.col-num  { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------
   th 基本調整（矢印表示含む）
   --------------------------- */
.gunreibu-table th {
  position: relative;
  user-select: none;
  padding-right: 2.4em;
  white-space: nowrap;
  overflow: visible;
  z-index: 2;
}

/* クリック前：上下縦積みで薄く表示 */
.gunreibu-table th::after {
  content: "▲\A▼";
  white-space: pre;
  position: absolute;
  right: 0.6em;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.62em;
  line-height: 0.6em;
  color: var(--tk-primary-dark);
  opacity: 0.28;
  pointer-events: none;
  font-family: "Segoe UI Symbol", "Noto Sans JP", "Arial", sans-serif;
  text-align: center;
}

/* ホバーで濃く（ホバー可能なデバイスのみ） */
@media (hover: hover) {
  .gunreibu-table th:hover::after { opacity: 0.62; }
}

/* 昇順 / 降順 表示 */
.gunreibu-table th.sort-asc::after  { content: "▲"; font-size: 0.78em; color: var(--tk-primary-dark); opacity: 1; }
.gunreibu-table th.sort-desc::after { content: "▼"; font-size: 0.78em; color: var(--tk-primary-dark); opacity: 1; }

/* ソート中の列を軽く強調 */
.gunreibu-table th.sort-asc,
.gunreibu-table th.sort-desc {
  background-color: rgba(var(--tk-primary-rgb), 0.04);
}

/* ---------------------------
   数値列右寄せ（3〜7列目）
   --------------------------- */
.gunreibu-table th:nth-child(3),
.gunreibu-table th:nth-child(4),
.gunreibu-table th:nth-child(5),
.gunreibu-table th:nth-child(6),
.gunreibu-table th:nth-child(7),
.gunreibu-table td:nth-child(3),
.gunreibu-table td:nth-child(4),
.gunreibu-table td:nth-child(5),
.gunreibu-table td:nth-child(6),
.gunreibu-table td:nth-child(7) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* variant 行の視覚調整（同一魚雷の別バリアント） */
.gunreibu-table tr.variant td {
  border-top: 0;
  opacity: 0.98;
}
.gunreibu-table tr + tr.variant td {
  padding-top: 0.35rem;
}

/* キャプション */
.gunreibu-table caption.caption-min {
  caption-side: top;
  text-align: center;
  font-size: 0.95rem;
  color: var(--tk-text-mid);
  padding: 0.25em 0;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ---------------------------
   モバイル調整
   --------------------------- */
@media (max-width: 768px) {
  .gunreibu-table {
    display: block;    /* 横スクロールを許容するため */
    width: 100%;
    max-width: none;
    margin: 0;
  }
  .gunreibu-table th { padding-right: 1.6em; }
  .gunreibu-table th::after { font-size: 0.52em; right: 0.45em; }
}
