/* ==========================================================================
   report.css · 企业税务风险报告（Figma 1:1 版）页面专属样式
   设计系统组件见 /figma.css；本文件只放报告页私有规则与打印布局。
   ========================================================================== */

/* 经营范围长文本折叠（两行截断 + 展开按钮） */
.fx-scope-value {
  font-size: 12px;
  line-height: 1.65;
  color: var(--fx-ink);
}

.fx-scope-value.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 品类占比进度条 */
.fx-cat__track {
  height: 6px;
  border-radius: 999px;
  background: #e8edf8;
  overflow: hidden;
}

.fx-cat__track b {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82ff, #1346cc);
}

/* 司法案件明细列宽（横向滚动网格总宽） */
.fx-case-cols { width: 592px; }

/* ---------- 窄屏微调 ---------- */
@media (max-width: 820px) {
  .fx-shell {
    box-shadow: none;
  }

  /* 窄屏允许普通表格换行，避免 4 列对比表溢出（横向滚动表格不受影响） */
  .fx-table th,
  .fx-table td {
    white-space: normal;
  }

  .fx-hero__badge { display: none; }
}

/* ---------- 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .fx-toast__pill,
  .fx-sheet__box,
  .fx-backdrop,
  .fx-tab,
  .fx-seg__btn,
  .fx-expand svg,
  details.fx-details > summary::after {
    transition: none !important;
    animation: none !important;
  }

  .fx-loading__spinner { animation-duration: 1.6s !important; }

  .fx-qr__ring { border-color: rgba(22, 100, 255, 0.04) !important; }
}

/* ---------- 打印 / PDF（A4，全部面板展开为连续文档） ---------- */
@media print {
  @page { size: A4; margin: 13mm 12mm 15mm; }

  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

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

  /* 屏幕专属控件全部隐藏 */
  .fx-loading,
  .fx-tabs,
  .fx-bottombar,
  .fx-toast,
  .fx-backdrop,
  .fx-sheet,
  #back-button,
  .fx-copy,
  .fx-fade-l,
  .fx-fade-r,
  .fx-scrollx-hint {
    display: none !important;
  }

  .fx-shell {
    max-width: none;
    min-height: auto;
    box-shadow: none;
  }

  .fx-hero { padding-bottom: 22px; }

  .fx-profile {
    margin-top: -18px;
    box-shadow: none;
  }

  .fx-content { padding-bottom: 0; }

  /* 全部 tab 面板展开为连续文档，面板标题作为分节符 */
  .fx-pane {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    padding: 12px 12px 4px;
  }

  .fx-pane + .fx-pane {
    padding-top: 0;
    margin-top: 4px;
  }

  .fx-pane__title {
    display: block;
    padding: 6px 4px 0;
  }

  .fx-pane__title::after {
    content: "";
    display: block;
    margin-top: 6px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #1346cc, rgba(19, 70, 204, 0));
  }

  .fx-card {
    box-shadow: none;
    break-inside: avoid;
  }

  /* 折叠明细在打印中强制展开（Chromium 生效） */
  details.fx-details:not([open]) > *:not(summary) { display: block !important; }

  .fx-chart { height: 200px; }

  .fx-scrollx { overflow: visible; }

  .fx-scrollx__inner { min-width: 0; }

  .fx-hcell,
  .fx-table th,
  .fx-table td { white-space: normal; }

  #footer-qr {
    display: block !important;
    break-inside: avoid;
  }
}

/* 上下游明细「查看更多」折叠行 */
.fx-comp.is-collapsed { display: none; }

/* ---------- 模块 B1：figma-tw 新骨架打印补充（税票 Tab 已换版区域；旧规则保留给 B2 未换版 pane） ---------- */
@media print {
  #copy-name,
  #copy-credit { display: none !important; }

  [data-tw-hero] { padding-bottom: 22px !important; }

  #company { margin-top: -18px !important; box-shadow: none !important; }

  [data-tw-section] { box-shadow: none !important; break-inside: avoid; }

  [data-chartbox] { height: 200px !important; }
}

/* ---------- 模块 B2：报告页后半换版打印补充（bottombar 换类后旧 .fx-bottombar 规则失效；银税横滑表打印放开） ---------- */
@media print {
  #bottombar,
  #yinshui-hint,
  [data-fade-l],
  [data-fade-r] { display: none !important; }

  [data-scrollx] { overflow: visible !important; }

  #yinshui-wrap > div { min-width: 0 !important; }
}
