/* 看得懂小助手 v1.8.32 —— 全局悬浮球 + 对话弹窗
 * ★ 视觉语言与小精灵（CLAW）一致：3D质感悬浮球 + 呼吸光晕 + 圆角白卡 + 分隔线头部 + 渐变按钮
 * ★ 但造型/配色区分：小精灵=紫色机器人3D图；小助手=蓝色对话精灵（蓝色渐变+对话气泡）
 * ★ 整体蓝色布局（品牌蓝 #1e4fd8 → #4f7ce8）
 */
:root{
  --as-primary:#1e4fd8;
  --as-primary2:#4f7ce8;
  --as-light:#eaf1ff;
  --as-bg:#ffffff;
  --as-ink:#1a1f2b;
  --as-sub:#7b8496;
  --as-line:#eef0f4;
}

/* 悬浮球：与小精灵同尺寸/呼吸方式，蓝色3D对话精灵造型（不用 transform:scale） */
.as-bubble{
  position:fixed; right:18px; bottom:24px; z-index:9990;
  width:52px; height:52px; border-radius:50%; border:none;
  display:flex; align-items:center; justify-content:center;
  background:radial-gradient(circle at 32% 28%, #6f9cff 0%, #2f66e0 48%, #1b3fa8 100%);
  color:#fff; font-size:25px; cursor:grab; user-select:none; -webkit-user-select:none;
  touch-action:none; box-shadow:0 6px 20px rgba(30,79,216,.38);
  animation:asBreath 2.6s ease-in-out infinite;
  transition:box-shadow .2s ease;
}
.as-bubble::after{
  content:""; position:absolute; inset:3px; border-radius:50%;
  background:linear-gradient(160deg,rgba(255,255,255,.28),rgba(255,255,255,0) 55%);
  pointer-events:none;
}
.as-bubble:hover{ box-shadow:0 8px 26px rgba(30,79,216,.6); }
.as-bubble.as-dragging{ animation:none; opacity:.9; cursor:grabbing; box-shadow:0 12px 30px rgba(30,79,216,.7); }
@keyframes asBreath{
  0%,100%{ box-shadow:0 6px 20px rgba(30,79,216,.38),0 0 0 0 rgba(30,79,216,.30); }
  50%{ box-shadow:0 6px 20px rgba(30,79,216,.38),0 0 0 10px rgba(30,79,216,0); }
}
.as-bubble .as-dot{
  position:absolute; top:-2px; right:-2px; min-width:17px; height:17px; padding:0 4px;
  border-radius:9px; background:#ff4d4f; color:#fff; font-size:10px; line-height:17px;
  text-align:center; font-weight:700; box-shadow:0 2px 6px rgba(0,0,0,.2); z-index:2;
}

/* 弹窗：与小精灵同款圆角白卡+大阴影；头部改蓝色渐变（区分小精灵白底） */
.as-panel{
  position:fixed; z-index:9991; width:356px; height:508px; max-height:calc(100vh - 40px);
  background:var(--as-bg); color:var(--as-ink); border-radius:16px;
  box-shadow:0 20px 60px rgba(0,0,0,.25); overflow:hidden;
  display:flex; flex-direction:column; border:1px solid var(--as-line);
  font-size:14px; line-height:1.6;
}
.as-panel[hidden],.as-bubble[hidden]{ display:none !important; }
/* ★ v1.8.34：登录界面不显示小助手（与小精灵同判据）——
   移动端 body.m-noauth / PC #loginOverlay.show；登录后自动恢复，无需 JS 监听 */
body.m-noauth .as-bubble{ display:none !important; }
#loginOverlay.show ~ .as-bubble{ display:none !important; }
.as-head{
  display:flex; align-items:center; gap:9px; padding:14px 14px;
  background:linear-gradient(135deg,var(--as-primary),var(--as-primary2));
  color:#fff; flex:none;
}
.as-avatar{
  width:36px; height:36px; border-radius:50%;
  background:rgba(255,255,255,.2); border:1px solid rgba(255,255,255,.45);
  display:flex; align-items:center; justify-content:center; font-size:20px; flex:none;
}
.as-name{ font-weight:700; font-size:15px; flex:1; }
.as-sub{ font-size:11px; opacity:.9; font-weight:400; }
.as-hbtn{
  border:0; background:rgba(255,255,255,.18); color:#fff; border-radius:6px;
  width:27px; height:27px; line-height:1; cursor:pointer; font-size:15px; flex:none;
}
.as-hbtn:hover{ background:rgba(255,255,255,.32); }

.as-msgs{ flex:1; overflow-y:auto; padding:14px; background:#f7f9fd; overscroll-behavior:contain; }
.as-msg{ margin-bottom:11px; display:flex; gap:8px; align-items:flex-start; }
.as-msg.as-me{ flex-direction:row-reverse; }
.as-msg .as-mav{
  width:28px; height:28px; border-radius:50%; color:#fff; font-size:14px;
  display:flex; align-items:center; justify-content:center; flex:none;
  background:linear-gradient(135deg,var(--as-primary),var(--as-primary2));
}
.as-msg.as-me .as-mav{ background:#c3ccdb; }
.as-mbubble{
  max-width:82%; padding:9px 12px; border-radius:12px 12px 12px 3px;
  background:#fff; border:1px solid var(--as-line); white-space:pre-wrap; word-break:break-word;
  box-shadow:0 1px 2px rgba(20,40,90,.04); line-height:1.7;
}
.as-msg.as-me .as-mbubble{
  background:var(--as-light); border-color:#d7e4ff; border-radius:12px 12px 3px 12px;
}
.as-mbubble.as-warn{ background:#fff7e6; border-color:#ffd591; color:#a35500; }
.as-typing{ color:var(--as-sub); font-size:12px; padding:4px 0; }

.as-foot{ flex:none; padding:10px 12px; border-top:1px solid var(--as-line); background:#fff; }
.as-inputrow{ display:flex; gap:7px; align-items:flex-end; }
.as-input{
  flex:1; resize:none; border:1px solid var(--as-line); border-radius:9px;
  padding:8px 10px; font-size:14px; line-height:1.5; max-height:88px; min-height:38px;
  outline:none; font-family:inherit; color:var(--as-ink); background:#fbfcff;
}
.as-input:focus{ border-color:var(--as-primary); background:#fff; }
.as-send{
  border:0; border-radius:9px; padding:0 14px; height:38px; flex:none;
  background:linear-gradient(135deg,var(--as-primary),var(--as-primary2));
  color:#fff; font-weight:700; cursor:pointer; font-size:14px;
  box-shadow:0 3px 10px rgba(30,79,216,.28);
}
.as-send:disabled{ opacity:.5; cursor:not-allowed; box-shadow:none; }
.as-tip{ font-size:11px; color:var(--as-sub); margin-top:7px; text-align:center; }
.as-quick{ display:flex; gap:6px; flex-wrap:wrap; margin-bottom:8px; }
.as-qbtn{
  border:1px solid #d7e4ff; background:var(--as-light); color:var(--as-primary);
  border-radius:13px; padding:3px 10px; font-size:12px; cursor:pointer;
}
.as-qbtn:hover{ background:#dce9ff; }

/* 深色模式（跟随站点 m-dark / body.dark） */
body.m-dark .as-panel,body.dark .as-panel{ background:#1e2330; color:#e8ebf2; border-color:#333a48; }
body.m-dark .as-msgs,body.dark .as-msgs{ background:#171b26; }
body.m-dark .as-mbubble,body.dark .as-mbubble{ background:#252b3a; border-color:#333a48; color:#e8ebf2; }
body.m-dark .as-foot,body.dark .as-foot{ background:#1e2330; border-color:#333a48; }
body.m-dark .as-input,body.dark .as-input{ background:#171b26; border-color:#333a48; color:#e8ebf2; }

/* 手机端：底部半屏弹窗（与小精灵一致） */
@media (max-width:640px){
  .as-bubble{ right:14px; bottom:72px; width:50px; height:50px; font-size:24px; }
  .as-panel{
    left:0 !important; right:0 !important; bottom:0 !important; top:auto !important;
    width:100% !important; height:72vh; max-height:72vh; border-radius:16px 16px 0 0;
    border-bottom:0;
  }
}
@media (max-height:420px){
  .as-panel{ height:calc(100vh - 20px) !important; }
}
