/* 拼钢钢吉祥物（原创，纯 SVG + CSS）。详见 docs/MASCOT.md */
.pgg-mascot{position:fixed;left:14px;bottom:14px;z-index:35;width:92px;pointer-events:none;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;transition:width .25s ease}
.pgg-mascot__figure{pointer-events:auto;display:block;width:100%;margin:0;padding:0;border:0;background:none;cursor:pointer;-webkit-tap-highlight-color:transparent}
.pgg-mascot__figure:focus-visible{outline:3px solid #93b5ff;outline-offset:2px;border-radius:12px}
.pgg-mascot__svg{display:block;width:100%;height:auto;overflow:visible}
.pgg-mascot__toggle{pointer-events:auto;position:absolute;top:0;right:-8px;width:22px;height:22px;display:grid;place-items:center;padding:0;border:1px solid #dfe5ec;border-radius:50%;background:#fff;color:#64748b;font-size:14px;line-height:1;cursor:pointer;box-shadow:0 2px 6px #17243b1a;opacity:.85}
.pgg-mascot__toggle:hover,.pgg-mascot__toggle:focus-visible{opacity:1;color:#17243b}
.pgg-mascot__bubble{position:absolute;left:6px;bottom:calc(100% + 6px);width:max-content;max-width:190px;padding:8px 12px;background:#fff;color:#17243b;border:1px solid #e3e8ef;border-radius:12px;box-shadow:0 6px 18px #17243b1f;font-size:12px;line-height:1.5;pointer-events:none;opacity:0;transform:translateY(6px);transition:opacity .2s,transform .2s}
.pgg-mascot__bubble::after{content:"";position:absolute;left:22px;bottom:-6px;width:10px;height:10px;background:#fff;border-right:1px solid #e3e8ef;border-bottom:1px solid #e3e8ef;transform:rotate(45deg)}
.pgg-mascot__bubble.is-visible{opacity:1;transform:none}
.pgg-mascot.is-min{width:40px}
.pgg-mascot.is-min .pgg-mascot__toggle{top:-6px;right:-10px}
.pgg-mascot.is-min .pgg-mascot__bubble{display:none}
/* 预览页等内嵌场景：不固定定位 */
.pgg-mascot--inline{position:relative;left:auto;bottom:auto;z-index:auto;width:150px;margin:0 auto}

/* 动画：待机上下浮动、眨眼、挥手、跳一下 */
.pgg-mascot .m-body{animation:pggBob 3.2s ease-in-out infinite}
.pgg-mascot .m-shadow{transform-box:fill-box;transform-origin:center;animation:pggShadow 3.2s ease-in-out infinite}
.pgg-mascot .m-eyes{transform-box:fill-box;transform-origin:center;animation:pggBlink 4.6s infinite}
.pgg-mascot .m-arm{transform-box:view-box}
.pgg-mascot .m-ear{transform-box:view-box;animation:pggEar 5s ease-in-out infinite}
.pgg-mascot .m-ear--r{animation-delay:.25s}
.pgg-mascot .m-light{animation:pggLight 1.6s ease-in-out infinite}
.pgg-mascot.is-waving .m-arm{animation:pggWave .45s ease-in-out 4 alternate}
.pgg-mascot.is-hopping .m-body{animation:pggHop .6s cubic-bezier(.3,.7,.4,1)}
@media (hover:hover){.pgg-mascot__figure:hover .m-arm{animation:pggWave .45s ease-in-out infinite alternate}}
@keyframes pggBob{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
@keyframes pggShadow{0%,100%{transform:scaleX(1);opacity:.14}50%{transform:scaleX(.86);opacity:.09}}
@keyframes pggBlink{0%,92%,100%{transform:scaleY(1)}95%{transform:scaleY(.1)}}
@keyframes pggWave{from{transform:rotate(0)}to{transform:rotate(-22deg)}}
@keyframes pggHop{0%,100%{transform:translateY(0)}35%{transform:translateY(-16px) rotate(-3deg)}65%{transform:translateY(-6px) rotate(2deg)}}
@keyframes pggEar{0%,86%,100%{transform:rotate(0)}90%{transform:rotate(-12deg)}95%{transform:rotate(8deg)}}
@keyframes pggLight{0%,100%{opacity:1}50%{opacity:.35}}

/* 不遮挡内容：只有页面两侧留白足够（≥1440px）时才固定在左下角；
   更窄的屏幕（含手机）改为停靠在页脚下方的普通文档流中，永不覆盖内容。 */
@media (max-width:1439px){
  .pgg-mascot:not(.pgg-mascot--inline),.pgg-mascot:not(.pgg-mascot--inline).is-min{position:relative;left:auto;bottom:auto;z-index:auto;width:auto;display:flex;align-items:flex-end;padding:6px 20px 16px;background:#0d171e;pointer-events:auto}
  .pgg-mascot:not(.pgg-mascot--inline) .pgg-mascot__figure{width:72px;flex:none}
  .pgg-mascot:not(.pgg-mascot--inline) .pgg-mascot__toggle{display:none}
  .pgg-mascot:not(.pgg-mascot--inline) .pgg-mascot__bubble,.pgg-mascot:not(.pgg-mascot--inline).is-min .pgg-mascot__bubble{display:block;left:104px;bottom:40px;max-width:calc(100vw - 130px)}
  .pgg-mascot:not(.pgg-mascot--inline) .pgg-mascot__bubble::after{left:-6px;bottom:12px;transform:rotate(135deg)}
}
@media (max-width:700px){
  /* 留出首页底部固定配货单条的高度，滚到底时吉祥物露在条上方 */
  .pgg-mascot:not(.pgg-mascot--inline),.pgg-mascot:not(.pgg-mascot--inline).is-min{margin-top:-84px;padding:4px 16px calc(78px + env(safe-area-inset-bottom))}
  /* 上移进页脚自带的底部留白（为配货单条预留的 100px 空白区），避免出现大片空白 */
  .pgg-mascot:not(.pgg-mascot--inline) .pgg-mascot__figure{width:56px}
  .pgg-mascot:not(.pgg-mascot--inline) .pgg-mascot__bubble,.pgg-mascot:not(.pgg-mascot--inline).is-min .pgg-mascot__bubble{left:82px;bottom:calc(104px + env(safe-area-inset-bottom))}
  .pgg-mascot--inline{width:120px}
}
@media (prefers-reduced-motion:reduce){
  .pgg-mascot,.pgg-mascot *{animation:none!important;transition:none!important}
}
@media print{.pgg-mascot:not(.pgg-mascot--inline){display:none}}
