/* common.css —— 跨页通用样式补丁 */

/* 版本刷新横幅 */
#version-banner {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #121212, #262626);
  color: #fafafa;
  border-radius: 999px;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
  z-index: 9999;
  font-size: 13px;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
}
#version-banner.show {
  display: inline-flex;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#version-banner .vb-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(98,209,120,.2);
  animation: pulse 1.8s ease-out infinite;
}
#version-banner .vb-btn {
  background: var(--success);
  color: #0a0a0a;
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  border: 0;
}
#version-banner .vb-btn:hover { background: var(--success-strong); }
#version-banner .vb-x {
  cursor: pointer; opacity: .7;
}
#version-banner .vb-x:hover { opacity: 1; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(98,209,120,.5); }
  70% { box-shadow: 0 0 0 10px rgba(98,209,120,0); }
  100% { box-shadow: 0 0 0 0 rgba(98,209,120,0); }
}

/* 移动端汉堡菜单 */
.mobile-toggle {
  display: none;
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--muted-foreground);
}
.mobile-toggle:hover { background: var(--accent); color: var(--foreground); }
@media (max-width: 900px) {
  .mobile-toggle { display: inline-flex; }
  .app > aside.sidebar.mobile-open {
    display: flex;
    position: fixed;
    inset: 48px auto 0 0;
    width: 240px;
    z-index: 200;
    box-shadow: var(--shadow-lg);
    background: var(--sidebar);
  }
  .sidebar-backdrop {
    display: none;
    position: fixed; inset: 48px 0 0 0;
    background: rgba(0,0,0,.35);
    z-index: 199;
  }
  .sidebar-backdrop.show { display: block; }
}

/* 键盘快捷键提示 */
.kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--muted);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
}

/* 顶部 toast（多页通用，覆盖原页面局部 toast） */
.toast {
  position: fixed;
  left: 50%;
  bottom: 60px;
  transform: translateX(-50%);
  background: #121212;
  color: #fafafa;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; }

/* 自动加载态 */
.is-loading {
  position: relative; pointer-events: none;
}
.is-loading::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(255,255,255,.4);
  backdrop-filter: blur(1px);
}
