/* ═══════════════════════════════════════════
   Wise Navbar — 可拖拽导航按钮样式
   - 默认位置：左上 home，右上 menu
   - 拖拽时禁用过渡动画，位置由 JS inline style 控制
   ═══════════════════════════════════════════ */

:root {
  --nv-primary: #9fe870;
  --nv-on-primary: #0e0f0c;
  --nv-primary-active: #cdffad;
  --nv-primary-pale: #e2f6d5;
  --nv-ink: #0e0f0c;
  --nv-ink-deep: #163300;
  --nv-body: #454745;
  --nv-mute: #868685;
  --nv-surface: #ffffff;
  --nv-surface-soft: #e8ebe6;
}

/* ── Button base (shared) ── */
.wise-nav-btn {
  position: fixed;
  top: 16px;
  z-index: 9999;
  width: 42px;
  height: 42px;
  border: none;
  background: var(--nv-surface-soft);
  color: var(--nv-body);
  cursor: grab;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(14,15,12,0.08);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-radius 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.wise-nav-btn:hover {
  background: #d8dbd6;
  color: var(--nv-ink);
}

.wise-nav-btn:active {
  background: var(--nv-primary-pale);
}

/* 拖拽中 */
.wise-nav-btn.dragging {
  cursor: grabbing;
  transition: none !important;
  opacity: 0.92;
  box-shadow: 0 6px 20px rgba(14,15,12,0.18);
}

.wise-nav-btn .material-symbols-rounded {
  font-size: 1.35rem;
  font-variation-settings: 'FILL' 1, 'wght' 400;
  pointer-events: none;
}

/* ── Home button: top-left (默认，JS 可覆盖) ── */
.wise-nav-btn-home { left: 16px; }

/* ── Menu button: top-right (默认，JS 可覆盖) ── */
.wise-nav-btn-menu { right: 16px; }

/* ── Drawer (bottom sheet) ── */
.wise-nav-drawer {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9998;
  background: rgba(14,15,12,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.wise-nav-drawer.open {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.wise-nav-drawer-panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  max-height: 80vh;
  background: var(--nv-surface);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 40px rgba(14,15,12,0.12);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.2,0,0,1);
}

.wise-nav-drawer.open .wise-nav-drawer-panel { transform: translateY(0); }

.wise-nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 8px 8px 12px;
  border-bottom: 1px solid var(--nv-surface-soft);
}

.wise-nav-drawer-title {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--nv-ink);
}

.wise-nav-drawer-close {
  width: 32px; height: 32px;
  border: none;
  background: var(--nv-surface-soft);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nv-body);
  transition: background 0.2s;
}

.wise-nav-drawer-close:hover { background: var(--nv-primary-pale); }

.wise-nav-drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--nv-body);
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.wise-nav-drawer-link:hover {
  background: var(--nv-primary-pale);
  color: var(--nv-ink-deep);
}

.wise-nav-drawer-link.active {
  background: var(--nv-ink);
  color: var(--nv-primary);
}

.wise-nav-drawer-link .nv-icon {
  width: 36px; height: 36px;
  background: var(--nv-surface-soft);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.wise-nav-drawer-link.active .nv-icon {
  background: rgba(159,232,112,0.15);
}

/* ── Overlay mode for full-screen SPAs ── */
body.navbar-overlay .wise-nav-btn {
  background: rgba(255,255,255,0.12);
  color: #fff;
  box-shadow: 0 3px 16px rgba(0,0,0,0.3);
}

body.navbar-overlay .wise-nav-btn:hover { background: rgba(255,255,255,0.2); }

/* ── Desktop ── */
@media screen and (min-width: 768px) {
  .wise-nav-btn {
    top: 24px;
    width: 46px; height: 46px;
    border-radius: 16px;
  }
  .wise-nav-btn-home { left: 24px; }
  .wise-nav-btn-menu { right: 24px; }
  .wise-nav-btn .material-symbols-rounded { font-size: 1.45rem; }
  .wise-nav-drawer-panel {
    max-width: 360px;
    left: auto;
    right: 24px;
    bottom: 24px;
    border-radius: 24px;
    max-height: 70vh;
    box-shadow: 0 12px 48px rgba(14,15,12,0.15);
  }
}
