/* ===== TablePress風スタイル（doraworks 用）===== */
/* 目安の配色（必要なら下の色コードをお好みで変更） */
:root{
  --tp-border: #dddddd;      /* 枠線色 */
  --tp-head-bg: #f1f1f1;     /* thead 背景 */
  --tp-head-bd: #d9d9d9;     /* thead 下線 */
  --tp-row-odd: #f9f9f9;     /* 偶奇ストライプ */
  --tp-row-hover: #eef6ff;   /* 行ホバー */
  --tp-text: #333;
  --tp-link: #2b6cb0;
}

.dw-table-wrap{max-width:100%;overflow-x:auto}

/* ▼テーブル本体：TablePressの雰囲気に合わせた枠/余白/文字 */
table.dataTable.doraworks{
  border-collapse: collapse;
  width:100%;
  color:var(--tp-text);
  font-size:14px;
  line-height:1.6;
  border:1px solid var(--tp-border);
  background:#fff;
}

/* ヘッダー行（thead） */
table.dataTable.doraworks thead th{
  background:var(--tp-head-bg);
  border-bottom:2px solid var(--tp-head-bd);
  border-right:1px solid var(--tp-border);
  font-weight:600;
  padding:10px 12px;
  text-align:left;
  white-space:nowrap;
}
table.dataTable.doraworks thead th:last-child{border-right:none}

/* データ行（tbody） */
table.dataTable.doraworks tbody td{
  border-bottom:1px solid var(--tp-border);
  border-right:1px solid var(--tp-border);
  padding:8px 12px;
  vertical-align:top;
  word-break:break-word;
}
table.dataTable.doraworks tbody td:last-child{border-right:none}

/* ストライプ・ホバー（TablePress既定に近い雰囲気） */
table.dataTable.doraworks.stripe tbody tr:nth-child(odd){background:var(--tp-row-odd)}
table.dataTable.doraworks.hover  tbody tr:hover{background:var(--tp-row-hover)}

/* リンク色（TablePress系の落ち着いた青） */
table.dataTable.doraworks a{color:var(--tp-link);text-decoration:none}
table.dataTable.doraworks a:hover{text-decoration:underline}

/* キャプション（使う場合） */
table.dataTable.doraworks caption{
  caption-side:top;
  text-align:left;
  padding:6px 0 10px;
  font-weight:600;
  color:#555;
}

/* ▼列フィルター行（2段目 thead） */
.dw-filter-row th{
  background:#fafafa;
  border-bottom:1px solid var(--tp-border);
  padding:6px 8px;
}
.dw-filter-row input[type="text"],
.dw-filter-row select{
  width:100%;
  box-sizing:border-box;
  padding:4px 6px;
  font-size:12px;
  border:1px solid #cbd5e0;
  border-radius:4px;
  background:#fff;
}

/* ▼DataTables UI（件数/検索/ページネーション）をTablePress風に控えめ調整 */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate{
  margin:8px 0;
}
.dataTables_wrapper .dataTables_length select{
  border:1px solid #cbd5e0;border-radius:4px;padding:2px 6px;background:#fff
}
.dataTables_wrapper .dataTables_filter input{
  border:1px solid #cbd5e0;border-radius:4px;padding:4px 6px;background:#fff
}
.dataTables_wrapper .dataTables_paginate .paginate_button{
  border:1px solid #ccd6e0;border-radius:4px;padding:2px 8px;margin:0 2px;
  background:#fff; color:#333;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current{
  background:#e9eef9; border-color:#b7c5e0; font-weight:600;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover{
  background:#f1f5fb; border-color:#b7c5e0; color:#111;
}

/* ▼並べ替え矢印（DataTablesの既定を少し控えめに） */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc{
  background-position:right 8px center;
  background-repeat:no-repeat;
  padding-right:22px; /* 矢印分の余白 */
}
table.dataTable thead .sorting{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='11' height='12'><path d='M1 8l4-4 4 4' stroke='%23999' fill='none' stroke-width='2'/></svg>")}
table.dataTable thead .sorting_asc{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='11' height='12'><path d='M1 8l4-4 4 4' stroke='%23666' fill='none' stroke-width='2'/></svg>")}
table.dataTable thead .sorting_desc{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='11' height='12'><path d='M1 4l4 4 4-4' stroke='%23666' fill='none' stroke-width='2'/></svg>")}

/* ▼スマホ時の詰め（TablePressの「コンパクト」感に寄せる） */
@media (max-width: 640px){
  table.dataTable.doraworks{font-size:13px}
  table.dataTable.doraworks thead th{padding:8px 10px}
  table.dataTable.doraworks tbody td{padding:6px 10px}
}


/* ===== doraworks 列幅（7列：ID / 作品名 / タイトル / 発表年月日 / 掲載誌 / 掲載号 / 全集書名） ===== */

/* ===== 列幅バランス最適化（7列構成） ===== */
table.dataTable#dwTable {
  table-layout: auto;
  width: 100%;
}

/* 1: ID列 */
#dwTable th:nth-child(1), #dwTable td:nth-child(1){

/*
  width: 3%;
  min-width: 3%;
  max-width: 3%;
  text-align: right;
  white-space: nowrap;

  */

}

/* 2: 作品名 */
#dwTable th:nth-child(2), #dwTable td:nth-child(2){
  width: 16%;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* 3: タイトル */
#dwTable th:nth-child(3), #dwTable td:nth-child(3){
  width: 26%;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* 4: 発表年月日 */
#dwTable th:nth-child(4), #dwTable td:nth-child(4){

/*
  width: 3%;
  min-width: 3%;
  white-space: nowrap;

*/
}

/* 5: 掲載誌 */
#dwTable th:nth-child(5), #dwTable td:nth-child(5){
  width: 16%;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* 6: 掲載号 */
#dwTable th:nth-child(6), #dwTable td:nth-child(6){
  width: 12%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* 7: 全集書名 */
#dwTable th:nth-child(7), #dwTable td:nth-child(7){
  width: 20%;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* 横スクロール対応（スマホ） */
.dw-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== モバイル時：横スクロール許可、折り返し有効 ===== */
@media (max-width: 900px){
  table.dataTable#dwTable{
    table-layout: fixed;
    min-width: 900px; /* スクロール発火基準 */
  }
  #dwTable th:nth-child(2), #dwTable td:nth-child(2),
  #dwTable th:nth-child(3), #dwTable td:nth-child(3),
  #dwTable th:nth-child(5), #dwTable td:nth-child(5),
  #dwTable th:nth-child(6), #dwTable td:nth-child(6),
  #dwTable th:nth-child(7), #dwTable td:nth-child(7){
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  #dwTable th:nth-child(1), #dwTable td:nth-child(1),
  #dwTable th:nth-child(4), #dwTable td:nth-child(4){
    white-space: nowrap !important;
  }
}
