/* 家长学习报告（2026-11-25，Amber 确认的设计稿 draft-v1）：屏幕上是两张报告纸；列印 / 储存 PDF 为 A4 两页（页眉页脚）；手机上表格变卡片 */
.fm { --fm-ink: var(--ink, #1d2140); --fm-ink2: var(--ink2, #4a5070); --fm-muted: var(--muted, #7b8199); --fm-line: #e6e8f0; }
.fm-page { background: #fff; border: 1px solid #eceef5; border-radius: 16px; padding: 28px 30px 22px; margin-bottom: 16px; color: var(--fm-ink); font-size: 14px; line-height: 1.6; }
.fm-hd { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; padding-bottom: 12px; border-bottom: 2px solid var(--fm-ink); }
.fm-hd small { color: var(--fm-muted); letter-spacing: .06em; font-size: 11.5px; }
.fm-hd h1 { margin: 2px 0 0; font-size: 24px; }
.fm-sub { color: var(--fm-ink2); font-size: 13px; }
.fm-meta { display: grid; grid-template-columns: auto auto; gap: 2px 14px; margin: 0; font-size: 12.5px; color: var(--fm-ink2); }
.fm-meta dd { margin: 0; color: var(--fm-ink); font-weight: 600; }
.fm-phd { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--fm-muted); padding-bottom: 6px; border-bottom: 1px solid var(--fm-line); }
.fm h2 { font-size: 15.5px; margin: 20px 0 10px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fm-no { color: var(--pri, #6c63ff); font-variant-numeric: tabular-nums; }
.fm-note { font-size: 11.5px; color: var(--fm-muted); font-weight: 400; }
.fm-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.fm-kpi { border: 1px solid var(--fm-line); border-radius: 10px; padding: 10px 12px; }
.fm-kpi small { color: var(--fm-muted); font-size: 12px; display: block; }
.fm-kpi b { font-size: 22px; font-variant-numeric: tabular-nums; }
.fm-kpi b i { font-style: normal; font-size: 13px; color: var(--fm-muted); font-weight: 500; }
.fm-kpi .fm-bar { margin-top: 6px; }
.fm-lead { margin: 10px 0 0; padding: 10px 12px; background: #efedff; border-radius: 10px; color: var(--fm-ink2); font-size: 13px; }
.fm table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fm th { text-align: left; font-weight: 600; color: var(--fm-muted); font-size: 11.5px; padding: 6px 8px; border-bottom: 1px solid var(--fm-line); white-space: nowrap; }
.fm td { padding: 9px 8px; border-bottom: 1px solid var(--fm-line); vertical-align: middle; }
.fm .num { text-align: right; font-variant-numeric: tabular-nums; }
.fm-subj { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.fm-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.fm-bar { position: relative; display: block; height: 8px; border-radius: 4px; background: #eef0f5; min-width: 90px; }
.fm-bar > b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.fm-bar > i { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--fm-ink); border-radius: 1px; }
.fm-rate { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.fm-legend { font-size: 11.5px; color: var(--fm-muted); margin-top: 6px; display: flex; gap: 16px; flex-wrap: wrap; }
.fm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fm-mk { width: 2px; height: 12px; background: var(--fm-ink); display: inline-block; }
.fm-sw { width: 18px; height: 8px; border-radius: 4px; background: #9aa3c7; display: inline-block; }
.fm-sw2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fm-box { border: 1px solid var(--fm-line); border-radius: 10px; padding: 10px 12px; }
.fm-box h3 { margin: 0 0 6px; font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fm-box ul { margin: 0; padding: 0; list-style: none; }
.fm-box ul li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; padding: 5px 0; border-top: 1px dashed var(--fm-line); font-size: 12.5px; align-items: center; }
.fm-box ul li:first-child { border-top: 0; }
.fm-box ul li.fm-none { display: block; color: var(--fm-muted); }
.fm-box em { font-style: normal; font-variant-numeric: tabular-nums; }
.fm-up { color: #1f7a4d; } .fm-down { color: #b4472d; }
.fm-rec { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.fm-st { color: var(--fm-ink2); font-weight: 600; }
.fm-g { margin-left: auto; font-weight: 600; font-size: 12.5px; }
.fm-rec ol { margin: 0; padding-left: 18px; font-size: 13px; }
.fm-rec ol li { padding: 3px 0; overflow-wrap: anywhere; }
.fm-rec small { color: var(--fm-muted); }
.fm-act { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; align-items: start; }
.fm-ymax { font-size: 10.5px; color: var(--fm-muted); margin-bottom: 2px; }
.fm-cols { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; height: 110px; border-bottom: 1px solid var(--fm-ink2); padding: 0 2px; }
.fm-cols span { background: var(--pri, #6c63ff); border-radius: 3px 3px 0 0; }
.fm-xl { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; font-size: 10px; color: var(--fm-muted); text-align: center; padding: 3px 2px 0; white-space: nowrap; }
.fm-muted { color: var(--fm-muted); font-size: 13px; }
.fm-notes { font-size: 12.5px; color: var(--fm-ink2); margin: 0; }
.fm-notes dt { font-weight: 600; color: var(--fm-ink); margin-top: 8px; }
.fm-notes dd { margin: 2px 0 0; }
.fm-ft { display: flex; justify-content: space-between; gap: 12px; font-size: 10.5px; color: var(--fm-muted); border-top: 1px solid var(--fm-line); padding-top: 6px; margin-top: 18px; }
@media screen and (max-width: 760px) {
  .fm-page { padding: 18px 14px 14px; border-radius: 12px; }
  .fm-hd { grid-template-columns: 1fr; } .fm-kpis { grid-template-columns: repeat(2, 1fr); }
  .fm-sw2, .fm-rec, .fm-act { grid-template-columns: 1fr; }
  table.fm-ov thead { display: none; } table.fm-ov, table.fm-ov tbody, table.fm-ov tr, table.fm-ov td { display: block; width: 100%; }
  table.fm-ov tr { border: 1px solid var(--fm-line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
  table.fm-ov td { border: 0; padding: 4px 0; display: grid; grid-template-columns: 104px 1fr; align-items: center; text-align: left; }
  table.fm-ov td::before { content: attr(data-l); color: var(--fm-muted); font-size: 12px; }
  table.fm-ov td.fm-first { grid-template-columns: 1fr; } table.fm-ov td.fm-first::before { content: none; }
}
/* 列印 / 储存 PDF：只印报告（A4 两页、页眉页脚），不印侧栏和按钮 */
#fmp { display: none; }
@media print {
  @page { size: A4; margin: 12mm 13mm; }
  body.fmp-on > :not(#fmp) { display: none !important; }
  body.fmp-on { background: #fff !important; }
  body.fmp-on #fmp { display: block; }
  #fmp .fm-page { border: 0; border-radius: 0; padding: 0; margin: 0; min-height: 271mm; position: relative; page-break-after: always; break-after: page; }
  #fmp .fm-page:last-child { page-break-after: auto; break-after: auto; }
  #fmp .fm-ft { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; }
  #fmp .fm-box, #fmp table tr { break-inside: avoid; }
  #fmp * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* 打印更紧凑，五科都有推荐时第 2 页也放得下 */
  #fmp .fm-page { font-size: 12.5px; line-height: 1.5; }
  #fmp h2 { margin: 12px 0 7px; font-size: 14px; }
  #fmp .fm-hd h1 { font-size: 22px; }
  #fmp .fm-kpi { padding: 8px 10px; } #fmp .fm-kpi b { font-size: 19px; }
  #fmp td { padding: 6px 8px; } #fmp .fm-box { padding: 8px 10px; }
  #fmp .fm-rec { gap: 8px; } #fmp .fm-rec ol { font-size: 12px; } #fmp .fm-rec ol li { padding: 1px 0; }
  #fmp .fm-cols { height: 80px; } #fmp .fm-notes { font-size: 11.5px; } #fmp .fm-notes dt { margin-top: 5px; }
}
