/* 守護帳本 自訂樣式與列印樣式表 */

/* 基礎字體與平滑滾動 */
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans TC", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* 滾動條美化 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Modal 動畫效果 */
.modal-backdrop {
  backdrop-filter: blur(4px);
  transition: opacity 0.2s ease-in-out;
}

.modal-content {
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 標籤按鈕點擊動效 */
.tag-btn {
  transition: all 0.15s ease;
}
.tag-btn:active {
  transform: scale(0.96);
}

/* ==================== 法院 A4 列印與 PDF 匯出優化 ==================== */
@media print {
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
  }

  /* 隱藏所有非列印元件 */
  header, 
  nav, 
  main, 
  .no-print, 
  .modal-backdrop:not(#modalCourtReport),
  #modalLineSim,
  #modalSettings,
  #modalReceipt,
  #modalNoReceipt,
  #modalSplit,
  #modalDeposit {
    display: none !important;
  }

  #modalCourtReport {
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    display: block !important;
    overflow: visible !important;
  }

  .print-container {
    box-shadow: none !important;
    border-radius: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* A4 紙張與邊界設定 */
  @page {
    size: A4 portrait;
    margin: 15mm 15mm 15mm 15mm;
  }

  /* 分頁控制 */
  .page-break {
    page-break-before: always;
    break-before: page;
  }

  table {
    page-break-inside: auto;
  }
  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }

  /* 列印時文字強化 */
  th, td {
    border-color: #333333 !important;
  }
}
