/* 📓 活页本面板 — 底部滑上来的浮层 */

/* 遮罩+面板容器 */
.nb-overlay {
  position: fixed; inset: 0; z-index: 310;
  background: rgba(74,63,53,0.35);
  display: none;
  animation: nbFadeIn 0.2s ease;
}
.nb-overlay.open { display: block; }
@keyframes nbFadeIn { from { opacity: 0; } to { opacity: 1; } }

.nb-panel {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 85vh;
  background: var(--bg, #fffcf8);
  border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column;
  z-index: 311;
  animation: nbSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -4px 24px rgba(120,95,60,0.15);
}
@keyframes nbSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* 手柄+标题 */
.nb-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 6px;
  border-bottom: 1px solid var(--border, #e5e0d6);
  flex-shrink: 0;
}
.nb-handle {
  width: 40px; height: 4px; background: var(--border-strong, #ccc);
  border-radius: 2px; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  cursor: pointer;
}
.nb-panel-title { font-size: 16px; font-weight: 600; color: var(--text-primary, #333); }
.nb-panel-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted, #999); padding: 4px 8px; }

/* 可滚动内容区 */
.nb-body {
  flex: 1; overflow-y: auto; padding: 12px 16px 24px;
  -webkit-overflow-scrolling: touch;
}

/* 注入开关行 */
.nb-inject-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.nb-inject-row label { font-size: 14px; font-weight: 500; margin: 0; }
.nb-inject-label { font-size: 12px; color: var(--text-muted, #999); }
.nb-indicator { font-size: 11px; color: var(--text-muted, #999); margin-bottom: 14px; padding-left: 2px; }

/* 状态条 */
.nb-status { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-alt, #f8f5f0); border-radius: 8px; margin-bottom: 12px; flex-wrap: wrap; font-size: 13px; }
.nb-status b { color: var(--text-primary, #333); }
.nb-status-warn { color: #e07b39; }
.nb-preview-btn { background: none; border: 1px solid var(--border, #ddd); border-radius: 6px; padding: 3px 8px; cursor: pointer; font-size: 12px; }
.nb-preview { background: var(--bg-alt, #faf7f2); color: var(--text-primary, #333); font-family: 'Courier New', monospace; font-size: 11px; padding: 10px; border: 1px solid var(--border, #e5e5e5); border-radius: 8px; margin-bottom: 12px; white-space: pre-wrap; max-height: 200px; overflow-y: auto; display: none; }

/* 过滤 */
.nb-filters { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.nb-filters select, .nb-filters input { padding: 5px 8px; border: 1px solid var(--border, #ddd); border-radius: 6px; font-size: 12px; background: var(--bg, #fff); }
.nb-filters input { flex: 1; min-width: 100px; }

/* 列表 */
.nb-group-title { font-size: 14px; font-weight: 600; margin: 12px 0 6px; color: var(--text-primary, #333); }
.nb-empty { text-align: center; padding: 30px; color: var(--text-muted, #999); font-size: 13px; }

.nb-item { border: 1px solid var(--border, #e5e0d6); border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; }
.nb-item-main { display: flex; align-items: flex-start; gap: 6px; cursor: pointer; }
.nb-tier { font-size: 11px; flex-shrink: 0; margin-top: 2px; }
.nb-item-text { font-size: 13px; color: var(--text-primary, #333); line-height: 1.5; flex: 1; }
.nb-edit-toggle { background: none; border: none; font-size: 13px; cursor: pointer; color: var(--text-muted, #999); padding: 2px; flex-shrink: 0; }
.nb-edit-toggle.open { color: #e07b39; }
.nb-item-meta { font-size: 11px; color: var(--text-muted, #999); margin-top: 3px; }
.nb-from-dog { color: #e07b39; }
.nb-from-cheng { color: #4a9e4a; }
.nb-from-auto { color: #999; }

/* 编辑区 */
.nb-edit { display: none; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border, #e5e5e5); }
.nb-edit.open { display: block; }
.nb-edit textarea { width: 100%; min-height: 50px; padding: 6px; border: 1px solid var(--border, #ddd); border-radius: 6px; font-size: 12px; resize: vertical; box-sizing: border-box; }
.nb-edit input { width: 100%; padding: 5px 6px; border: 1px solid var(--border, #ddd); border-radius: 6px; font-size: 12px; margin-top: 4px; box-sizing: border-box; }
.nb-edit select { padding: 5px 6px; border: 1px solid var(--border, #ddd); border-radius: 6px; font-size: 12px; margin-top: 4px; }
.nb-edit-btns { display: flex; gap: 6px; margin-top: 6px; }
.nb-edit-btns button { padding: 5px 12px; border: none; border-radius: 6px; cursor: pointer; font-size: 12px; }
.nb-btn-save { background: var(--accent, #e07b39); color: white; }
.nb-btn-del { background: none; color: #e55; border: 1px solid #e55 !important; }

/* 新增表单 */
.nb-add-toggle { background: none; border: 1px dashed var(--accent, #e07b39); color: var(--accent, #e07b39); border-radius: 6px; padding: 5px 12px; cursor: pointer; font-size: 12px; margin-bottom: 10px; }
.nb-add-form { display: none; border: 1px solid var(--accent, #e07b39); border-radius: 8px; padding: 10px; margin-bottom: 12px; background: rgba(224,123,57,0.06); }
.nb-add-form.open { display: block; }
.nb-add-form textarea, .nb-add-form input, .nb-add-form select { width: 100%; padding: 5px 6px; border: 1px solid var(--border, #ddd); border-radius: 6px; font-size: 12px; margin-top: 4px; box-sizing: border-box; }
.nb-add-form textarea { min-height: 40px; resize: vertical; }
.nb-add-btn { background: var(--accent, #e07b39); color: white; border: none; border-radius: 6px; padding: 5px 12px; cursor: pointer; font-size: 12px; margin-top: 6px; }
