.merry-bot { --mb-text:#edf1fa; --mb-muted:#b2bfd5; --mb-line:#455874; --mb-accent:#edd9a1; --mb-bg:#142034; position:relative; z-index:20; font-family:"Fusion Pixel","Microsoft YaHei",sans-serif; font-size:17px; line-height:1.6; }
.merry-bot [hidden] { display:none !important; }
.merry-bot button,.merry-bot input { font:inherit; border-radius:0; }
.merry-bot button { cursor:pointer; color:var(--mb-text); background:#1d2d43; border:1px solid var(--mb-line); min-height:44px; padding:8px 12px; }
.merry-bot button:hover { color:var(--mb-accent); border-color:var(--mb-accent); }
.merry-bot :is(button,input,a):focus-visible { outline:2px solid var(--mb-accent); outline-offset:3px; }
.merry-bot .merry-launcher { position:fixed; bottom:max(20px,env(safe-area-inset-bottom)); right:24px; display:flex; align-items:center; gap:12px; width:auto; height:64px; min-width:64px; padding:0; border:0; background:transparent; }
.merry-launcher-label { position:relative; display:flex; align-items:center; min-height:44px; padding:8px 12px; border:1px solid #7185a5; background:var(--mb-bg); color:var(--mb-text); font-size:16px; line-height:1.5; white-space:nowrap; }
.merry-launcher-label::after { content:""; position:absolute; top:calc(50% - 4px); right:-5px; width:8px; height:8px; border:inherit; border-left:0; border-bottom:0; background:inherit; transform:rotate(45deg); }
.merry-launcher:is(:hover,:focus-visible) .merry-launcher-label { border-color:var(--mb-accent); color:var(--mb-accent); background:#1d2d43; }
.merry-launcher:active .merry-launcher-label { background:var(--mb-accent); color:var(--mb-bg); }
.merry-avatar { display:block; flex:none; object-fit:contain; image-rendering:pixelated; }
.merry-panel { position:fixed; bottom:96px; right:24px; width:min(380px,calc(100vw - 32px)); max-height:min(650px,calc(100dvh - 128px)); display:flex; flex-direction:column; background:var(--mb-bg); border:1px solid #7185a5; color:var(--mb-text); }
.merry-panel-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 18px; border-bottom:1px solid var(--mb-line); }
.merry-identity { display:flex; align-items:center; gap:10px; min-width:0; }
.merry-panel-header h2 { margin:0; font-size:23px; font-weight:400; color:var(--mb-accent); }
.merry-panel-header p { margin:3px 0 0; font-size:13px; color:var(--mb-muted); }
.merry-panel-header button { padding:8px; min-width:44px; background:transparent; border-color:transparent; }
.merry-panel-header svg { width:16px; height:16px; vertical-align:middle; }
.merry-messages { overflow:auto; overscroll-behavior:contain; min-height:120px; padding:18px; scrollbar-color:#7388ab #142034; }
.merry-message { margin:0 0 20px; }
.merry-message:last-child { margin-bottom:4px; }
.merry-speaker { margin:0 0 6px; font-size:14px; color:#d2bce7; }
.merry-user .merry-speaker { color:#a8d6e3; }
.merry-message p { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.merry-message .merry-speaker { margin-bottom:6px; }
.merry-user { padding:12px 14px; background:#20314a; }
.merry-message-links { display:flex; flex-direction:column; gap:6px; margin-top:10px; }
.merry-message-links a { display:block; color:var(--mb-accent); text-decoration:underline; text-underline-offset:4px; padding:4px 0; min-height:36px; }
.merry-followups { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.merry-followups button { font-size:15px; background:transparent; }
.merry-topics { display:flex; flex-wrap:wrap; gap:6px; padding:12px 16px; border-top:1px solid var(--mb-line); }
.merry-topics button { font-size:14px; min-height:36px; padding:6px 9px; background:transparent; }
.merry-input-row { display:flex; align-items:center; gap:8px; padding:0 16px 16px; }
.merry-input-row input { width:100%; min-width:0; padding:10px 12px; color:var(--mb-text); background:#101b2b; border:1px solid var(--mb-line); font-size:16px; caret-color:var(--mb-accent); }
.merry-input-row input::placeholder { color:var(--mb-muted); }
.merry-input-row button { flex:none; padding:9px 12px; font-size:16px; }
.merry-bot a { -webkit-tap-highlight-color:transparent; }
.has-merry-bot:not(.entrance) .site-footer { padding-bottom:88px; }
.entrance .merry-launcher { top:24px; bottom:auto; }
.entrance .merry-panel { top:100px; bottom:auto; }
@media(max-width:720px) {
 .entrance .merry-panel { top:90px; bottom:auto; }
 .merry-bot .merry-launcher { right:14px; bottom:max(14px,env(safe-area-inset-bottom)); }
 .entrance .merry-launcher { top:14px; bottom:auto; }
 .merry-panel { right:12px; bottom:max(90px,calc(env(safe-area-inset-bottom) + 76px)); width:calc(100vw - 24px); max-height:calc(100dvh - 114px); }
 .merry-panel-header { padding:12px 14px; }
 .merry-messages { padding:14px; }
 .merry-topics { padding:10px 12px; }
 .merry-input-row { padding:0 12px 12px; }
 .spring-reading .merry-launcher, .contact-page .merry-launcher { position:static; margin:0 20px 24px auto; }
 .has-merry-bot.spring-reading .site-footer, .has-merry-bot.contact-page .site-footer { padding-bottom:24px; }
}
