/* committee W — interactive science pieces (fx/widgets.js).
   Swiss: Inter + Noto Sans SC at 400/700, flush left, 1px rules, a bar thumb on a ruled track, square chips.
   paper mode follows 计云's line drawings; light paths always sit in the dark. */
.wg { position: absolute; inset: 0; overflow: hidden; font-family: "Inter", "Noto Sans SC", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-user-select: none; user-select: none; touch-action: none; -webkit-tap-highlight-color: transparent;
  --wg-fg: #0e2233; --wg-sub: #5f6a73; --wg-acc: #306c90; --wg-rule: rgba(14, 34, 51, .2); --wg-chip-on: #0e2233; --wg-chip-on-fg: #f4f3ef; color: var(--wg-fg); }
.wg[data-mode="night"] { --wg-fg: #e6edf2; --wg-sub: #93a3b0; --wg-acc: #9ccce4; --wg-rule: rgba(156, 204, 228, .3); --wg-chip-on: #e6edf2; --wg-chip-on-fg: #0b1622; }
.wg-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.wg-cv:active { cursor: grabbing; }
.wg-note { position: absolute; z-index: 3; right: 10px; bottom: 8px; font: 400 11px/1.2 inherit; font-family: inherit; letter-spacing: .04em; color: var(--wg-sub); pointer-events: none; }

/* caption: what the piece is showing for the current text card */
.wg-tag { position: absolute; z-index: 2; left: 14px; top: 12px; right: 14px; pointer-events: none; border-top: 2px solid var(--wg-fg); padding-top: 7px; }
.wg-tag b { display: block; font-weight: 700; font-size: 15px; line-height: 1.35; color: var(--wg-fg); }
.wg-tag span { display: block; margin-top: 1px; font-weight: 400; font-size: 12.5px; line-height: 1.5; color: var(--wg-sub); }
.wg.narrow .wg-tag { left: 10px; right: 10px; top: 8px; padding-top: 5px; }
.wg.narrow .wg-tag b { font-size: 13px; }
.wg.narrow .wg-tag span { font-size: 11px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg.narrow .wg-sl-l { font-size: 10px; margin-bottom: 12px; }
.wg-sl-lv { display: none; margin-left: .6em; font-weight: 700; color: var(--wg-fg); font-feature-settings: "tnum" 1; }
.wg.narrow .wg-sl-lv { display: inline; }
.wg.narrow .wg-sl-v { display: none; }
.wg.sm .wg-tag { display: none; }

/* controls row (kept above the bottom 30px, where the page puts its 看原图 button) */
.wg-ctl { position: absolute; z-index: 3; left: 14px; right: 14px; bottom: 30px; display: flex; align-items: flex-end; gap: 14px; }
.wg-ctl.right { justify-content: flex-end; }
.wg.narrow .wg-ctl { left: 10px; right: 10px; gap: 10px; }
.wg.sm .wg-ctl { left: 8px; right: 8px; bottom: 20px; }

/* slider: ruled track, bar thumb, value over the thumb, ticks under it */
.wg-sl { flex: 1 1 auto; min-width: 110px; padding: 0 0 18px; cursor: pointer; touch-action: none; }
.wg-sl-l { font-size: 11px; line-height: 1.3; letter-spacing: .06em; color: var(--wg-sub); margin-bottom: 20px; white-space: nowrap; }
.wg.sm .wg-sl-l { display: none; }
.wg.sm .wg-sl { padding-top: 18px; }
.wg-sl-t { position: relative; height: 2px; background: var(--wg-rule); outline: none; }
.wg-sl-t:focus-visible { box-shadow: 0 0 0 3px rgba(96, 156, 192, .45); }
.wg-sl-t::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; bottom: -14px; } /* fat touch target */
.wg-sl-f { position: absolute; left: 0; top: 0; width: 100%; height: 2px; background: var(--wg-acc); transform-origin: 0 50%; }
.wg-sl-h { position: absolute; top: -9px; width: 3px; height: 20px; margin-left: -1.5px; background: var(--wg-fg); transition: height .15s, top .15s; }
.wg-sl.on .wg-sl-h { top: -12px; height: 26px; }
.wg-sl-v { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); font-weight: 700; font-size: 13px; line-height: 1; white-space: nowrap; color: var(--wg-fg); font-feature-settings: "tnum" 1; }
.wg-sl-k { position: absolute; top: 5px; width: 1px; height: 5px; background: var(--wg-sub); font-style: normal; opacity: .8; }
.wg-sl-k span { position: absolute; top: 7px; left: 0; transform: translateX(-50%); font-size: 10px; line-height: 1; color: var(--wg-sub); white-space: nowrap; }
.wg-sl-k.start span { transform: none; }
.wg-sl-k.end span { transform: translateX(-100%); }
.wg-sl-k.pin { background: #ff3b30; height: 9px; opacity: 1; }
.wg-sl-k.pin span { color: #ff6b5e; font-weight: 700; }
.wg-sl-z { position: absolute; top: -4px; height: 10px; text-decoration: none; background: linear-gradient(90deg, rgba(64, 96, 255, .7), rgba(70, 225, 120, .6), rgba(255, 64, 52, .7)); }
.wg-sl-z span { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-size: 10.5px; font-weight: 700; line-height: 1; white-space: nowrap; color: #ff9b8f; }
.wg.sm .wg-sl-k span { display: none; }

/* square chips */
.wg-chips { display: flex; flex: none; border: 1px solid var(--wg-rule); margin-bottom: 14px; }
.wg-chip { all: unset; box-sizing: border-box; cursor: pointer; padding: 7px 10px; font-size: 12px; line-height: 1.2; color: var(--wg-sub); white-space: nowrap; transition: background-color .25s, color .25s; }
.wg-chip + .wg-chip { border-left: 1px solid var(--wg-rule); }
.wg-chip:hover { color: var(--wg-fg); }
.wg-chip.on { background: var(--wg-chip-on); color: var(--wg-chip-on-fg); }
.wg-chip:focus-visible { box-shadow: inset 0 0 0 2px rgba(96, 156, 192, .7); }
.wg.narrow .wg-chip { padding: 6px 8px; font-size: 11px; }
.wg.sm .wg-chips { margin-bottom: 0; }
.wg.sm .wg-chip { padding: 5px 6px; font-size: 10.5px; }
.wg-ctl.right .wg-chips { margin-bottom: 0; }

/* bluespot-path: which colours are being totally reflected */
.wg-tir { position: absolute; z-index: 2; right: 14px; bottom: 34px; display: grid; gap: 4px; pointer-events: none; }
.wg-tir span { display: grid; grid-template-columns: 10px 2.2em 4em; align-items: center; gap: 6px; font-size: 12px; line-height: 1.2; color: var(--wg-sub); }
.wg-tir i { width: 10px; height: 10px; border-radius: 50%; opacity: .45; }
.wg-tir em { font-style: normal; }
.wg-tir span.on { color: var(--wg-fg); font-weight: 700; }
.wg-tir span.on i { opacity: 1; box-shadow: 0 0 10px currentColor; }
.wg.narrow .wg-tir { right: 8px; bottom: 28px; }
.wg.narrow .wg-tir span { font-size: 10.5px; }

/* orientations: the halos of the chosen orientation(s) */
.wg-ori-info { position: absolute; z-index: 2; left: 14px; right: 14px; bottom: 30px; display: grid; gap: 8px; pointer-events: none; }
.wg-ori-row { border-top: 1px solid var(--wg-rule); padding-top: 7px; }
.wg-ori-row b { font-weight: 700; font-size: 14px; margin-right: 8px; }
.wg-ori-zh { font-size: 12px; color: var(--wg-sub); }
.wg-ori-zh em { font-style: normal; font-weight: 700; color: var(--wg-acc); }
.wg-ori-zh em.lv1, .wg-ori-zh em.lv2 { color: #c8402e; }
.wg-ori-row p { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 12.5px; line-height: 1.45; }
.wg-ori-row i { font-style: normal; }
.wg-ori-row i.mk { font-weight: 700; color: var(--wg-acc); box-shadow: inset 0 -2px 0 currentColor; }
.wg-ori-row i.etc { color: var(--wg-sub); }
.wg.narrow .wg-ori-info { left: 10px; right: 10px; gap: 4px; }
.wg.narrow .wg-ori-row { padding-top: 4px; }
.wg.narrow .wg-ori-row b { font-size: 12.5px; }
.wg.narrow .wg-ori-row p { font-size: 11px; gap: 1px 7px; margin-top: 2px; }

/* bluespot-elevation: the readout and 镜像's table */
.wg-be { position: absolute; z-index: 2; right: 14px; top: 70px; width: min(250px, 34%); pointer-events: none; }
.wg-be-big b { display: block; font-weight: 700; font-size: 44px; line-height: 1; letter-spacing: -.04em; font-feature-settings: "tnum" 1; color: #8fc4ff; }
.wg-be-big span { display: block; margin-top: 4px; font-size: 11.5px; color: var(--wg-sub); }
.wg-be-rb { margin: 8px 0 10px; font-size: 12px; line-height: 1.4; color: var(--wg-fg); min-height: 1.4em; }
.wg-be-rb i { font-style: normal; font-weight: 700; }
.wg-be table { width: 100%; border-collapse: collapse; font-size: 12px; font-feature-settings: "tnum" 1; }
.wg-be td { padding: 3px 0; border-top: 1px solid var(--wg-rule); color: var(--wg-sub); transition: color .2s; }
.wg-be td + td { text-align: right; }
.wg-be tr.on td { color: var(--wg-fg); font-weight: 700; }
.wg-be tr.on td:first-child { box-shadow: inset 3px 0 0 #8fc4ff; padding-left: 8px; }
.wg-be-f { margin: 10px 0 0; font-size: 11px; line-height: 1.5; color: var(--wg-sub); }
.wg.narrow .wg-be { top: 56px; right: 8px; width: 36%; }
.wg.narrow .wg-be-big b { font-size: 28px; }
.wg.narrow .wg-be-big span { font-size: 10px; }
.wg.narrow .wg-be-rb { font-size: 10.5px; margin: 5px 0 0; }
.wg.narrow .wg-be table, .wg.narrow .wg-be-f { display: none; }
@media (max-height: 560px) { .wg-be-f { display: none; } }

/* small boxes (the picture-in-picture crystals on No.8): crystal + short chips only */
.wg.sm .hide-sm, .wg.sm .lg { display: none; }
.wg.sm .wg-note { top: 5px; bottom: auto; right: 6px; font-size: 9.5px; }
.wg.sm .wg-ctl { bottom: 8px; justify-content: flex-start; }

@media (prefers-reduced-motion: reduce) { .wg-sl-h, .wg-chip { transition: none; } }
