/*! ui/notice.css —— 提示条、Toast、运行时错误框、.hidden */
/* ---------- 提示 ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 34px;
  transform: translate(-50%, 14px);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: var(--r-ctrl);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
  z-index: 90;
  box-shadow: var(--sh-3);
}

.toast.on { opacity: 1; transform: translate(-50%, 0); }

.notebar {
  font-size: 12px;
  padding: 9px 16px;
  line-height: 1.55;
  border-bottom: 1px solid var(--rubric-ln);
  background: var(--rubric-bg);
  color: var(--rubric);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.notebar > span { flex: 1; text-align: center; }

/* 提示条与页面内错误框共用的关闭按钮 */
.bar-x {
  border: 0;
  background: transparent;
  color: inherit;
  opacity: .6;
  font-size: 15px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: var(--r-tag);
  flex: 0 0 auto;
}
.bar-x:hover { opacity: 1; background: rgba(127, 127, 127, .18); }

/* 运行时错误的红框：刻意保留的排错入口（见交接文档），可手动关掉 */
.js-error {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 999;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--rubric-bg);
  color: var(--rubric);
  border: 1px solid var(--rubric-ln);
  font-size: 12px;
  padding: 8px 11px;
  border-radius: var(--r-ctrl);
  max-width: 80vw;
  box-shadow: var(--sh-3);
}
.js-error .txt {
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
}

.notebar b { font-weight: 600; }

.notebar.info {
  border-bottom-color: var(--blue-ln);
  background: var(--blue-bg);
  color: var(--blue);
}

.hidden { display: none !important; }

/* ---------- 移动端 Toast 的落点 ----------
 * 原来固定 bottom:34px，手机上正好压在底栏（59px）与演示横条上 ——
 * 「已进入演示」「已删除」这类提示会被导航挡住一半。
 * 抬到底栏 + 演示横条之上（nav-h 58 + 横条 ~32 + 余量）。 */
@media (max-width: 1023px) {
  .toast { bottom: calc(var(--nav-h) + 62px + env(safe-area-inset-bottom, 0px)); }
}

/* 演示沙箱的横条也贴底，Toast 再往上让一档（PC 没有底栏，只要越过横条即可） */
body.demo .toast { bottom: 76px; }
@media (max-width: 1023px) {
  body.demo .toast { bottom: calc(var(--nav-h) + 108px + env(safe-area-inset-bottom, 0px)); }
}
