/* toast.css - Stage 内右上角 Toast */

/* 宿主容器：放在 #stage 里时是 stage 右上角；如果临时挂在 body，也会在 body 右上角 */
#toast-host{
  position: absolute;         /* 关键：相对父元素定位（stage 是 relative） */
  top: 14px;
  right: 14px;
  z-index: 80;                /* 高于 stage 内大多数层 */
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;       /* 空白区域不挡点击 */
}

/* 单条 toast */
.toast{
  width: 280px;
  max-width: min(280px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: 6px 1fr auto;
  gap: 10px;
  align-items: start;

  padding: 10px 10px 10px 0;
  border-radius: 8px;
  background: #000000;
  color: #ffffff;
  border: 1px solid #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8);

  transform: translateY(-8px);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
  pointer-events: auto;       /* toast 本体可交互 */
  overflow: hidden;
}

.toast.show{
  transform: translateY(0);
  opacity: 1;
}

.toast.hide{
  transform: translateY(-6px);
  opacity: 0;
}

/* 左侧色条 */
.toast .bar{
  display: block;
  width: 6px;
  height: 100%;
  border-radius: 8px 0 0 8px;
  background: #ffffff;
}

/* 内容区 */
.toast .content{
  padding-top: 1px;
}

.toast .title{
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 4px;
  color: #ffffff;
}

.toast .msg{
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
  color: #ffffff;
}

/* 关闭按钮（与 JS 对齐：class="close"） */
.toast .close{
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 18px;
  line-height: 1;
  color: rgba(255,255,255,0.6);
}
.toast .close:hover{ color: #ffffff; }

/* 进度条 */
.toast .progress{
  margin-top: 8px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  overflow: hidden;
}

.toast .progress > i{
  display: block;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(1);
  background: #ffffff;
}

/* 类型配色：纯黑白线框风格下均使用高亮白色，并通过不同边框区分 */
.toast.success .bar{ background: #ffffff; }
.toast.warn    .bar{ background: #ffffff; }
.toast.error   .bar{ background: #ffffff; }
.toast.info    .bar{ background: #ffffff; }
