/* コントロールバー（印刷時非表示） */
.controls-bar {
  display: flex;
  align-items: center;
  padding: 15px;
  background-color: #f5f5f5;
  margin-bottom: 20px;
  border-radius: 5px;
}

/* 印刷用コンテナ */
.print-main-container {
  font-family: 'Meiryo', 'MS PGothic', 'MS Gothic', 'Hiragino Kaku Gothic Pro', sans-serif;
  font-size: 9px;
  line-height: 1.2;
  background-color: #fff;
  padding: 10mm;
  width: 210mm;
  margin: 0 auto;
}

.print-page {
  page-break-after: always;
  min-height: 277mm;
  max-width: 195mm;
  margin: 0 auto;
  position: relative;
}

.print-page:last-child {
  page-break-after: avoid;
}

/* ヘッダー */
.print-page-header {
  position: relative;
  margin-bottom: 25px;
  min-height: 100px;
}

.print-page-title {
  text-align: center;
  font-size: 28px;
  font-weight: normal;
  margin-bottom: 10px;
}

.print-page-category {
  text-align: left;
  font-size: 22px;
  font-weight: normal;
  margin-bottom: 15px;
}

.print-page-event-info {
  position: absolute;
  top: 40px;
  right: 0;
  font-size: 13.5px;
  line-height: 1.3;
  text-align: right;
  white-space: nowrap;
  margin-bottom: 5px;
}

.print-page-event-info div {
  margin-bottom: 2px;
}

/* テーブルヘッダー */
.print-table-header {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #000;
  margin-bottom: 6px;
}

.print-table-header th {
  border: 1px solid #000;
  padding: 1px 4px;
  font-size: 11px;
  font-weight: bold;
  height: 14px;
  line-height: 1;
  text-align: center;
  background-color: #fff;
  white-space: nowrap;
}

/* データテーブル */
.print-table-data {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #000;
  border-top: none;
}

.print-table-data td {
  border-left: 1px solid #000;
  border-right: 1px solid #000;
  padding: 1px 4px;
  font-size: 11.2px;
  height: 13px;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
}

.print-table-data tr:first-child td {
  border-top: 1px solid #000;
}

.print-table-data tr.separator {
  border-bottom: 1px solid #000;
}

/* カラム幅 */
.col-rank { width: 7%; text-align: left; }
.col-time { width: 11%; text-align: right; }
.col-no { width: 7%; text-align: right; }
.col-name { width: 19%; text-align: left; }
.col-kana { width: 27%; text-align: left; }
.col-note { width: 29%; text-align: left; }

/* フッター */
.print-page-footer {
  text-align: left;
  font-size: 10px;
  font-style: italic;
  margin-top: 15px;
}

/* 画面表示時のスタイル */
@media screen {
  .print-main-container {
    background-color: #f0f0f0;
    padding: 20px;
  }
  
  .print-page {
    background-color: #fff;
    padding: 10mm;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
  }
}

/* モバイル表示時のスタイル */
@media screen and (max-width: 768px) {
  body {
    padding: 0;
    overflow-x: hidden;
  }
  
  .controls-bar {
    padding: 10px;
    margin-bottom: 10px;
  }
  
  .controls-bar .btn {
    width: 100%;
  }
  
  .print-main-container {
    width: 100%;
    padding: 5px;
    background-color: #f0f0f0;
  }
  
  .print-page {
    width: 100%;
    min-height: auto;
    padding: 3mm;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 10px;
  }
  
  .print-page-header {
    margin-bottom: 15px;
    min-height: auto;
  }
  
  .print-page-title {
    font-size: 16px;
    margin-bottom: 8px;
  }
  
  .print-page-category {
    font-size: 14px;
    margin-bottom: 10px;
  }
  
  .print-page-event-info {
    position: static;
    font-size: 10px;
    text-align: left;
    margin-bottom: 10px;
  }
  
  .print-table-header th {
    font-size: 9px;
    padding: 2px;
    height: auto;
  }
  
  .print-table-data td {
    font-size: 9px;
    padding: 2px;
    height: auto;
  }
  
  /* フリガナ列を非表示 */
  .col-kana {
    display: none;
  }
  
  /* 列幅を再調整（フリガナなし） */
  .col-rank { width: 10%; }
  .col-time { width: 18%; }
  .col-no { width: 12%; }
  .col-name { width: 35%; }
  .col-note { width: 25%; }
  
  .print-page-footer {
    font-size: 8px;
    margin-top: 10px;
  }
}

/* 印刷時のスタイル */
@media print {
  .no-print,
  .controls-bar {
    display: none !important;
  }
  
  @page {
    size: A4;
    margin: 10mm;
  }
  
  body {
    padding: 0;
    background: #fff;
  }
  
  .print-main-container {
    padding: 0;
    background-color: #fff;
  }
  
  .print-page {
    padding: 0;
    box-shadow: none;
    margin-bottom: 0;
  }
}
