/* Scoped to inserted galleries. Without this plugin the stored <img>s remain. */
.qyg-shell { margin: 24px 0; color: var(--text, #263b32); font: inherit; min-width: 0; }
.qyg-gallery { box-sizing: border-box; margin: 24px 0; padding: 0; max-width: 100%; min-width: 0; }
.qyg-shell > .qyg-gallery { margin: 0; }
.qyg-gallery[data-qyg-layout="grid"] { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.qyg-gallery[data-qyg-layout="scroll"] { display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--green, #417c62) transparent; padding-bottom: 10px; touch-action: pan-x pan-y pinch-zoom; }
.qyg-gallery > img { box-sizing: border-box; display: block; margin: 0; border: 1px solid var(--line, #dfe7e2); border-radius: 8px; background: var(--surface-soft, #f5f7f6); cursor: zoom-in; object-fit: contain; }
.qyg-gallery[data-qyg-layout="grid"] > img { width: 100%; height: clamp(160px, 25vw, 280px); min-width: 0; max-width: 100%; }
.qyg-gallery[data-qyg-layout="scroll"] > img { flex: 0 0 auto; width: auto; height: clamp(210px, 32vw, 320px); max-width: 100%; scroll-snap-align: start; }
.qyg-gallery.qyg-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.qyg-gallery.qyg-dragging > img { cursor: grabbing; pointer-events: none; }
.qyg-gallery > img:focus-visible { outline: 3px solid var(--green, #417c62); outline-offset: -3px; }
.qyg-controls { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; margin-top: 9px; }
.qyg-hint { grid-column: 1; grid-row: 1; min-width: 0; width: 100%; box-sizing: border-box; margin: 0 !important; color: var(--muted, #606e67); font-size: 12px; line-height: 1.6; text-align: center; overflow-wrap: anywhere; }
.qyg-controls-with-arrows .qyg-hint { padding-inline: 84px; }
.qyg-arrows { grid-column: 1; grid-row: 1; justify-self: end; display: flex; gap: 8px; }
.qyg-controls[hidden], .qyg-hint[hidden], .qyg-arrows[hidden] { display: none; }
.qyg-shell .qyg-arrow { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line, #dfe7e2); border-radius: 50%; background: var(--surface, #fff); color: var(--green, #417c62); font: 23px/1 sans-serif; cursor: pointer; }
.qyg-shell .qyg-arrow:disabled { opacity: .35; cursor: default; }
.qyg-shell .qyg-arrow:focus-visible { outline: 3px solid var(--green, #417c62); outline-offset: 2px; }
.qyg-lightbox { box-sizing: border-box; position: fixed; inset: 0; width: min(1160px, calc(100vw - 40px)); height: min(850px, calc(100dvh - 40px)); max-width: none; max-height: none; margin: auto; padding: 0; border: 1px solid #ffffff24; border-radius: 12px; background: #151b18; color: #fff; font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; overflow: hidden; }
.qyg-lightbox:not([open]) { display: none; }
.qyg-lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; }
.qyg-lightbox::backdrop { background: #07100cdd; }
.qyg-lb-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; }
.qyg-lb-title { margin: 0; font-size: 14px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qyg-lb-count { flex-shrink: 0; font-variant-numeric: tabular-nums; color: #d8e2dc; }
.qyg-lightbox button { box-sizing: border-box; display: inline-grid; place-items: center; margin: 0; border: 1px solid transparent; border-radius: 8px; background: #ffffff12; color: #fff; font: inherit; cursor: pointer; }
.qyg-lightbox button:hover { background: #ffffff24; }
.qyg-lightbox button:focus-visible { outline: 3px solid #b1ddc1; outline-offset: -3px; }
.qyg-lightbox button:disabled { opacity: .3; cursor: default; }
.qyg-lightbox .qyg-lb-close { width: 40px; height: 40px; font-size: 28px; flex-shrink: 0; }
.qyg-lb-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; min-width: 0; padding: 0 64px; touch-action: pan-y pinch-zoom; }
.qyg-lightbox .qyg-lb-image { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; margin: 0; border: 0; border-radius: 0; background: transparent; }
.qyg-lightbox .qyg-lb-step { position: absolute; z-index: 1; top: calc(50% - 24px); width: 44px; height: 48px; font-size: 32px; }
.qyg-lb-prev { left: 10px; }
.qyg-lb-next { right: 10px; }
.qyg-lb-status { min-height: 24px; margin: 6px 12px !important; text-align: center; color: #d8e2dc; font-size: 12px; }
.qyg-lb-thumbs { display: flex; justify-content: safe center; gap: 8px; overflow-x: auto; max-width: 100%; padding: 3px 14px 14px; scrollbar-width: thin; }
.qyg-lightbox .qyg-lb-thumb { flex: 0 0 56px; width: 56px; height: 64px; padding: 3px; border: 2px solid transparent; background: #ffffff0a; }
.qyg-lightbox .qyg-lb-thumb[aria-current="true"] { border-color: #b1ddc1; background: #ffffff1c; }
.qyg-lightbox .qyg-lb-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; margin: 0; border: 0; border-radius: 3px; }
@media (max-width: 600px) {
  .qyg-gallery[data-qyg-layout="grid"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .qyg-gallery[data-qyg-layout="scroll"] { gap: 9px; }
  .qyg-lightbox { width: calc(100vw - 16px); height: calc(100dvh - 16px); border-radius: 9px; }
  .qyg-lb-stage { padding: 0 38px; }
  .qyg-lightbox .qyg-lb-step { width: 30px; height: 44px; background: #ffffff0d; }
  .qyg-lb-prev { left: 3px; } .qyg-lb-next { right: 3px; }
}
@media (prefers-reduced-motion: reduce) { .qyg-gallery { scroll-behavior: auto !important; } }
