#kanban-doll{
  position:fixed;
  right:10px;
  bottom:0;
  z-index:1000;
  width:230px;
  max-width:34vw;
  pointer-events:auto;
  user-select:none;
  animation:kb-in .8s ease both;
}

.kanban-wrap{
  position:relative;
  width:100%;
  height:430px;
  max-height:58vh;
  transform:translate(var(--kb-mx,0),var(--kb-my,0));
  transition:transform .45s cubic-bezier(.25,.46,.45,.94);
  filter:drop-shadow(0 12px 24px rgba(0,0,0,.22));
  cursor:pointer;
  touch-action:manipulation;
}

.kanban-canvas{
  display:block;
  width:100%;
  height:100%;
}

.kanban-fallback{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:contain;
  opacity:0;
  visibility:hidden;
  transition:opacity .25s ease,visibility .25s ease;
  pointer-events:none;
}

#kanban-doll.is-fallback .kanban-canvas{
  opacity:0;
}

#kanban-doll.is-fallback .kanban-fallback{
  opacity:1;
  visibility:visible;
  animation:kb-breathe 4s ease-in-out infinite;
}

#kanban-bubble{
  position:absolute;
  left:-10px;
  top:16px;
  transform:translateX(-100%);
  max-width:190px;
  background:#fff;
  color:#444;
  font-size:12px;
  line-height:1.55;
  padding:9px 13px;
  border-radius:12px;
  box-shadow:0 5px 16px rgba(0,0,0,.13);
  opacity:0;
  visibility:hidden;
  transition:opacity .35s,visibility .35s;
  pointer-events:none;
}

#kanban-bubble.show{
  opacity:1;
  visibility:visible;
}

#kanban-bubble::after{
  content:"";
  position:absolute;
  right:-7px;
  top:16px;
  border:7px solid transparent;
  border-left-color:#fff;
  border-right:0;
}

.kanban-close{
  position:absolute;
  left:8px;
  top:8px;
  z-index:3;
  width:24px;
  height:24px;
  padding:0;
  border:0;
  border-radius:50%;
  background:rgba(0,0,0,.38);
  color:#fff;
  font-size:17px;
  line-height:24px;
  cursor:pointer;
  opacity:0;
  transition:opacity .25s ease,background .25s ease;
}

#kanban-doll:hover .kanban-close,
.kanban-close:focus-visible{
  opacity:1;
}

.kanban-close:hover{
  background:rgba(0,0,0,.55);
}

.kanban-reopen{
  position:fixed;
  right:14px;
  bottom:14px;
  z-index:1000;
  min-width:52px;
  height:44px;
  padding:0 11px;
  border:0;
  border-radius:999px;
  cursor:pointer;
  background:linear-gradient(135deg,#f06c9b,#62b6cb);
  color:#fff;
  font-size:12px;
  font-weight:700;
  letter-spacing:0;
  box-shadow:0 6px 18px rgba(0,0,0,.18);
  display:none;
  align-items:center;
  justify-content:center;
  transition:transform .25s ease,box-shadow .25s ease;
}

.kanban-reopen:hover{
  transform:translateY(-2px);
  box-shadow:0 9px 22px rgba(0,0,0,.2);
}

.kanban-reopen.show{
  display:flex;
  animation:kb-in .5s ease both;
}

@keyframes kb-in{
  from{opacity:0;transform:translateY(30px)}
  to{opacity:1;transform:translateY(0)}
}

@keyframes kb-breathe{
  0%,100%{transform:translateY(0) scale(1)}
  50%{transform:translateY(-5px) scale(1.007)}
}

@media(max-width:768px){
  #kanban-doll{
    right:2px;
    width:156px;
    max-width:38vw;
  }

  .kanban-wrap{
    height:292px;
    max-height:46vh;
  }

  #kanban-bubble{
    left:auto;
    right:4px;
    top:-8px;
    transform:translateY(-100%);
    max-width:150px;
    font-size:11px;
  }

  #kanban-bubble::after{
    right:22px;
    top:auto;
    bottom:-7px;
    border:7px solid transparent;
    border-top-color:#fff;
    border-bottom:0;
  }
}

@media(prefers-reduced-motion:reduce){
  #kanban-doll,
  #kanban-doll.is-fallback .kanban-fallback,
  .kanban-reopen{
    animation:none;
  }

  .kanban-wrap,
  .kanban-close,
  .kanban-reopen,
  #kanban-bubble,
  .kanban-fallback{
    transition:none;
  }
}

/* —— 看板娘静态图片型(如银发少女) —— */
#kanban-doll.is-image .kanban-canvas{
  opacity:0;
}
#kanban-doll.is-image .kanban-fallback{
  opacity:1;
  visibility:visible;
  animation:kb-breathe 4s ease-in-out infinite;
}

/* —— 看板娘切换条(右上角 · 常驻 · 可折叠) —— */
.kanban-switch{
  position:absolute;
  top:8px;
  right:8px;
  z-index:4;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:6px;
  max-width:62%;
}

.kanban-switch-toggle{
  border:0;
  border-radius:999px;
  padding:3px 11px;
  font-size:11px;
  font-weight:700;
  line-height:1.5;
  cursor:pointer;
  color:#fff;
  background:rgba(0,0,0,.5);
  box-shadow:0 3px 9px rgba(0,0,0,.18);
  display:inline-flex;
  align-items:center;
  gap:5px;
  transition:background .2s ease;
}
.kanban-switch-toggle:hover{ background:rgba(0,0,0,.66); }
.kanban-switch-toggle::after{
  content:"\25BE";
  font-size:10px;
  transition:transform .2s ease;
}
.kanban-switch.collapsed .kanban-switch-toggle::after{
  transform:rotate(-90deg);
}

.kanban-switch-list{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:5px;
}
.kanban-switch.collapsed .kanban-switch-list{
  display:none;
}

.kanban-switch-btn{
  border:0;
  border-radius:999px;
  padding:3px 11px;
  font-size:11px;
  font-weight:700;
  line-height:1.5;
  cursor:pointer;
  color:#fff;
  background:rgba(0,0,0,.42);
  box-shadow:0 3px 9px rgba(0,0,0,.16);
  transition:background .2s ease,transform .2s ease,box-shadow .2s ease;
  white-space:nowrap;
}
.kanban-switch-btn:hover{
  transform:translateY(-1px);
  background:rgba(0,0,0,.6);
}
.kanban-switch-btn.is-active{
  background:linear-gradient(135deg,#f06c9b,#62b6cb);
  box-shadow:0 4px 12px rgba(240,108,155,.42);
}

@media (max-width:768px){
  .kanban-switch{ top:4px; right:4px; gap:4px; }
  .kanban-switch-toggle,
  .kanban-switch-btn{ padding:2px 9px; font-size:10px; }
}

@media (prefers-reduced-motion:reduce){
  .kanban-switch-toggle,
  .kanban-switch-toggle::after,
  .kanban-switch-btn{ transition:none; }
  #kanban-doll.is-image .kanban-fallback{ animation:none; }
}
