/* ============================================================
 * 注意力训练课件 · 公共运行时样式
 * ============================================================ */

/* 全屏兜底（不支持元素全屏时）：锁定页面滚动 */
html.ffwl-lock, html.ffwl-lock body { overflow: hidden !important; }
.ffwl-course.ffwl-fs-fallback { position: fixed !important; inset: 0 !important; z-index: 2147483000 !important; }

/* 弹窗层（设置对话框）：搬到 <body> 下，包装层本身不产生盒子，只让课件样式（变量、字体）照常作用；
 * 下面的 !important 抵消主题 / 其他插件对 .modal / .modal-mask 的通用样式（如 .modal { display: none; position: fixed }） */
.ffwl-course.ffwl-layer { display: contents !important; }
.ffwl-course.ffwl-layer > .modal-mask {
  position: fixed !important; inset: 0 !important; top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
  z-index: 2147483100 !important; width: auto !important; height: auto !important; margin: 0 !important;
  overflow-y: auto !important; -webkit-overflow-scrolling: touch; transform: none !important; opacity: 1 !important; visibility: visible !important;
}
.ffwl-course.ffwl-layer > .modal-mask:not(.show) { display: none !important; }
.ffwl-course.ffwl-layer > .modal-mask.show { display: flex !important; align-items: center !important; justify-content: center !important; }
.ffwl-course.ffwl-layer > .modal-mask > .modal {
  display: block !important; position: relative !important; inset: auto !important; top: auto !important; left: auto !important; right: auto !important; bottom: auto !important;
  z-index: auto !important; opacity: 1 !important; visibility: visible !important; transform: none !important; float: none !important;
  height: auto !important; min-height: 0 !important; max-height: calc(100vh - 40px) !important; max-height: calc(100dvh - 40px) !important;
  overflow-y: auto !important; overflow-x: hidden !important; margin: auto !important; text-align: left !important; box-sizing: border-box !important;
  pointer-events: auto !important;
}

/* 编辑器 / 找不到课件时的提示 */
.ffwl-notice {
  border: 1px dashed #d63638; background: #fff6f6; color: #8a1f1f;
  padding: 12px 16px; border-radius: 8px; font-size: 14px; line-height: 1.6;
}

/* 打印隔离：平时隐藏打印层；打印时只打印打印层 */
.ffwl-print-portal { display: none; }
@page ffwl-landscape { size: A4 landscape; margin: 10mm; }
@page ffwl-portrait { size: A4 portrait; margin: 10mm; }
@media print {
  body.ffwl-printing > *:not(.ffwl-print-portal) { display: none !important; }
  html:has(body.ffwl-printing), body.ffwl-printing {
    margin: 0 !important; padding: 0 !important; background: #fff !important; height: auto !important; overflow: visible !important;
  }
  body.ffwl-printing .ffwl-print-portal { display: block !important; page: ffwl-landscape; }
  body.ffwl-printing .ffwl-print-portal.ffwl-print-portrait { page: ffwl-portrait; }
  body.ffwl-printing .ffwl-print-portal * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* 1.5.1 首页难度卡参数条：始终一行、标签内不换行；卡片很窄时缩小字号/内边距而不是折行 */
.ffwl-course:not(#ffwl-0):not(#ffwl-1) .level-card { container-type: inline-size; }
.ffwl-course:not(#ffwl-0):not(#ffwl-1) .level-card .lv-params {
  display: flex; flex-wrap: nowrap; justify-content: center; align-items: center;
  gap: clamp(4px, 2.6cqi, 8px); max-width: 100%; overflow: hidden;
}
.ffwl-course:not(#ffwl-0):not(#ffwl-1) .level-card .lv-params span {
  white-space: nowrap; flex: 0 0 auto; line-height: 1.4;
  font-size: clamp(11px, 6.2cqi, 13px); padding: 7px clamp(5px, 3.6cqi, 10px);
}
