.pet-assistant { --pet-surface:rgba(255,255,255,.97); --pet-text:#253044; --pet-muted:#657187; --pet-border:rgba(42,53,79,.16); --pet-accent:#426bdc; --pet-input:#f3f5fa; position:fixed; inset:0; z-index:8800; pointer-events:none; font:14px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif; color:var(--pet-text); }
body.lg-dark .pet-assistant,.lg-dark .pet-assistant,.pet-assistant[data-theme="dark"] { --pet-surface:rgba(28,32,42,.97); --pet-text:#f0f2f7; --pet-muted:#b5bccb; --pet-border:rgba(230,235,255,.2); --pet-accent:#8ca9ff; --pet-input:#252c3c; }
.pet-assistant * { box-sizing:border-box; }
.pet-assistant [hidden] { display:none!important; }
.pet-assistant button,.pet-assistant textarea { font:inherit; color:inherit; }
.pet-assistant button { cursor:pointer; }
.pet-assistant button:focus-visible,.pet-assistant textarea:focus-visible { outline:3px solid var(--pet-accent); outline-offset:3px; }
.pet-anchor { position:absolute; width:120px; height:130px; pointer-events:auto; }
.pet-assistant button.pet-character { display:block; width:120px; height:130px; padding:0; border:0; border-radius:36px; background:transparent; touch-action:none; user-select:none; -webkit-user-select:none; -webkit-tap-highlight-color:transparent; cursor:grab!important; }
.pet-assistant .pet-anchor button.pet-character:is(:hover,:active,:focus) { border:0; background:transparent; box-shadow:none; filter:none; translate:none; scale:none; }
.pet-assistant button.pet-character:focus:not(:focus-visible) { outline:none; }
.pet-character:active { cursor:grabbing!important; }
.pet-sprite { display:block; width:120px; height:130px; background-image:url('./spritesheet.webp'); background-size:960px 1430px; background-repeat:no-repeat; pointer-events:none; filter:drop-shadow(0 5px 8px rgba(25,26,45,.13)); }
.pet-actions { position:absolute; top:100%; left:50%; display:flex; gap:6px; transform:translateX(-50%); opacity:0; visibility:hidden; transition:opacity .15s; padding:4px 4px 10px; }
.pet-anchor:hover .pet-actions,.pet-anchor:focus-within .pet-actions { opacity:1; visibility:visible; }
.pet-anchor[data-chat-open="true"] .pet-actions { display:none; }
@media (hover:none) { .pet-actions { opacity:1; visibility:visible; } }
.pet-assistant button.pet-icon-button { display:grid; place-items:center; flex:none; width:36px; height:36px; padding:0; border:1px solid var(--pet-border); background:var(--pet-surface); box-shadow:0 4px 16px rgba(14,22,38,.1); border-radius:50%; }
.pet-icon-button svg,.pet-send svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
#lg-toolbar .pet-restore[hidden] { display:none!important; }
#lg-toolbar .pet-restore svg { width:17px; height:17px; }
.pet-restore-hint { position:absolute; pointer-events:auto; width:max-content; max-width:min(236px,calc(100vw - 24px)); padding:9px 12px; border:1px solid var(--pet-border); border-radius:14px; background:var(--pet-surface); box-shadow:0 6px 20px rgba(14,22,38,.13); color:var(--pet-text); font-size:13px; animation:pet-enter .18s ease-out; }
.pet-restore-hint::before { content:""; position:absolute; top:-5px; left:var(--pet-hint-arrow); width:8px; height:8px; border:solid var(--pet-border); border-width:1px 0 0 1px; background:var(--pet-surface); transform:translateX(-50%) rotate(45deg); }
.pet-bubble { position:absolute; display:flex; flex-direction:column; width:min(360px,calc(100vw - 24px)); max-height:min(360px,55vh); overflow:auto; pointer-events:auto; padding:14px 16px 11px; border:1px solid var(--pet-border); border-radius:22px; background:var(--pet-surface); box-shadow:0 8px 30px rgba(14,22,38,.17); animation:pet-enter .18s ease-out; }
.pet-bubble-title { color:var(--pet-muted); font-size:11px; margin-bottom:5px; display:flex; flex-shrink:0; align-items:center; gap:7px; }
.pet-bubble-title strong { font-weight:500; flex:1; }
.pet-bubble[data-kind="welcome"] .pet-bubble-title,.pet-bubble[data-kind="idle"] .pet-bubble-title { color:var(--pet-accent); }
.pet-bubble[data-kind="update"] { border-color:var(--pet-accent); }
.pet-bubble-dismiss { border:0; background:transparent; font-size:18px!important; min-width:24px; min-height:24px; padding:0; color:var(--pet-muted)!important; }
.pet-assistant .pet-bubble-text { display:block; min-height:0; margin:0; white-space:pre-wrap; overflow-wrap:anywhere; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; text-overflow:clip; -webkit-line-clamp:unset; -webkit-box-orient:initial; }
.pet-assistant .pet-bubble-text:focus-visible { outline:2px solid var(--pet-accent); outline-offset:2px; border-radius:3px; }
.pet-links { display:flex; flex-shrink:0; flex-wrap:wrap; gap:6px; margin-top:9px; }
.pet-links:empty { display:none; }
.pet-clipboard { display:flex; min-height:0; flex-direction:column; }
.pet-bubble[data-clipboard="true"] .pet-bubble-text { max-height:7em; flex-shrink:0; }
.pet-clipboard-count { margin:4px 0 7px; color:var(--pet-muted); font-size:12px; }
.pet-clipboard-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(62px,1fr)); gap:6px; min-height:0; overflow:auto; overscroll-behavior:contain; padding:3px; }
.pet-clipboard-image { display:grid; place-items:center; aspect-ratio:1; padding:2px; border:1px solid var(--pet-border); border-radius:9px; background:var(--pet-input); cursor:grab!important; user-select:none; }
.pet-clipboard-image:active { cursor:grabbing!important; }
.pet-clipboard-image img { display:block; width:100%; height:100%; min-width:0; min-height:0; object-fit:contain; border-radius:6px; pointer-events:none; }
.pet-nav { border:1px solid var(--pet-border); border-radius:20px; padding:4px 10px; background:var(--pet-input); font-size:12px!important; }
.pet-chat { position:absolute; pointer-events:auto; display:flex; align-items:flex-end; gap:6px; width:min(360px,calc(100vw - 24px)); padding:10px 11px; background:var(--pet-surface); border:1px solid var(--pet-border); border-radius:25px; box-shadow:0 7px 24px rgba(14,22,38,.15); }
.pet-assistant .pet-input { resize:none; flex:1; min-width:0; width:0; min-height:26px; max-height:84px; border:0!important; border-radius:0!important; background:transparent!important; box-shadow:none!important; color:var(--pet-text)!important; padding:2px 0; outline:none; line-height:22px!important; }
.pet-assistant .pet-input:focus,.pet-assistant .pet-input:focus-visible { outline:none!important; outline-offset:0!important; }
.pet-assistant .pet-chat:focus-within { border-color:var(--pet-accent); box-shadow:0 0 0 3px rgba(66,107,220,.16),0 7px 24px rgba(14,22,38,.15); }
.pet-input::placeholder { color:var(--pet-muted); opacity:1; }
.pet-send,.pet-close { flex:0 0 30px; display:flex; align-items:center; justify-content:center; border:0; padding:0; width:30px; height:30px; border-radius:50%; }
.pet-send { background:var(--pet-accent); color:white!important; }
.pet-send:disabled { opacity:.45; cursor:default; }
.pet-close { background:var(--pet-input); color:var(--pet-muted)!important; font-size:19px!important; }
.pet-typing::after { content:""; display:inline-block; width:18px; animation:pet-dots 1.2s steps(4,end) infinite; }
.pet-error { color:#ae4339; }
body.lg-dark .pet-error,.lg-dark .pet-assistant .pet-error,.pet-assistant[data-theme="dark"] .pet-error { color:#ffa99f; }
.pet-sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@keyframes pet-dots { 0% { content:""; } 25% { content:"·"; } 50% { content:"··"; } 75%,100% { content:"···"; } }
@keyframes pet-enter { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:translateY(0); } }
@media (prefers-reduced-motion:reduce) { .pet-assistant * { animation:none!important; transition:none!important; } }
