/* ==========================================
   一流导航 · 现代化重设计
   设计原则：清晰层级、紧凑信息密度、温和深色侧栏
   ========================================== */

/* 顶部栏：深色玻璃质感 */
.nav-shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 16px auto 32px;
}
.nav-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(48, 40, 32, 0.96) !important;
  border-color: transparent !important;
  box-shadow: 0 8px 24px rgba(28, 22, 16, 0.18) !important;
  border-radius: 16px !important;
  padding: 12px 18px !important;
}
.nav-topbar .brand strong { color: #fff7e7 !important; }
.nav-topbar .brand small { color: #b3a08a !important; }
.nav-topbar .brand-mark { background: var(--accent); color: #fff7e7; }
.nav-topbar .status-pill { background: rgba(255,255,255,0.08); color: #eadccd; border-color: rgba(255,255,255,0.12); }

/* 顶部搜索框：深底亮字 */
.nav-search-wrap {
  display: flex;
  flex: 1 1 320px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}
.nav-search-wrap input {
  flex: 1;
  width: auto;
  min-width: 0;
  color: #fff7e7 !important;
}
.nav-search-icon,
.nav-search-wrap .ghost-chip { flex: none; }
.nav-search-wrap input::placeholder { color: #9a8a78; }
.nav-search-icon { color: #9a8a78 !important; }
.nav-topbar .ghost-chip { background: rgba(255,255,255,0.08); color: #eadccd; border-color: transparent; }

/* 主体布局 */
.nav-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
  margin-top: 18px;
}

/* === 左侧分组栏 === */
.nav-side {
  position: sticky;
  top: 14px;
}
.group-list {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--shadow-soft);
}
.group-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--ink-soft);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 140ms ease;
  margin-bottom: 2px;
}
.group-item:hover {
  background: var(--paper-2);
  color: var(--ink);
}
.group-item.is-active {
  background: var(--accent);
  color: #fff7e7;
  box-shadow: 0 4px 12px rgba(201, 102, 72, 0.28);
}
.group-item .g-name { flex: 1; }
.group-item .g-count {
  min-width: 22px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--paper-3);
  border-radius: 999px;
  padding: 0 7px;
}
.group-item.is-active .g-count {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.92);
}

/* 底部说明 */
.nav-foot-note {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.nav-foot-note p { margin: 0 0 4px; }
.nav-foot-note p:last-child { margin: 0; font-weight: 700; color: var(--ink-soft); }

/* === 右侧主区域 === */
.nav-main { min-width: 0; }

/* 分组标题条 */
.nav-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 0 2px;
}
.nav-section-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.nav-section-head .section-count {
  font-size: 12px;
  color: var(--muted);
  background: var(--paper-3);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
}

/* === 卡片网格 === */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

/* 单个卡片 */
.bk-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(82, 62, 43, 0.04);
  transition: all 180ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.bk-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 180ms ease;
}
.bk-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 20px rgba(82, 62, 43, 0.1);
  transform: translateY(-2px);
}
.bk-card:hover::before { opacity: 1; }

/* 卡片图标 */
.bk-card-icon {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--paper-2);
  border-radius: 9px;
  overflow: hidden;
  position: relative;
}
.bk-card-icon img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}
.bk-card-icon img[style*="display:none"] + .icon-fallback,
.bk-card-icon img.hidden + .icon-fallback {
  display: grid;
}
.icon-fallback {
  display: none;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  background: linear-gradient(135deg, #f5e6d8, #f0dcc8);
}

/* 卡片内容 */
.bk-card-body {
  flex: 1;
  min-width: 0;
  padding-right: 82px;
}
.bk-card-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  white-space: normal;
  word-break: break-all;
  line-height: 1.4;
  margin-bottom: 2px;
}
.bk-card-host {
  display: block;
  font-size: 11px;
  color: #8a7a68;
  overflow: hidden;
  white-space: normal;
  word-break: break-all;
  font-weight: 500;
}

/* 卡片操作 */
.bk-card-actions {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: var(--paper);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(82, 62, 43, 0.14);
  opacity: 0;
  transition: opacity 180ms ease;
}
.bk-card:hover .bk-card-actions,
.bk-card:focus-within .bk-card-actions { opacity: 1; }

.nav-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  transition: all 140ms ease;
  cursor: pointer;
}
.nav-open-btn:hover {
  color: #fff7e7;
  background: var(--accent);
  border-color: var(--accent);
}
.nav-del-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all 140ms ease;
}
.nav-del-btn:hover {
  color: #b84531;
  background: #f7ded2;
  border-color: #f0c4b5;
}

/* 自定义标记 */
.bk-card.is-custom .bk-card-icon { background: #dbeafe; }
.bk-card.is-custom::before { background: #3b82f6; }

/* === 空状态 === */
.nav-empty {
  padding: 80px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--paper);
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
}
.nav-empty p { margin: 0 0 8px; font-size: 14px; }
.nav-empty .empty-hint { font-size: 12px; color: var(--muted); }

/* === 添加面板 === */
.add-panel {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(28, 22, 16, 0.5);
  backdrop-filter: blur(8px);
}
.add-card {
  width: min(420px, 92vw);
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.add-card h2 { margin: 0 0 18px; font-size: 20px; }
.add-card label { display: grid; gap: 6px; margin-bottom: 14px; }
.add-card label span { color: var(--muted); font-size: 12px; font-weight: 700; }
.add-card input {
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--ink);
  outline: none;
  font-size: 14px;
}
.add-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(201, 102, 72, 0.12);
}
.split-row { display: flex; gap: 10px; margin-top: 6px; }
.split-row > * { flex: 1; }

/* === 响应式 === */
@media (max-width: 960px) {
  .nav-topbar { flex-wrap: wrap; gap: 12px; }
  .nav-search-wrap { order: 3; width: 100%; flex-basis: 100%; }
  .nav-actions { order: 2; }
}
@media (max-width: 720px) {
  .nav-layout { grid-template-columns: 1fr; }
  .nav-side { position: static; }
  .group-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .group-item { flex: none; min-height: 44px; }
  .nav-actions button { min-height: 44px; }
  .nav-grid { grid-template-columns: 1fr; }
  .bk-card { flex-wrap: wrap; align-items: flex-start; }
  .bk-card-body { padding-right: 0; }
  .bk-card-actions {
    position: static;
    flex: 0 0 100%;
    width: 100%;
    justify-content: flex-end;
    transform: none;
    opacity: 1;
  }
  .nav-open-btn,
  .nav-del-btn {
    width: 44px;
    height: 44px;
  }
}
