/* ============================================================
   乐学堂 · 知识点图示（语文 / 数学共用样式）
   ============================================================ */
.fig {
  margin: 14px 0 4px; padding: 12px 14px 10px;
  background: #fbfcff; border: 1px solid var(--line); border-radius: 14px;
}
.fig-svg { width: 100%; height: auto; display: block; }
.fig-cap { margin-top: 6px; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--muted); }

/* ---------- 真实照片 ---------- */
.fig-photo { padding: 10px 12px 8px; background: #fbfcff; }
.fig-img {
  width: 100%; max-height: 380px; object-fit: cover;
  display: block; border-radius: 10px;
  box-shadow: 0 4px 14px rgba(40, 54, 85, .10);
  transition: transform .35s ease, box-shadow .35s ease;
}
.fig-photo:hover .fig-img { transform: scale(1.012); box-shadow: 0 8px 22px rgba(40, 54, 85, .14); }
.fig-photo .fig-cap { margin-top: 8px; }

/* ---------- 演示控件 ---------- */
.fig-ctrl { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: center; margin-top: 8px; }
.fig-btn {
  border: 1.5px solid var(--line); background: #fff; border-radius: 10px;
  padding: 6px 12px; font-size: 13.5px; font-weight: 800; color: var(--ink);
}
.fig-btn:hover { border-color: #b9c7de; }
.fig-btn:disabled { opacity: .6; cursor: default; }
.fig-btn.fig-primary { background: #2f9bd6; border-color: #2f9bd6; color: #fff; }
.fig-btn.fig-on { background: color-mix(in srgb, #2f9bd6 16%, white); border-color: #2f9bd6; color: #2767a8; }
.fig-range { width: 100%; accent-color: #2f9bd6; margin-top: 8px; }
.fig-range-s { width: 150px; margin-top: 0; }
.fig-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.fig-note { text-align: center; font-size: 13.5px; font-weight: 700; color: #35567e; margin: 8px 0 2px; min-height: 1.5em; }

/* ---------- 表格与流程图 ---------- */
.fig-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 2px; }
.fig-table th, .fig-table td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; }
.fig-table th { background: #f2f6fd; font-weight: 800; }
.fig-table .fig-win { color: #187749; font-weight: 800; }
.fig-table .fig-lose { color: #b04a4a; }
.fig-flow { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.fig-stop {
  flex: 1 1 120px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #fff; border: 1.5px solid #e3e9f4; border-radius: 12px; padding: 10px 8px; text-align: center;
}
.fig-stop-ico { font-size: 24px; line-height: 1.2; }
.fig-stop b { font-size: 14px; }
.fig-stop i { font-style: normal; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.fig-flow-arrow { align-self: center; font-size: 18px; color: #8fb0d8; font-weight: 900; }

/* ---------- 单元横幅 ---------- */
.unit-banner { margin: 4px 0 8px; }
.unit-banner svg { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--line); }

/* ---------- 打印 ---------- */
@media print {
  .fig { border-color: #ccc; background: #fff; }
  .fig-ctrl, .fig-range { display: none !important; }
  .anim-spin, .anim-pulse, .anim-flow, .anim-float, .anim-bob, .anim-shimmer,
  .anim-sun, .anim-cloud, .anim-rain, .anim-wave { animation: none !important; }
}

/* ============================================================
   图示动画（地理探索等使用）
   纯 CSS 动画，离线可用，不依赖第三方库
   ============================================================ */
@keyframes gfig-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes gfig-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(1.08); } }
@keyframes gfig-float { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(14px); } }
@keyframes gfig-float2 { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-18px); } }
@keyframes gfig-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes gfig-shimmer { 0% { opacity: .25; } 50% { opacity: .9; } 100% { opacity: .25; } }
@keyframes gfig-flow { to { stroke-dashoffset: -40; } }
@keyframes gfig-flow2 { to { stroke-dashoffset: 40; } }
@keyframes gfig-sun-rays { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes gfig-rain { 0% { transform: translateY(-6px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(10px); opacity: 0; } }
@keyframes gfig-wave { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes gfig-pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }

.anim-spin { animation: gfig-spin 16s linear infinite; transform-origin: center; transform-box: fill-box; }
.anim-spin-slow { animation: gfig-spin 40s linear infinite; transform-origin: center; transform-box: fill-box; }
.anim-pulse { animation: gfig-pulse 2.4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.anim-pulse-fast { animation: gfig-pulse 1.4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.anim-float { animation: gfig-float 6s ease-in-out infinite; }
.anim-float2 { animation: gfig-float2 7.5s ease-in-out infinite; }
.anim-bob { animation: gfig-bob 2.8s ease-in-out infinite; }
.anim-shimmer { animation: gfig-shimmer 2s ease-in-out infinite; }
.anim-flow { stroke-dasharray: 10 8; animation: gfig-flow 1.4s linear infinite; }
.anim-flow2 { stroke-dasharray: 10 8; animation: gfig-flow2 1.6s linear infinite; }
.anim-sun-rays { animation: gfig-sun-rays 18s linear infinite; transform-origin: center; transform-box: fill-box; }
.anim-rain { animation: gfig-rain 1.1s linear infinite; }
.anim-wave { animation: gfig-wave 2.6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.anim-pop { animation: gfig-pop .5s ease-out both; }

/* 单位横幅入场动画 */
.unit-banner svg { animation: gfig-pop .5s ease-out both; }
.unit-banner:hover svg { animation: none; }

/* 让带 transform-box 的动画在旧浏览器也能退化 */
@supports not (transform-box: fill-box) {
  .anim-spin, .anim-spin-slow, .anim-pulse, .anim-pulse-fast,
  .anim-sun-rays, .anim-wave { animation: none; }
}
