/* =====================================================================
   print.css · 打印样式（听写卷子）
   仅在 @media print 与 body.printing 下生效
   ===================================================================== */

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

@media print {
  /* ---- 保留主题色 ---- */
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  html, body {
    background: #fff !important;
    color: #000 !important;
  }

  /* ---- 藏掉一切非卷面元素 ---- */
  .topbar,
  .sidebar,
  .bottom-nav,
  .no-print,
  #toastWrap,
  #modalRoot,
  .atmos,
  .atmos-mandala,
  .atmos-stars,
  .section-head,
  .dict-config,
  .notice {
    display: none !important;
  }

  .app, .layout, .main-content {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
  }

  .view { animation: none !important; }

  /* ---- 纸张容器：去掉屏幕上的拟物效果 ---- */
  .paper-stage { padding: 0 !important; }
  .paper-stack { gap: 0 !important; }

  .paper {
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    max-width: none !important;
    width: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
  }

  /* ---- 天城体必须命中衬线字体，否则出豆腐块 ---- */
  .paper .deva,
  .d-prompt,
  .ak-ans,
  .ph-quote {
    font-family: 'Noto Serif Devanagari', 'Nirmala UI', serif !important;
  }

  .ph-title, .ph-quote-zh {
    font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', serif !important;
  }

  /* ---- 题目不跨页断裂 ---- */
  .d-item {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 6mm;
  }

  /* ---- 手写线：用 border 而非背景，保证打印出来 ---- */
  .write-line {
    border-bottom: 0.4pt solid #808080 !important;
    height: var(--line-h, 12mm);
  }

  .d-no { color: #333 !important; }
  .d-hint { color: #777 !important; }

  /* ---- 答案页另起一页 ---- */
  .answer-key {
    break-before: page !important;
    page-break-before: always !important;
  }

  .ak-list { column-count: 2; column-gap: 10mm; }
  .ak-item { break-inside: avoid; page-break-inside: avoid; }
  .ak-ans { font-size: 10.5pt; color: #000 !important; }
  .ak-sub { color: #777 !important; }

  .paper-foot { display: none; }
}

/* 打印时不显示页面外壳的其它元素（兼容不支持 @page 的引擎） */
body.printing .topbar,
body.printing .sidebar,
body.printing .bottom-nav,
body.printing .no-print {
  display: none !important;
}
