/* 第 4 课专用：材质球舞台、剖面示意图、编号控件组。颜色走 site.css 的变量；屋子本身（天空、黑墙）是画面内容，不随主题变。 */
.u4-wrap { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .u4-wrap { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } }
.u4-stage { position: relative; background: #060607; border-radius: 4px; overflow: hidden; }
.u4-stage canvas { display: block; width: 100%; height: auto; }
.u4-lbl { position: absolute; transform: translate(-50%, 6px); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; color: rgb(255 255 255 / 0.82); text-shadow: 0 1px 2px rgb(0 0 0 / 0.7); white-space: nowrap; pointer-events: none; }
.u4-env { position: absolute; left: 10px; top: 8px; font-size: 12.5px; color: rgb(255 255 255 / 0.8); text-shadow: 0 1px 2px rgb(0 0 0 / 0.7); pointer-events: none; }
.u4-fail { padding: 18px; color: #e8e5de; font-size: 15px; }
.u4-diag { margin: 0; }
.u4-d-svg { display: block; width: 100%; height: auto; border-radius: 4px; }
.u4-diag figcaption { margin-top: 8px; font-size: 13.5px; line-height: 1.6; }
.u4-d-sky { fill: #b9cdea; } .u4-d-ground { fill: #6e6358; } .u4-d-dark { fill: #0b0b0d; }
.u4-d-lamp { fill: #ffe7b0; } .u4-d-glow { fill: #ffe7b0; opacity: 0.25; }
.u4-d-card { stroke: #ffffff; stroke-width: 6; stroke-linecap: round; }
.u4-d-sight { stroke: #9aa3ad; stroke-width: 1; stroke-dasharray: 2 3; }
.u4-d-ray { stroke-width: 1.8; }
.u4-d-wall { stroke: #5a5d63; stroke-dasharray: 4 3; } .u4-d-card.u4-d-ray, .u4-d-ray.u4-d-card { stroke: #ffffff; stroke-width: 2.4; stroke-dasharray: none; }
.u4-d-lamp.u4-d-ray { stroke: #ffe7b0; stroke-width: 2.4; }
.u4-d-sky.u4-d-ray { stroke: #1d4e89; stroke-width: 2; fill: none; } .u4-d-ground.u4-d-ray { stroke: #3b3129; stroke-width: 2; fill: none; }
.u4-d-dot { fill: #9aa3ad; } .u4-d-dot-card, .u4-d-dot-lamp { fill: #ffffff; } .u4-d-dot-sky { fill: #1d4e89; }
.u4-d-lobe { fill: #ffffff; opacity: 0.08; }
.u4-d-ball { fill: #8d9299; stroke: #d7dbe0; stroke-width: 1; }
.u4-d-cam { fill: #d7dbe0; }
.u4-d-t { font-size: 11.5px; fill: #c9ced6; font-family: var(--font-sans); }
.u4-d-sky ~ .u4-d-t { fill: #1b1c1f; }
.u4-d-t-on { fill: #ffffff; }
.u4-readout { min-height: 3.2em; }
.u4-groups { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.u4-group legend { display: flex; align-items: baseline; gap: 8px; }
.u4-no { font-family: var(--font-mono); color: var(--safelight); letter-spacing: 0.08em; }
.u4-q { font-size: 13.5px; line-height: 1.55; color: var(--muted); margin: 2px 0 8px; }
.u4-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.u4-pair img { width: 100%; height: auto; display: block; }
@media (max-width: 520px) { .u4-pair { grid-template-columns: 1fr; gap: 10px; } }
.u4-ring { position: absolute; transform: translate(-50%, -50%); border: 1px dashed rgb(255 255 255 / 0.28); border-radius: 50%; pointer-events: none; }
.u4-ring[hidden] { display: none; }
.u4-stage[data-env="sky"] .u4-env { color: #1b1c1f; text-shadow: none; }
/* 两种还光方式的示意图 */
.u4-bounce, .u4-uv { margin: 24px 0 26px; }
.u4-bounce svg, .u4-uv svg { display: block; width: 100%; height: auto; }
.u4-bounce figcaption, .u4-uv figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.u4-b-title { font-family: var(--font-serif); font-weight: 600; font-size: 14px; fill: var(--ink); }
.u4-b-t { font-size: 12px; fill: var(--muted); }
.u4-b-t-c { fill: color-mix(in srgb, var(--st-3) 68%, var(--ink)); font-weight: 600; }
.u4-b-body { fill: color-mix(in srgb, var(--st-3) 14%, var(--card)); }
.u4-b-metal { fill: color-mix(in srgb, var(--ink) 16%, var(--card)); }
.u4-b-surf { stroke: var(--ink); stroke-width: 1.5; }
.u4-b-in { stroke: var(--ink-2); stroke-width: 2; }
.u4-b-spec { stroke: var(--st-3); stroke-width: 3; }
.u4-b-spec-thin { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.u4-b-diff { stroke: var(--st-3); stroke-width: 1.8; }
.u4-b-walk { fill: none; stroke: var(--st-3); stroke-width: 1.2; stroke-dasharray: 2 2; }
.u4-b-head { fill: var(--ink-2); } .u4-b-head-c { fill: var(--st-3); }
/* UV 示意图 */
.u4-uv-img { fill: var(--card); stroke: var(--ink-2); stroke-width: 1.2; }
.u4-uv-grid line, .u4-uv-grid path { stroke: var(--line-2); stroke-width: 1; fill: none; }
.u4-uv-cyl { fill: var(--card); stroke: var(--ink-2); stroke-width: 1.2; }
.u4-uv-cyl-top { fill: var(--paper-2); stroke: var(--ink-2); stroke-width: 1.2; }
.u4-uv-dot { fill: var(--safelight); }
.u4-uv-t { font-size: 12.5px; fill: var(--muted); }
.u4-uv-t-b { fill: var(--ink); font-family: var(--font-mono); }
.u4-uv-arrow { stroke: var(--ink-2); stroke-width: 1.5; fill: none; }
.u4-pair figure { margin: 0; }
.u4-pair figcaption { margin-top: 6px; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.02em; }
.u4-bounce-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.u4-uv-row { display: grid; grid-template-columns: minmax(0, 220px) auto minmax(0, 220px); gap: 8px 16px; align-items: center; justify-content: center; }
.u4-uv-mid { margin: 0; font-size: 13.5px; color: var(--muted); text-align: center; }
.u4-uv-mid::after { content: " →"; }
@media (max-width: 600px) {
  .u4-bounce-row { grid-template-columns: 1fr; gap: 10px; }
  .u4-uv-row { grid-template-columns: minmax(0, 240px); }
  .u4-uv-mid::after { content: " ↓"; }
}

/* 04 · 7 延伸：皮下散射剖面、三种球（示意图；皮肤和球的颜色是画面内容，不随主题变） */
.u4-sss, .u4-toon { margin: 24px 0 26px; }
.u4-sss svg, .u4-toon svg { display: block; width: 100%; height: auto; max-width: 640px; margin: 0 auto; }
.u4-sss figcaption, .u4-toon figcaption { font-size: 14px; color: var(--muted); margin: 8px auto 0; max-width: var(--measure); }
.u4-s-skin { fill: #ecc9b2; }
.u4-s-surf { stroke: #9a6b52; stroke-width: 1.5; }
.u4-s-t { font-size: 12.5px; fill: var(--muted); font-family: var(--font-sans); }
.u4-s-skin ~ .u4-s-t { fill: var(--muted); }
.u4-s-t-r { fill: #b8322a; font-weight: 600; }
.u4-s-t-g { fill: color-mix(in srgb, #2f7d4a 70%, var(--ink)); font-weight: 600; }
.u4-s-in { stroke: var(--ink-2); stroke-width: 2; }
.u4-s-head { fill: var(--ink-2); }
.u4-s-b { fill: none; stroke: #2f5fb8; stroke-width: 1.6; stroke-linejoin: round; }
.u4-s-g { fill: none; stroke: #2f7d4a; stroke-width: 1.6; stroke-linejoin: round; }
.u4-s-r { fill: none; stroke: #c0392b; stroke-width: 2; stroke-linejoin: round; }
.u4-s-r-out { stroke: #c0392b; stroke-width: 2; }
.u4-s-r-head { fill: #c0392b; }
:root[data-theme="dark"] .u4-s-t-r { fill: #ff8e7e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .u4-s-t-r { fill: #ff8e7e; } }
.u4-t-dark { fill: #9c6650; }
.u4-t-lit { fill: #f0c9ae; }
.u4-t-hull { fill: #1b1c1f; }
.u4-t-rim { fill: #fff3e2; }
.u4-t-t { font-size: 12.5px; fill: var(--muted); font-family: var(--font-sans); }
.u4-t-strong { fill: var(--ink); font-weight: 600; font-family: var(--font-serif); font-size: 14px; }
:root[data-theme="dark"] .u4-t-hull { fill: #000; stroke: #3b3f46; stroke-width: 1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .u4-t-hull { fill: #000; stroke: #3b3f46; stroke-width: 1; } }
