/* 美西之旅 · 打印样式
   屏幕上隐藏 #print-view；打印时只显示 #print-view（内容由 print.js 在 beforeprint 时生成）。
   A4 纵向；地区色用字面量（CSS 变量在打印时未必生效）。 */

/* 屏幕上放在视口外而不是 display:none：封面路线图（Leaflet）要有尺寸才能提前把瓦片载好 */
@media screen {
  #print-view { position: absolute; left: -400vw; top: 0; width: 186mm; overflow: hidden; visibility: hidden; pointer-events: none; }
}
.pv-map { width: 100%; height: 118mm; background: #EEF0EC; }

@page { size: A4 portrait; margin: 12mm 12mm 14mm; }

@media print {
  html, body { height: auto !important; background: #fff !important; color: #000 !important; }
  body { margin: 0 !important; font-size: 10.5pt; }
  body > *:not(#print-view) { display: none !important; }

  #print-view {
    display: block;
    color: #000;
    background: #fff;
    font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 10.5pt;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  #print-view *:not(.leaflet-container):not(.leaflet-container *) { box-shadow: none !important; text-shadow: none !important; }
  #print-view { visibility: visible; }
  #print-view h1, #print-view h2, #print-view h3 {
    font-family: "Noto Serif SC", "Songti SC", "SimSun", serif; font-weight: 900; margin: 0; color: #000;
    break-after: avoid; page-break-after: avoid;
  }
  #print-view a { color: #000; text-decoration: none; }
  #print-view table { border-collapse: collapse; width: 100%; table-layout: fixed; }
  #print-view thead { display: table-header-group; }
  #print-view tr { break-inside: avoid; page-break-inside: avoid; }
  #print-view th, #print-view td { text-align: left; vertical-align: top; padding: 5pt 6pt; border-bottom: 0.6pt solid #B9B9B9; }
  #print-view th { font-size: 8.5pt; font-weight: 700; color: #444; letter-spacing: .06em; border-bottom: 1.2pt solid #000; padding-top: 3pt; padding-bottom: 3pt; }
  #print-view td.num, #print-view th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
  .pv-muted { color: #8A8A8A; }
  .pv-empty { font-size: 12pt; margin: 20mm 0; text-align: center; }
  .pv-lbl { display: inline-block; font-size: 8pt; color: #666; margin-right: 4pt; letter-spacing: .04em; }

  /* ---------- 封面 ---------- */
  .pv-cover { padding-top: 6mm; }
  .pv-kicker { font-size: 8.5pt; letter-spacing: .14em; color: #555; margin-bottom: 4pt; }
  .pv-cover h1 { font-size: 26pt; line-height: 1.15; border-bottom: 2pt solid #000; padding-bottom: 6pt; margin-bottom: 8pt; }
  .pv-range { font-size: 13pt; font-weight: 500; margin: 0 0 3pt; }
  .pv-facts { font-size: 10.5pt; color: #333; margin: 0 0 9mm; }
  .pv-gen { display: block; font-size: 8.5pt; color: #777; margin-top: 2pt; }
  .pv-overview { break-inside: avoid; page-break-inside: avoid; }
  .pv-overview td { padding: 3.5pt 6pt; }
  .pv-overview td:first-child { font-weight: 700; }
  .pv-total td { border-top: 1pt solid #000; font-weight: 700; padding-top: 4.5pt; }
  .pv-total td:first-child { text-align: right; }
  .pv-cost-note { font-size: 8.5pt; color: #555; margin: 3pt 0 8mm; }
  .pv-dot { display: inline-block; width: 7pt; height: 7pt; border-radius: 50%; margin-right: 4pt; vertical-align: -0.5pt; }
  /* 封面路线图：Leaflet 地图直接打印，圆点 / 线条用地区色 */
  #print-view .pv-map { border: 0.6pt solid #999; margin: 2mm 0 1.5mm; break-inside: avoid; page-break-inside: avoid; visibility: visible; }
  .pv-map-cap { font-size: 8.5pt; color: #555; margin: 0 0 6mm; }
  #print-view .leaflet-control-attribution { font-size: 6.5pt; background: rgba(255, 255, 255, .8); color: #555; }
  #print-view .pin-dot { font-size: 9pt; box-shadow: none; border-color: #fff; }

  /* ---------- 逐日 ---------- */
  #print-view .day { background: none; border: 0; margin-top: 8mm; break-before: page; page-break-before: always; }
  #print-view .day.first { break-before: auto; page-break-before: auto; margin-top: 10mm; }
  #print-view .day h2 {
    font-size: 15pt; line-height: 1.3; padding-bottom: 5pt; margin-bottom: 6pt;
    border-bottom: 1.5pt solid #000; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6pt;
  }
  #print-view .day h2 .pv-dn { font-size: 17pt; }
  #print-view .day h2 .pv-sum { margin-left: auto; font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; font-weight: 400; font-size: 9pt; color: #555; white-space: nowrap; }

  .pv-day col.c-time { width: 16mm; }
  .pv-day col.c-what { width: 60mm; }
  .pv-day col.c-res  { width: 43mm; }
  .pv-day col.c-tips { width: 35mm; }
  .pv-day col.c-note { width: auto; }
  .pv-day td { font-size: 9pt; line-height: 1.38; }
  /* 时间列：开始时间一行，结束时间下一行小字；overflow 截断保证绝不压到活动列 */
  .pv-day td.pv-time { border-left: 3.5pt solid #7D7A72; padding-left: 5pt; padding-right: 2pt; white-space: nowrap; overflow: hidden; }
  .pv-time b { display: block; font-weight: 700; font-size: 10pt; line-height: 1.25; }
  .pv-time small { display: block; font-size: 7.5pt; color: #555; line-height: 1.3; }
  .pv-day th:first-child { padding-left: 8.5pt; }

  .pv-act { display: flex; gap: 6pt; align-items: flex-start; }
  .pv-act-txt { min-width: 0; flex: 1 1 auto; }
  .pv-act b { display: block; font-size: 10.5pt; font-weight: 700; line-height: 1.3; }
  .pv-en { display: block; font-size: 8pt; color: #666; }
  .pv-tags { display: block; font-size: 8.5pt; color: #444; margin-top: 1.5pt; }
  .pv-thumb { flex: 0 0 auto; order: 2; width: 22mm; height: 15mm; object-fit: cover; border: 0.5pt solid #BBB; display: block; }

  .pv-res div + div { margin-top: 2pt; }
  .pv-warn { font-weight: 700; background: #EFEFEF; border-left: 2pt solid #000; padding: 1pt 4pt; margin-bottom: 2pt; }
  .pv-best { color: #333; }
  .pv-note { white-space: pre-wrap; word-break: break-word; min-height: 9mm; }

  /* ---------- 链接 ---------- */
  #print-view .pv-links { display: block; margin-top: 5pt; border-top: 0.6pt solid #B9B9B9; padding-top: 4pt; }
  #print-view .pv-links h3 { font-size: 9pt; letter-spacing: .1em; color: #444; margin-bottom: 2pt; }
  #print-view .pv-links ul { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 8mm; }
  #print-view .pv-links li { font-size: 7.6pt; line-height: 1.35; margin: 0 0 2.5pt; break-inside: avoid; page-break-inside: avoid; color: #333; }
  #print-view .pv-links li b { font-weight: 700; color: #000; }
  #print-view .pv-link { display: block; padding-left: 8pt; }
  #print-view .pv-url { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 7.2pt; color: #000; word-break: break-all; overflow-wrap: anywhere; }

  /* ---------- 出发前必须知道 ---------- */
  .pv-notes { margin-top: 10mm; break-inside: avoid; page-break-inside: avoid; max-width: none; }
  .pv-notes h2 { font-size: 14pt; border-left: 4pt solid #000; padding-left: 8pt; margin-bottom: 6pt; }
  .pv-notes ul { padding-left: 14pt; margin: 0; }
  .pv-notes li { font-size: 9.5pt; margin: 3pt 0; break-inside: avoid; page-break-inside: avoid; }
}
