/**
 * print.css — R51 打印纪念册样式
 *
 * 将翻页相册转为A4纵向打印版，黑白/去动画/分页
 */

@media print {
  /* ===== 全局重置 ===== */
  @page {
    size: A4 portrait;
    margin: 15mm;
  }

  @page :first {
    margin-top: 25mm;
  }

  * {
    color: #000 !important;
    background: #fff !important;
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
    transition: none !important;
  }

  /* ===== 隐藏交互UI ===== */
  .scene-nav,
  .hero-cta,
  .flipbook-controls,
  .flipbook-thumbnails,
  .upload-dropzone,
  .upload-queue,
  .upload-actions,
  .upload-preview-grid,
  .wish-form,
  .wish-card-like,
  .poster-actions,
  .poster-template-selector,
  .share-cta,
  .toast-container,
  .modal-overlay,
  .danmaku-layer,
  .editor-upload-zone,
  .editor-header .btn-ghost,
  .btn-toggle,
  .emoji-picker-trigger,
  #global-loading,
  .fireworks-canvas,
  .balloons-layer,
  .confetti-layer,
  .tag-chip .tag-remove,
  .preview-remove {
    display: none !important;
  }

  /* ===== 场景全显示 ===== */
  .scene {
    display: block !important;
    page-break-after: always;
    padding: 0 !important;
    min-height: auto !important;
  }

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

  /* ===== Hero打印版 ===== */
  .hero-fullscreen {
    height: auto !important;
    text-align: center;
    padding: 20mm 0 !important;
  }

  .hero-photo {
    width: 60mm !important;
    height: 60mm !important;
    margin: 0 auto 10mm;
  }

  .hero-photo-frame {
    border: 1px solid #000 !important;
  }

  .hero-pet-name {
    font-size: 24pt !important;
    margin-bottom: 5mm;
  }

  .hero-subtitle {
    font-size: 12pt !important;
    margin-bottom: 5mm;
  }

  .countdown {
    border: 2px solid #000;
    padding: 5mm;
    display: inline-flex !important;
  }

  .countdown-num {
    background: none !important;
    box-shadow: none !important;
    border: 1px solid #000;
    font-size: 20pt !important;
  }

  /* ===== 翻页书打印版 ===== */
  .flipbook {
    width: 100% !important;
    height: auto !important;
  }

  .flipbook .page {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    position: static !important;
    page-break-after: always;
    padding: 5mm !important;
    border: 1px solid #ccc !important;
    margin-bottom: 5mm;
  }

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

  /* 排版固定为list */
  .page-inner {
    display: flex !important;
    flex-direction: column !important;
    gap: 5mm !important;
  }

  .page-grid-1 .page-photos,
  .page-grid-2 .page-photos,
  .page-grid-3 .page-photos,
  .page-grid-4 .page-photos {
    display: flex !important;
    flex-direction: column !important;
    gap: 3mm !important;
  }

  .page-photo {
    transform: none !important;
    width: 100% !important;
  }

  .page-photo img {
    max-width: 160mm !important;
    max-height: 100mm !important;
    object-fit: contain !important;
    display: block;
    margin: 0 auto;
  }

  .page-photo-caption {
    text-align: center;
    font-size: 10pt;
    display: block;
    margin-top: 2mm;
  }

  .page-number {
    text-align: center;
    font-size: 8pt;
    color: #666 !important;
    margin-top: 3mm;
  }

  .scrapbook-sticker,
  .scrapbook-tape {
    display: none !important;
  }

  /* ===== 蛋糕打印版 ===== */
  .cake-stage {
    text-align: center;
    padding: 10mm 0;
  }

  .candle-flame {
    opacity: 1 !important;
    border: 1px solid #000;
    border-radius: 50%;
    width: 8mm;
    height: 8mm;
    display: inline-block;
  }

  .cake-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2mm;
  }

  .cake-layer {
    border: 1px solid #000;
    border-radius: 2mm;
  }

  .cake-layer-top    { width: 40mm; height: 10mm; }
  .cake-layer-mid    { width: 50mm; height: 10mm; }
  .cake-layer-bottom { width: 60mm; height: 12mm; }
  .cake-plate        { width: 70mm; height: 3mm; }

  .cake-progress,
  .cake-all-done {
    text-align: center;
    font-size: 12pt;
    font-weight: bold;
    margin-top: 5mm;
  }

  /* ===== 留言打印版 ===== */
  .wish-card-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 3mm !important;
  }

  .wish-card {
    border: 1px solid #ccc !important;
    padding: 3mm !important;
    page-break-inside: avoid;
  }

  .wish-card-author {
    font-size: 11pt;
    font-weight: bold;
  }

  .wish-card-content {
    font-size: 10pt;
    margin: 2mm 0;
  }

  .wish-card-time {
    font-size: 8pt;
    color: #666 !important;
  }

  .wish-card-reply {
    font-size: 9pt;
    font-style: italic;
    margin-top: 2mm;
    padding-top: 2mm;
    border-top: 1px dashed #ccc;
  }

  .wish-empty {
    text-align: center;
    font-size: 11pt;
    font-style: italic;
  }

  .danmaku-layer {
    display: none !important;
  }

  /* ===== 编辑器打印版 ===== */
  .editor-form label {
    font-size: 10pt;
  }

  .editor-avatar {
    justify-content: center;
  }

  .avatar-upload {
    width: 40mm !important;
    height: 40mm !important;
    border: 1px solid #000;
  }

  /* ===== 分享海报 ===== */
  .poster-preview {
    text-align: center;
  }

  .poster-preview canvas {
    max-width: 150mm !important;
    height: auto !important;
    border: 1px solid #000;
  }

  /* ===== 页脚 ===== */
  .scene::after {
    content: "宠物生日纪念册 · 印刷版";
    display: block;
    text-align: center;
    font-size: 8pt;
    color: #999 !important;
    margin-top: 5mm;
  }

  /* ===== 避免孤立行 ===== */
  h2, h3, h1 {
    page-break-after: avoid;
  }

  img {
    page-break-inside: avoid;
  }
}
